From f0feb82b90ad74363876d2f64d3a4459608e55dd Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 13 Jan 2006 06:27:18 +0000 Subject: [PATCH] rjlan wanted mingl to compile again, and moodles reported a demorecording bug. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1862 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_demo.c | 13 ++++++++----- engine/client/cl_main.c | 17 +++++++++++++++++ engine/client/cl_parse.c | 19 ++++++++++++++++++- engine/client/fragstats.c | 3 +++ engine/client/in_win.c | 2 ++ engine/client/zqtp.c | 2 ++ engine/common/fs.c | 1 + engine/gl/gl_alias.c | 5 ++++- 8 files changed, 55 insertions(+), 7 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 80b634281..4d5e9713c 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -194,6 +194,9 @@ void CL_DemoJump_f(void) char *s = Cmd_Argv(1); char *colon = strchr(s, ':'); + if (!cls.demoplayback) + return; + if (*s == '+') { if (colon) @@ -753,16 +756,16 @@ void CL_Record_f (void) || c=='<' || c=='>' || c=='"' || c=='.') *p = '_'; } - strncpy(name, va("%s/%s", com_gamedir, fname), sizeof(name)-1-8); + strncpy(name, fname, sizeof(name)-1-8); name[sizeof(name)-1-8] = '\0'; //make a unique name (unless the user specified it). strcat (name, ".qwd"); //we have the space if (c != 2) { - FILE *f; + vfsfile_t *f; - f = fopen (name, "rb"); + f = FS_OpenVFS (name, "rb", FS_GAME); if (f) { COM_StripExtension(name, name); @@ -772,10 +775,10 @@ void CL_Record_f (void) i = 0; do { - fclose (f); + VFS_CLOSE (f); p[0] = i%100 + '0'; p[1] = i%10 + '0'; - f = fopen (name, "rb"); + f = FS_OpenVFS (name, "rb", FS_GAME); i++; } while (f && i < 100); } diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index df6a47791..0c54ffa08 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -929,6 +929,22 @@ void CL_ClearState (void) if (cl.lerpents) BZ_Free(cl.lerpents); + { + downloadlist_t *next; + while(cl.downloadlist) + { + next = cl.downloadlist->next; + Z_Free(cl.downloadlist); + cl.downloadlist = next; + } + while(cl.faileddownloads) + { + next = cl.faileddownloads->next; + Z_Free(cl.faileddownloads); + cl.faileddownloads = next; + } + } + // wipe the entire cl structure memset (&cl, 0, sizeof(cl)); @@ -1064,6 +1080,7 @@ void CL_Disconnect (void) } if (!cls.downloadmethod) *cls.downloadname = '\0'; + { downloadlist_t *next; while(cl.downloadlist) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index fc56669ed..208065f2c 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -585,6 +585,7 @@ int CL_LoadModels(int stage) #define atstage() ((cl.contentstage == stage++)?++cl.contentstage:false) #define endstage() if (giveuptimetype = type; ms->wid = wid; + + ms->next = fragstats.message; + fragstats.message = ms; } static void Stats_Clear(void) diff --git a/engine/client/in_win.c b/engine/client/in_win.c index be26984dc..1bad1e717 100644 --- a/engine/client/in_win.c +++ b/engine/client/in_win.c @@ -1411,11 +1411,13 @@ static void ProcessMouse(mouse_t *mouse, usercmd_t *cmd, int pnum) #endif } +#ifdef PEXT_CSQC if (CSQC_MouseMove(mx, my)) { mx = 0; my = 0; } +#endif if (m_filter.value) { diff --git a/engine/client/zqtp.c b/engine/client/zqtp.c index b74091b82..0fbb01a3d 100644 --- a/engine/client/zqtp.c +++ b/engine/client/zqtp.c @@ -3286,9 +3286,11 @@ void CL_Say (qboolean team, char *extra) void CL_Say_f (void) { +#ifndef CLIENTONLY if (isDedicated) SV_ConSay_f(); else +#endif CL_Say (false, NULL); } diff --git a/engine/common/fs.c b/engine/common/fs.c index 72674daf1..78c4e9f66 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -204,6 +204,7 @@ void VFSOS_Close(vfsfile_t *file) { vfsosfile_t *intfile = (vfsosfile_t*)file; fclose(intfile->handle); + Z_Free(file); } vfsfile_t *VFSOS_Open(char *osname, char *mode) { diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index fec0184e9..8c8e1bc4a 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -1942,7 +1942,7 @@ void R_DrawGAliasModel (entity_t *e) GL_DrawAliasMesh(&mesh, skin->fullbright); qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - +#ifdef Q3BSPS if (fog) { meshbuffer_t mb; @@ -1964,6 +1964,7 @@ void R_DrawGAliasModel (entity_t *e) R_ClearArrays(); } +#endif } } @@ -2824,7 +2825,9 @@ void GL_LoadSkinFile(galiastexnum_t *texnum, char *surfacename, int skinnumber, GL_ParseQ3SkinFile(shadername, surfacename, loadmodel->name, skinnumber, NULL); +#ifdef Q3SHADERS texnum->shader = R_RegisterSkin(shadername); +#endif texnum->base = Mod_LoadHiResTexture(shadername, "models", true, true, true); }