From 11b188b761eb92fb3cdc6ec641adbae473115adc Mon Sep 17 00:00:00 2001 From: TimeServ Date: Tue, 9 May 2006 08:35:10 +0000 Subject: [PATCH] fix bug with cl_maxfps 0 and demo playback causing lockup, fix netquake demo playback git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2259 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_demo.c | 13 +++++++------ engine/client/cl_main.c | 2 +- engine/client/sound.h | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 68a355d0a..9a2e43ce9 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -1258,9 +1258,10 @@ void CL_PlayDemo_f (void) void CL_PlayDemo(char *demoname) { char name[256]; - int ft, c, neg; + int ft, neg; int len; char type; + char chr; int protocol; int start; @@ -1346,16 +1347,16 @@ void CL_PlayDemo(char *demoname) cls.protocol = CP_QUAKEWORLD; ft = 0; //work out if the first line is a int for the track number. - while ((VFS_READ(cls.demofile, &c, 1)==1) && (c != '\n')) + while ((VFS_READ(cls.demofile, &chr, 1)==1) && (chr != '\n')) { - if (c == '-') + if (chr == '-') neg = true; - else if (c < '0' || c > '9') + else if (chr < '0' || chr > '9') break; else - ft = ft * 10 + (c - '0'); + ft = ft * 10 + ((int)chr - '0'); } - if (c == '\n') + if (chr == '\n') { #ifndef NQPROT Con_Printf ("ERROR: cannot play NQ demos.\n"); diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index bfded7b33..ac186b52a 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2993,7 +2993,7 @@ void Host_Frame (double time) */ Mod_Think(); //think even on idle (which means small walls and a fast cpu can get more surfaces done. - if ((cl_maxfps.value>0 && cl_netfps.value>0) || cls.demoplayback) + if (cl_maxfps.value>0 && (cl_netfps.value>0 || cls.demoplayback)) { //limit the fps freely, and expect the netfps to cope. if ((realtime - oldrealtime) < 1/cl_maxfps.value) return; diff --git a/engine/client/sound.h b/engine/client/sound.h index aa7d5dd50..99aea9828 100644 --- a/engine/client/sound.h +++ b/engine/client/sound.h @@ -226,7 +226,6 @@ struct soundcardinfo_s { //windows has one defined AFTER directsound int paintedtime; //used in the mixer int oldsamplepos; //fixme: is this still needed? - int snd_linear_count; //used by the mixer. int buffers; //used to keep track of buffer wraps for consistant sound //callbacks