summaryrefslogtreecommitdiff
path: root/src/client/cl_cgame.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-09-05 22:05:32 +0000
committerTim Angus <tim@ngus.net>2007-09-05 22:05:32 +0000
commitc99975c73ae2941751d86d3b8466454c5ad122c0 (patch)
treeb5bb65655fbdbc22201426046092939bcf696abe /src/client/cl_cgame.c
parent27ad2c0e19891f7f2454c9eedf76878dc1942ba6 (diff)
* Merge of ioq3-r1163
+ SDL everywhere + New R_LoadImage + net_ip.c + Window icon + GUI based dedicated server support + Compile time linked OpenGL * Remove ui_menuFiles cvar
Diffstat (limited to 'src/client/cl_cgame.c')
-rw-r--r--src/client/cl_cgame.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index 68b34c6b..40714a56 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -725,7 +725,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
return re.inPVS( VMA(1), VMA(2) );
default:
- assert(0); // bk010102
+ assert(0);
Com_Error( ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0] );
}
return 0;
@@ -946,8 +946,6 @@ void CL_FirstSnapshot( void ) {
Cbuf_AddText( cl_activeAction->string );
Cvar_Set( "activeAction", "" );
}
-
- Sys_BeginProfiling();
}
/*
@@ -1050,9 +1048,35 @@ void CL_SetCGameTime( void ) {
// while a normal demo may have different time samples
// each time it is played back
if ( cl_timedemo->integer ) {
+ int now = Sys_Milliseconds( );
+ int frameDuration;
+
if (!clc.timeDemoStart) {
- clc.timeDemoStart = Sys_Milliseconds();
+ clc.timeDemoStart = clc.timeDemoLastFrame = now;
+ clc.timeDemoMinDuration = INT_MAX;
+ clc.timeDemoMaxDuration = 0;
+ }
+
+ frameDuration = now - clc.timeDemoLastFrame;
+ clc.timeDemoLastFrame = now;
+
+ // Ignore the first measurement as it'll always be 0
+ if( clc.timeDemoFrames > 0 )
+ {
+ if( frameDuration > clc.timeDemoMaxDuration )
+ clc.timeDemoMaxDuration = frameDuration;
+
+ if( frameDuration < clc.timeDemoMinDuration )
+ clc.timeDemoMinDuration = frameDuration;
+
+ // 255 ms = about 4fps
+ if( frameDuration > UCHAR_MAX )
+ frameDuration = UCHAR_MAX;
+
+ clc.timeDemoDurations[ ( clc.timeDemoFrames - 1 ) %
+ MAX_TIMEDEMO_DURATIONS ] = frameDuration;
}
+
clc.timeDemoFrames++;
cl.serverTime = clc.timeDemoBaseTime + clc.timeDemoFrames * 50;
}