]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
patch from roboman2444 :
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 10 Jan 2013 02:58:16 +0000 (02:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 10 Jan 2013 02:58:16 +0000 (02:58 +0000)
new cvar cl_capturevideo_demo_stop which makes video capture automatically
end when demo playback ends

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11876 d7cf8633-e32d-0410-b094-e92efae38249

cl_demo.c
cl_screen.c

index 1584cb7bf19e59f462b4390be656e0637a5c7a97..f30eff8b287105afa6580c4f7bf5abd1b8c13f1f 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 
 extern cvar_t cl_capturevideo;
+extern cvar_t cl_capturevideo_demo_stop;
 int old_vsync = 0;
 
 static void CL_FinishTimeDemo (void);
@@ -78,6 +79,9 @@ Called when a demo file runs out, or the user starts a game
 // LordHavoc: now called only by CL_Disconnect
 void CL_StopPlayback (void)
 {
+       if (cl_capturevideo_demo_stop.integer)
+               Cvar_Set("cl_capturevideo", "0");
+
        if (!cls.demoplayback)
                return;
 
index dfc556187ece9948d970244709d5f7f938e2275f..1f5f7dbc5cdb0400621f6f38b2fa3d03289478a5 100644 (file)
@@ -57,6 +57,7 @@ cvar_t scr_screenshot_alpha = {CVAR_SAVE, "scr_screenshot_alpha","0", "try to wr
 cvar_t scr_screenshot_timestamp = {CVAR_SAVE, "scr_screenshot_timestamp", "1", "use a timestamp based number of the type YYYYMMDDHHMMSSsss instead of sequential numbering"};
 // scr_screenshot_name is defined in fs.c
 cvar_t cl_capturevideo = {0, "cl_capturevideo", "0", "enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)"};
+cvar_t cl_capturevideo_demo_stop = {CVAR_SAVE, "cl_capturevideo_demo_stop", "1", "automatically stops video recording when demo ends"};
 cvar_t cl_capturevideo_printfps = {CVAR_SAVE, "cl_capturevideo_printfps", "1", "prints the frames per second captured in capturevideo (is only written to the log file, not to the console, as that would be visible on the video)"};
 cvar_t cl_capturevideo_width = {CVAR_SAVE, "cl_capturevideo_width", "0", "scales all frames to this resolution before saving the video"};
 cvar_t cl_capturevideo_height = {CVAR_SAVE, "cl_capturevideo_height", "0", "scales all frames to this resolution before saving the video"};
@@ -940,6 +941,7 @@ void CL_Screen_Init(void)
        Cvar_RegisterVariable (&scr_screenshot_alpha);
        Cvar_RegisterVariable (&scr_screenshot_timestamp);
        Cvar_RegisterVariable (&cl_capturevideo);
+       Cvar_RegisterVariable (&cl_capturevideo_demo_stop);
        Cvar_RegisterVariable (&cl_capturevideo_printfps);
        Cvar_RegisterVariable (&cl_capturevideo_width);
        Cvar_RegisterVariable (&cl_capturevideo_height);