From bfa5cef4d38f174e1aa666e5251403b39f6e3db2 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 12 Feb 2020 12:15:56 +0000 Subject: [PATCH] Fix misc obscure builds. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5620 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/net_master.c | 2 ++ engine/client/render.h | 2 ++ engine/common/log.c | 2 +- engine/gl/gl_backend.c | 2 ++ engine/gl/gl_shader.c | 4 ++++ engine/gl/ltface.c | 9 ++++----- plugins/models/exportiqm.c | 4 ++++ plugins/models/gltf.c | 5 +++-- plugins/models/models.c | 2 +- 9 files changed, 23 insertions(+), 9 deletions(-) diff --git a/engine/client/net_master.c b/engine/client/net_master.c index 0db00770b..c3c61dd1a 100644 --- a/engine/client/net_master.c +++ b/engine/client/net_master.c @@ -3597,6 +3597,7 @@ static void NetQ3_LocalServers_f(void) } static void NetQ3_GlobalServers_Request(size_t masternum, int protocol, const char *keywords) { +#ifdef WEBCLIENT if (masternum == countof(net_masterlist)) { const char *url; @@ -3613,6 +3614,7 @@ static void NetQ3_GlobalServers_Request(size_t masternum, int protocol, const ch if (dl) dl->isquery = true; } +#endif if (masternum >= countof(net_masterlist)) return; //erk if (net_masterlist[masternum].protocol == MP_QUAKE3) diff --git a/engine/client/render.h b/engine/client/render.h index 1effd33ab..56c71dcb3 100644 --- a/engine/client/render.h +++ b/engine/client/render.h @@ -655,7 +655,9 @@ extern cvar_t r_novis; extern cvar_t r_netgraph; extern cvar_t r_deluxemapping_cvar; extern qboolean r_deluxemapping; +#ifdef RTLIGHTS extern qboolean r_fakeshadows; //enables the use of ortho model-only shadows +#endif extern float r_blobshadows; extern cvar_t r_softwarebanding_cvar; extern qboolean r_softwarebanding; diff --git a/engine/common/log.c b/engine/common/log.c index efd384352..36c5e344d 100644 --- a/engine/common/log.c +++ b/engine/common/log.c @@ -984,7 +984,7 @@ void Log_Init(void) Cvar_Register (&log_enable[i], CONLOGGROUP); Cvar_Register (&log_name[i], CONLOGGROUP); log_newline[i] = true; -#ifdef HAVE_LEGACY +#ifdef IPLOG Cmd_AddCommand(legacylog[i].commandname, IPLog_Merge_f); #endif } diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index 13ff09b5a..fa146d847 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -6347,8 +6347,10 @@ void GLBE_DrawWorld (batch_t **worldbatches) else #endif { +#ifdef RTLIGHTS if (r_fakeshadows) Sh_GenerateFakeShadows(); +#endif GLBE_SelectEntity(&r_worldentity); if (shaderstate.identitylighting == 0) diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 8220b965c..6f30b5593 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -1298,12 +1298,14 @@ struct programpermu_s *Shader_LoadPermutation(program_t *prog, unsigned int p) Q_strlcatfz(defines, &offset, sizeof(defines), "#define MAX_GPU_BONES %i\n", sh_config.max_gpu_bones); if (gl_specular.value) Q_strlcatfz(defines, &offset, sizeof(defines), "#define SPECULAR\n#define SPECULAR_BASE_MUL %f\n#define SPECULAR_BASE_POW %f\n", 1.0*gl_specular.value, max(1,gl_specular_power.value)); +#ifdef RTLIGHTS if (r_fakeshadows) Q_strlcatfz(defines, &offset, sizeof(defines), "#define FAKESHADOWS\n%s", #ifdef GLQUAKE gl_config.arb_shadow?"#define USE_ARB_SHADOW\n": #endif ""); +#endif for (n = 0; n < countof(permutations); n++) { @@ -1378,8 +1380,10 @@ qboolean Com_PermuOrFloatArgument(const char *shadername, char *arg, size_t argl //load-time-only permutations... if (arglen == 8 && !strncmp("SPECULAR", arg, arglen) && gl_specular.value) return true; +#ifdef RTLIGHTS if (arglen == 11 && !strncmp("FAKESHADOWS", arg, arglen) && r_fakeshadows) return true; +#endif if ((arglen==5||arglen==6) && !strncmp("DELUXE", arg, arglen) && r_deluxemapping && Shader_PermutationEnabled(PERMUTATION_BUMPMAP)) return true; if (arglen == 13 && !strncmp("OFFSETMAPPING", arg, arglen) && r_glsl_offsetmapping.ival) diff --git a/engine/gl/ltface.c b/engine/gl/ltface.c index fabea62f8..34c902722 100644 --- a/engine/gl/ltface.c +++ b/engine/gl/ltface.c @@ -1,5 +1,4 @@ #include "quakedef.h" - #ifdef RUNTIMELIGHTING typedef struct mentity_s { @@ -1002,6 +1001,7 @@ static void LightFace (struct relight_ctx_s *ctx, struct llightinfo_s *threadctx +static struct relight_ctx_s *lightcontext; #if defined(MULTITHREAD) #ifdef _WIN32 #include @@ -1011,7 +1011,6 @@ static void LightFace (struct relight_ctx_s *ctx, struct llightinfo_s *threadctx static void *relightthread[8]; static unsigned int relightthreads; static volatile qboolean wantrelight; -static struct relight_ctx_s *lightcontext; static int RelightThread(void *ctx) { @@ -1225,10 +1224,10 @@ void RelightThink (void) #else if (!lightmainthreadctx) lightmainthreadctx = malloc(lightthreadctxsize); - LightFace(lightcontext, lightmainthreadctx, relitsurface); - lightmodel->surfaces[relitsurface].cached_dlight = -1; + LightFace(lightcontext, lightmainthreadctx, lightcontext->nextface); + lightmodel->surfaces[lightcontext->nextface].cached_dlight = -1; - relitsurface++; + lightcontext->nextface++; #endif if (lightcontext->nextface >= lightmodel->numsurfaces) { diff --git a/plugins/models/exportiqm.c b/plugins/models/exportiqm.c index 447e77b8b..6c68ad3fd 100644 --- a/plugins/models/exportiqm.c +++ b/plugins/models/exportiqm.c @@ -4,6 +4,9 @@ #include "quakedef.h" #include "../plugin.h" #include "com_mesh.h" + +#ifdef SKELETALMODELS + extern plugmodfuncs_t *modfuncs; extern plugfsfuncs_t *filefuncs; @@ -662,3 +665,4 @@ void Mod_ExportIQM(char *fname, int flags, galiasinfo_t *mesh) free(poseinfo); #undef hdr } +#endif diff --git a/plugins/models/gltf.c b/plugins/models/gltf.c index 52f57374a..31bdb394b 100644 --- a/plugins/models/gltf.c +++ b/plugins/models/gltf.c @@ -4,8 +4,6 @@ #include "quakedef.h" #include "../plugin.h" #include "com_mesh.h" -static plugmodfuncs_t *modfuncs; -static plugfsfuncs_t *filefuncs; #ifdef SKELETALMODELS #define GLTFMODELS @@ -40,6 +38,9 @@ static plugfsfuncs_t *filefuncs; #define GLTFSCALE 30 #ifdef GLTFMODELS +static plugmodfuncs_t *modfuncs; +static plugfsfuncs_t *filefuncs; + typedef struct json_s { const char *bodystart; diff --git a/plugins/models/models.c b/plugins/models/models.c index 7aa541759..3ebf2144c 100644 --- a/plugins/models/models.c +++ b/plugins/models/models.c @@ -822,7 +822,7 @@ qboolean Mod_ExecuteCommand(qboolean isinsecure) { char tok[128]; cmdfuncs->Argv(0, tok, sizeof(tok)); -#ifndef SERVERONLY +#if !defined(SERVERONLY) && defined(SKELETALMODELS) if (!strcmp(tok, "exportiqm")) { model_t *mod;