X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_demo.c;h=af7015902170e583dca0688cc877d18f345d35fc;hb=62cc07a26c75ffc706e6ea2f46bf5dde21e87d4b;hp=1024cf3a9e1266f4027cc8e6eb1255d5af4171e6;hpb=4912a987528b78fa5cd322952acddd45ceba54d8;p=xonotic%2Fdarkplaces.git diff --git a/cl_demo.c b/cl_demo.c index 1024cf3a..af701590 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" +int old_vsync = 0; + void CL_FinishTimeDemo (void); /* @@ -110,7 +112,6 @@ void CL_WriteDemoMessage (void) FS_Write (cls.demofile, &f, 4); } FS_Write (cls.demofile, net_message.data, net_message.cursize); - FS_Flush (cls.demofile); } /* @@ -188,6 +189,10 @@ void CL_ReadDemoMessage(void) { MSG_BeginReading(); CL_ParseServerMessage(); + + // In case the demo contains a "svc_disconnect" message + if (!cls.demoplayback) + return; } else { @@ -319,6 +324,7 @@ void CL_PlayDemo_f (void) // disconnect from server CL_Disconnect (); + Host_ShutdownServer (false); // update networking ports (this is mainly just needed at startup) NetConn_ClientFrame(); @@ -336,8 +342,6 @@ void CL_PlayDemo_f (void) return; } - SCR_BeginLoadingPlaque (); - strlcpy(cls.demoname, name, sizeof(cls.demoname)); cls.demoplayback = true; cls.state = ca_connected; @@ -375,7 +379,7 @@ void CL_FinishTimeDemo (void) fpsmax = cls.td_minframetime > 0 ? 1.0 / cls.td_minframetime : 0; // LordHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max Con_Printf("%i frames %5.7f seconds %5.7f fps\nmin/avg/max: %5.7f/%5.7f/%5.7f\n", frames, time, fpsavg, fpsmin, fpsavg, fpsmax); - Con_LogPrintf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | result %i frames %5.7f seconds %5.7f fps min/avg/max: %5.7f/%5.7f/%5.7f\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, frames, time, fpsavg, fpsmin, fpsavg, fpsmax); + Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | result %i frames %5.7f seconds %5.7f fps min/avg/max: %5.7f/%5.7f/%5.7f\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, frames, time, fpsavg, fpsmin, fpsavg, fpsmax); if (COM_CheckParm("-benchmark")) Host_Quit_f(); } @@ -406,11 +410,10 @@ void CL_TimeDemo_f (void) // instantly hide console and deactivate it key_dest = key_game; key_consoleactive = 0; - scr_conlines = 0; scr_con_current = 0; cls.timedemo = true; // get first message this frame - cls.td_lastframe = -1; + cls.td_lastframe = -1; }