Only start timedemo counters once the map has actually finished loading, and force the console up.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3273 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-07-14 15:10:07 +00:00
parent 8c66660fe0
commit cd619e991f

View file

@ -522,10 +522,14 @@ readnext:
cls.td_lastframe = demotime;
return 0; // already read this frame's message
}
if (!cls.td_starttime && cls.state == ca_active)
if (cls.td_startframe == -1 && cls.state == ca_active)
{ //start the timer only once we are connected.
cls.td_starttime = Sys_DoubleTime();
cls.td_startframe = host_framecount;
//force the console up, we're done loading.
key_dest = key_game;
scr_con_current = 0;
}
demtime = demotime; // warp
}
@ -2077,14 +2081,20 @@ void CL_FinishTimeDemo (void)
cls.timedemo = false;
// the first frame didn't count
frames = (host_framecount - cls.td_startframe) - 1;
// loading frames don't count
if (cls.td_startframe == -1)
{
Con_Printf ("demo didn't finish loading\n");
frames = 0;
}
else
frames = (host_framecount - cls.td_startframe) - 1;
time = Sys_DoubleTime() - cls.td_starttime;
if (!time)
time = 1;
Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);
Con_Printf("NOTE: times currently depend on load times\n");
cls.td_startframe = 0;
}
/*
@ -2114,7 +2124,7 @@ void CL_TimeDemo_f (void)
cls.timedemo = true;
cls.td_starttime = Sys_DoubleTime();
cls.td_startframe = host_framecount;
cls.td_startframe = -1;
cls.td_lastframe = -1; // get a new message this frame
}