]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_demo.c
cvar: use unsigned for flags and hashindex
[xonotic/darkplaces.git] / cl_demo.c
index beab8f84ed84354dc28d5f813e3a77ae4b13895b..502a7fac4581fe0aa5ed7d9b51ecd3d1b5810651 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 extern cvar_t cl_capturevideo;
 extern cvar_t cl_capturevideo_demo_stop;
 #endif
-int old_vsync = 0;
 
 static void CL_FinishTimeDemo (void);
 
@@ -510,7 +509,7 @@ static void CL_FinishTimeDemo (void)
        fpsmax = cls.td_onesecondmaxfps;
        // LadyHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max
        Con_Printf("%i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
-       Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, benchmark_runs + 1, frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
+       Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), engineversion, cls.demoname, cmdline.string, benchmark_runs + 1, frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
        if (Sys_CheckParm("-benchmark"))
        {
                ++benchmark_runs;
@@ -586,6 +585,9 @@ static void CL_FinishTimeDemo (void)
                else
                        host.state = host_shutdown;
        }
+
+       // Might need to re-enable vsync
+       Cvar_Callback(&vid_vsync);
 }
 
 /*
@@ -618,6 +620,9 @@ void CL_TimeDemo_f(cmd_state_t *cmd)
        cls.timedemo = host.restless = true;
        cls.td_frames = -2;             // skip the first frame
        cls.demonum = -1;               // stop demo loop
+
+       // Might need to disable vsync
+       Cvar_Callback(&vid_vsync);
 }
 
 /*