From f3a779639cdbb250fd0752a2289ffb0dd3cd6efc Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 1 Oct 2019 22:19:09 +0000 Subject: [PATCH] Fix build issue with bullet plugin. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5555 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 4 ++-- engine/client/image.c | 2 +- engine/common/pr_bgcmd.c | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index e23c0d53e..ab1952708 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -2003,7 +2003,7 @@ endif plugins-dbg: @-mkdir -p $(DEBUG_DIR) @if test -e ../plugins/Makefile; \ - then $(MAKE) native -C ../plugins OUT_DIR="$(DEBUG_DIR)" CC="$(CC) $(W32_CFLAGS) $(DEBUG_CFLAGS)" ARCH="$(ARCH)" BASE_CFLAGS="$(BASE_CFLAGS)" FTE_TARGET="$(FTE_TARGET)"; \ + then $(MAKE) native -C ../plugins OUT_DIR="$(DEBUG_DIR)" CC="$(CC) $(W32_CFLAGS) $(DEBUG_CFLAGS)" CCX="$(CC) $(W32_CFLAGS) $(subst -Wno-pointer-sign,,$(DEBUG_CFLAGS))" ARCH="$(ARCH)" BASE_CFLAGS="$(BASE_CFLAGS)" BASE_CXXFLAGS="$(subst -Wno-pointer-sign,,$(BASE_CFLAGS))" FTE_TARGET="$(FTE_TARGET)"; \ else echo no plugins directory installed; \ fi plugins: @@ -2011,7 +2011,7 @@ plugins: plugins-rel: @-mkdir -p $(RELEASE_DIR) @if test -e ../plugins/Makefile; \ - then $(MAKE) native -C ../plugins OUT_DIR="$(RELEASE_DIR)" CC="$(CC) $(W32_CFLAGS) $(RELEASE_CFLAGS)" ARCH="$(ARCH)" BASE_CFLAGS="$(BASE_CFLAGS)" FTE_TARGET="$(FTE_TARGET)"; \ + then $(MAKE) native -C ../plugins OUT_DIR="$(RELEASE_DIR)" CC="$(CC) $(W32_CFLAGS) $(RELEASE_CFLAGS)" CCX="$(CXX) $(W32_CFLAGS) $(subst -Wno-pointer-sign,,$(RELEASE_CFLAGS))" ARCH="$(ARCH)" BASE_CFLAGS="$(BASE_CFLAGS)" BASE_CXXFLAGS="$(subst -Wno-pointer-sign,,$(BASE_CFLAGS))" FTE_TARGET="$(FTE_TARGET)"; \ else echo no plugins directory installed; \ fi plugins-rel: diff --git a/engine/client/image.c b/engine/client/image.c index b757fa64f..66695dbfd 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -2287,7 +2287,7 @@ METHODDEF(void) jpeg_error_exit (j_common_ptr cinfo) { longjmp(((jpeg_error_mgr_wrapper *) cinfo->err)->setjmp_buffer, 1); } -static qboolean screenshotJPEG(char *filename, enum fs_relative fsroot, int compression, qbyte *screendata, qintptr_t stride, int screenwidth, int screenheight, enum uploadfmt fmt, unsigned int writemeta) +qboolean screenshotJPEG(char *filename, enum fs_relative fsroot, int compression, qbyte *screendata, qintptr_t stride, int screenwidth, int screenheight, enum uploadfmt fmt, unsigned int writemeta) { qbyte *buffer; vfsfile_t *outfile; diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index d477a9c31..41bd07381 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -1665,16 +1665,17 @@ typedef struct char *stringdata; }; } pf_hashentry_t; +#define FIRSTTABLE 1 static pf_hashtab_t *pf_hashtab; static size_t pf_hash_maxtables; static pf_hashtab_t pf_peristanthashtab; //persists over map changes. //static pf_hashtab_t pf_reverthashtab; //pf_peristanthashtab as it was at map start, for map restarts. static pf_hashtab_t *PF_hash_findtab(pubprogfuncs_t *prinst, int idx) { - idx -= 1; + idx -= FIRSTTABLE; if (idx >= 0 && (unsigned)idx < pf_hash_maxtables && pf_hashtab[idx].prinst) return &pf_hashtab[idx]; - else if (idx == -1) + else if (idx == 0-FIRSTTABLE) { if (!pf_peristanthashtab.tab.numbuckets) { @@ -1898,7 +1899,7 @@ void QCBUILTIN PF_hash_createtab (pubprogfuncs_t *prinst, struct globalvars_s *p pf_hashtab[i].prinst = prinst; pf_hashtab[i].bucketmem = Z_Malloc(Hash_BytesForBuckets(numbuckets)); Hash_InitTable(&pf_hashtab[i].tab, numbuckets, pf_hashtab[i].bucketmem); - G_FLOAT(OFS_RETURN) = i + 1; + G_FLOAT(OFS_RETURN) = i + FIRSTTABLE; } void pf_hash_savegame(void) //write the persistant table to a saved game.