From 2c07bbac7d20de4ba9e8a747f6ef3b6ca1986ee1 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 20 Nov 2019 04:53:22 +0000 Subject: [PATCH] Fix some problems in my last commit. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5582 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_main.c | 4 ++-- engine/client/sys_sdl.c | 2 +- engine/common/fs.c | 6 +++++- engine/gl/gl_shader.c | 6 +++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index bd7ca591d..6cabf6172 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -364,7 +364,7 @@ void CL_UpdateWindowTitle(void) } } -#ifdef __linux__ +#ifdef __GLIBC__ #include #endif void CL_MakeActive(char *gamename) @@ -413,7 +413,7 @@ void CL_MakeActive(char *gamename) else TP_ExecTrigger("f_spawn", false); -#ifdef __linux__ +#ifdef __GLIBC__ malloc_trim(0); #endif } diff --git a/engine/client/sys_sdl.c b/engine/client/sys_sdl.c index e2ffdc2a8..b39658e03 100644 --- a/engine/client/sys_sdl.c +++ b/engine/client/sys_sdl.c @@ -435,7 +435,7 @@ static int Sys_EnumerateFiles2 (const char *match, int matchstart, int neststart } return go; } -int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(const char *fname, qofs_t fsize, void *parm, searchpathfuncs_t *spath), void *parm, searchpathfuncs_t *spath) +int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(const char *fname, qofs_t fsize, time_t modtime, void *parm, searchpathfuncs_t *spath), void *parm, searchpathfuncs_t *spath) { char fullmatch[MAX_OSPATH]; int start; diff --git a/engine/common/fs.c b/engine/common/fs.c index 5f363d440..b1ba89888 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -266,6 +266,8 @@ static ftemanifest_t *FS_Manifest_Clone(ftemanifest_t *oldm) newm->rtcbroker = Z_StrDup(oldm->rtcbroker); if (oldm->basedir) newm->basedir = Z_StrDup(oldm->basedir); + if (oldm->mainconfig) + newm->mainconfig = Z_StrDup(oldm->mainconfig); newm->homedirtype = oldm->homedirtype; for (i = 0; i < sizeof(newm->gamepath) / sizeof(newm->gamepath[0]); i++) @@ -302,6 +304,8 @@ static void FS_Manifest_Print(ftemanifest_t *man) Con_Printf("game %s\n", COM_QuotedString(man->installation, buffer, sizeof(buffer), false)); if (man->formalname) Con_Printf("name %s\n", COM_QuotedString(man->formalname, buffer, sizeof(buffer), false)); + if (man->mainconfig) + Con_Printf("mainconfig %s\n", COM_QuotedString(man->mainconfig, buffer, sizeof(buffer), false)); if (man->downloadsurl) Con_Printf("downloadsurl %s\n", COM_QuotedString(man->downloadsurl, buffer, sizeof(buffer), false)); if (man->installupd) @@ -6670,7 +6674,7 @@ static qboolean FS_GetBestHomeDir(ftemanifest_t *manifest) return false; } #elif defined(NOSTDIO) -static qboolean FS_GetBestHomeDir(void) +static qboolean FS_GetBestHomeDir(ftemanifest_t *man) { //no studio? webgl port? no file system access = no homedirs! return false; } diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 68dfd282a..7c39ff6af 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -1297,7 +1297,11 @@ struct programpermu_s *Shader_LoadPermutation(program_t *prog, unsigned int p) 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)); if (r_fakeshadows) - Q_strlcatfz(defines, &offset, sizeof(defines), "#define FAKESHADOWS\n%s", gl_config.arb_shadow?"#define USE_ARB_SHADOW\n":""); + Q_strlcatfz(defines, &offset, sizeof(defines), "#define FAKESHADOWS\n%s", +#ifdef GLQUAKE + gl_config.arb_shadow?"#define USE_ARB_SHADOW\n": +#endif + ""); for (n = 0; n < countof(permutations); n++) {