]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_demo.c
Fix Q2BSP texture loading, Q2BSP contents issues, and add support for SURF_ALPHATEST...
[xonotic/darkplaces.git] / cl_demo.c
index 5ca4780ee4cdc8ac950572290db37f7b58c07e54..5741e813daac6470162cc32bba92c72874902807 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -20,7 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
+#ifdef CONFIG_VIDEO_CAPTURE
 extern cvar_t cl_capturevideo;
+extern cvar_t cl_capturevideo_demo_stop;
+#endif
 int old_vsync = 0;
 
 static void CL_FinishTimeDemo (void);
@@ -78,6 +81,11 @@ Called when a demo file runs out, or the user starts a game
 // LordHavoc: now called only by CL_Disconnect
 void CL_StopPlayback (void)
 {
+#ifdef CONFIG_VIDEO_CAPTURE
+       if (cl_capturevideo_demo_stop.integer)
+               Cvar_Set("cl_capturevideo", "0");
+#endif
+
        if (!cls.demoplayback)
                return;
 
@@ -510,7 +518,7 @@ static void CL_FinishTimeDemo (void)
                {
                        static benchmarkhistory_t *history = NULL;
                        if(!history)
-                               history = Z_Malloc(sizeof(*history) * atoi(com_argv[i + 1]));
+                               history = (benchmarkhistory_t *)Z_Malloc(sizeof(*history) * atoi(com_argv[i + 1]));
 
                        history[benchmark_runs - 1].frames = frames;
                        history[benchmark_runs - 1].time = time;
@@ -609,6 +617,5 @@ void CL_TimeDemo_f (void)
        cls.timedemo = true;
        cls.td_frames = -2;             // skip the first frame
        cls.demonum = -1;               // stop demo loop
-       cls.demonum = -1;               // stop demo loop
 }