fix misc compile issues for minor ports.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5036 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2016-12-21 15:48:52 +00:00
parent a7621b7bd8
commit 68e535c5b2
6 changed files with 49 additions and 12 deletions

View file

@ -161,11 +161,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//================================================================= LINUX ===
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(ANDROID) || defined(__ANDROID__)
#include <endian.h>
#if defined(__linux__)
#if defined(ANDROID) || defined(__ANDROID__)
#define OS_STRING "android"
#elif defined(__linux__)
#define OS_STRING "linux"
#else
#define OS_STRING "kFreeBSD"
@ -330,6 +332,30 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#ifdef FTE_TARGET_WEB
#define OS_STRING "emscripten"
#define ID_INLINE static inline
#define PATH_SEP '/'
#define ARCH_STRING "web"
#define Q3_LITTLE_ENDIAN
#define DLL_EXT ".so"
#endif
#ifdef NACL
#define OS_STRING "nacl"
#define ID_INLINE static inline
#define PATH_SEP '/'
#define ARCH_STRING "web"
#define Q3_LITTLE_ENDIAN
#define DLL_EXT ".so"
#endif
//================================================================== Q3VM ===
#ifdef Q3_VM
@ -348,23 +374,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//catch missing defines in above blocks
#if !defined( OS_STRING )
#error "Operating system not supported"
#define ARCH_STRING "unknown"
//#error "Operating system not supported"
#endif
#if !defined( ARCH_STRING )
#error "Architecture not supported"
#define ARCH_STRING "unk"
//#error "Architecture not supported"
#endif
#ifndef ID_INLINE
#error "ID_INLINE not defined"
#define ID_INLINE static
//#error "ID_INLINE not defined"
#endif
#ifndef PATH_SEP
#error "PATH_SEP not defined"
#define PATH_SEP '/'
//#error "PATH_SEP not defined"
#endif
#ifndef DLL_EXT
#error "DLL_EXT not defined"
#define DLL_EXT ".so"
//#error "DLL_EXT not defined"
#endif

View file

@ -5672,6 +5672,7 @@ static struct {
// {"bulleten", PF_bulleten, 243}, (removed builtin)
{"rotatevectorsbytag", PF_rotatevectorsbytag, 244},
{"mod", PF_mod, 245},
{"sqlconnect", PF_NoCSQC, 250}, // #250 float([string host], [string user], [string pass], [string defaultdb], [string driver]) sqlconnect (FTE_SQL)
{"sqldisconnect", PF_NoCSQC, 251}, // #251 void(float serveridx) sqldisconnect (FTE_SQL)

View file

@ -1132,6 +1132,7 @@ static void OpenAL_Shutdown (soundcardinfo_t *sc)
Z_Free(oali->effecttype);
#endif
palcMakeContextCurrent(NULL);
palcDestroyContext(oali->OpenAL_Context);
palcCloseDevice(oali->OpenAL_Device);
Z_Free(oali);

View file

@ -109,7 +109,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if !defined(_MSC_VER) || _MSC_VER > 1200
#define HAVE_WINSSPI //built in component, checks against windows' root ca database and revocations etc.
#endif
#elif defined(__linux__) || defined(__CYGWIN__)
#elif (defined(__linux__) || defined(__CYGWIN__)) && !defined(ANDROID)
#define HAVE_GNUTLS //currently disabled as it does not validate the server's certificate, beware the mitm attack.
#endif
#endif

View file

@ -195,8 +195,10 @@ static void HLMDL_PrepareVerticies (hlmodel_t *model, hlmdl_submodel_t *amodel,
mesh->lmst_array[0] = ZG_Malloc(model->memgroup, sizeof(*mesh->lmst_array[0])*uvertcount);
mesh->xyz_array = ZG_Malloc(model->memgroup, sizeof(*mesh->xyz_array)*uvertcount);
mesh->normals_array = ZG_Malloc(model->memgroup, sizeof(*mesh->normals_array)*uvertcount);
#if defined(RTLIGHTS)
mesh->snormals_array = ZG_Malloc(model->memgroup, sizeof(*mesh->snormals_array)*uvertcount);
mesh->tnormals_array = ZG_Malloc(model->memgroup, sizeof(*mesh->tnormals_array)*uvertcount);
#endif
mesh->bonenums = ZG_Malloc(model->memgroup, sizeof(*mesh->bonenums)*uvertcount);
mesh->boneweights = ZG_Malloc(model->memgroup, sizeof(*mesh->boneweights)*uvertcount);
@ -220,8 +222,10 @@ static void HLMDL_PrepareVerticies (hlmodel_t *model, hlmdl_submodel_t *amodel,
free(uvert);
free(index);
#if defined(RTLIGHTS)
//treat this as the base pose, and calculate the sdir+tdir for bumpmaps.
R_Generate_Mesh_ST_Vectors(mesh);
#endif
}
#endif
@ -875,9 +879,10 @@ qboolean HLMDL_Trace (model_t *model, int hulloverride, framestate_t *framestat
{
startout = false;
endout = false;
enterplane= 0;
enterplane = 0;
enterfrac = -1;
exitfrac = 10;
enterdist = 0;
//fixme: would be nice to check if there's a possible collision a bit faster, without needing to do lots of excess maths.

View file

@ -1,7 +1,7 @@
#include "progsint.h"
#include "qcc.h"
#if !defined(NO_ZLIB) && !defined(FTE_TARGET_WEB)
#if !defined(NO_ZLIB) && !defined(FTE_TARGET_WEB) && !defined(NACL)
#define AVAIL_ZLIB
#endif
@ -104,7 +104,6 @@ int SafeSeek(int hand, int ofs, int mode);
//we are allowed to trash our input here.
int QC_encode(progfuncs_t *progfuncs, int len, int method, const char *in, int handle)
{
int i;
if (method == 0) //copy, allows a lame pass-through.
{
SafeWrite(handle, in, len);
@ -121,6 +120,7 @@ int QC_encode(progfuncs_t *progfuncs, int len, int method, const char *in, int h
{
#ifdef AVAIL_ZLIB
char out[8192];
int i=0;
z_stream strm = {
(char *)in,
@ -142,7 +142,6 @@ int QC_encode(progfuncs_t *progfuncs, int len, int method, const char *in, int h
0,
0
};
i=0;
if (method == 8)
deflateInit2(&strm, 9, Z_DEFLATED, -MAX_WBITS, 9, Z_DEFAULT_STRATEGY); //zip deflate compression