cvar_t freelook = {CVAR_SAVE, "freelook", "1","mouse controls pitch instead of forward/back"};
+cvar_t cl_autodemo = {0, "cl_autodemo", "0", "records every game played, using the date/time and map name to name the demo file" };
+cvar_t cl_autodemo_nameformat = {0, "cl_autodemo_nameformat", "%Y-%m-%d_%H-%M", "The format of the cl_autodemo filename, followed by the map name" };
+
cvar_t r_draweffects = {0, "r_draweffects", "1","renders temporary sprite effects"};
cvar_t cl_explosions_alpha_start = {CVAR_SAVE, "cl_explosions_alpha_start", "1.5","starting alpha of an explosion shell"};
Cmd_AddCommand ("playdemo", CL_PlayDemo_f, "watch a demo file");
Cmd_AddCommand ("timedemo", CL_TimeDemo_f, "play back a demo as fast as possible and save statistics to benchmark.log");
+ Cvar_RegisterVariable (&cl_autodemo);
+ Cvar_RegisterVariable (&cl_autodemo_nameformat);
+
Cmd_AddCommand ("fog", CL_Fog_f, "set global fog parameters (density red green blue)");
// LordHavoc: added pausedemo
extern cvar_t m_forward;
extern cvar_t m_side;
+extern cvar_t cl_autodemo;
+extern cvar_t cl_autodemo_nameformat;
+
extern cvar_t r_draweffects;
extern cvar_t cl_explosions_alpha_start;
SV_SpawnServer(level);
if (sv.active && cls.state == ca_disconnected)
CL_EstablishConnection("local:1");
+
+// if cl_autodemo is set, automatically start recording a demo if one isn't being recorded already
+ if (cl_autodemo.integer && !cls.demorecording)
+ {
+ char demofile[MAX_OSPATH];
+
+ dpsnprintf (demofile, sizeof(demofile), "%s_%s.dem", Sys_TimeString (cl_autodemo_nameformat.string), level);
+
+ Con_Printf ("Recording to %s.\n", demofile);
+
+ cls.demofile = FS_Open (demofile, "wb", false, false);
+ if (cls.demofile)
+ {
+ cls.forcetrack = -1;
+ FS_Printf (cls.demofile, "%i\n", cls.forcetrack);
+ }
+ else
+ Con_Print ("ERROR: couldn't open.\n");
+
+ cls.demorecording = true;
+ }
}
/*