]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_demo.c
added -benchmark commandline option
[xonotic/darkplaces.git] / cl_demo.c
index c6402413e5239946dc832227a7cfc798694d4c8e..1024cf3a9e1266f4027cc8e6eb1255d5af4171e6 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -338,6 +338,7 @@ void CL_PlayDemo_f (void)
 
        SCR_BeginLoadingPlaque ();
 
+       strlcpy(cls.demoname, name, sizeof(cls.demoname));
        cls.demoplayback = true;
        cls.state = ca_connected;
        cls.forcetrack = 0;
@@ -374,6 +375,9 @@ 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);
+       if (COM_CheckParm("-benchmark"))
+               Host_Quit_f();
 }
 
 /*