]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_demo.c
fix the picture drawing fix
[xonotic/darkplaces.git] / cl_demo.c
index ce5f95d793bfb10669a4c36c97e0918258f8e6f3..2485afb908de566dd40700ba0af69b276bff5918 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
+extern cvar_t cl_capturevideo;
 int old_vsync = 0;
 
 void CL_FinishTimeDemo (void);
@@ -87,7 +88,7 @@ void CL_StopPlayback (void)
        if (cls.timedemo)
                CL_FinishTimeDemo ();
 
-       if (COM_CheckParm("-demo"))
+       if (COM_CheckParm("-demo") || COM_CheckParm("-capturedemo"))
                Host_Quit_f();
 
 }
@@ -152,12 +153,14 @@ void CL_ReadDemoMessage(void)
                                }
                                if (cls.td_lastframe == -1)
                                {
-                                       // we start counting on the second frame
-                                       // (after parsing connection stuff)
-                                       cls.td_startframe = host_framecount + 1;
+                                       // render a couple frames before we start counting
+                                       cls.td_startframe = host_framecount + 3;
                                }
                                cls.td_lastframe = host_framecount;
                                cls.td_onesecondframes++;
+                               // don't read any new messages during the warm-up period
+                               if (host_framecount < cls.td_startframe)
+                                       return;
                                // if this is the first official frame we can now grab the real
                                // td_starttime so the bogus time on the first frame doesn't
                                // count against the final report