cls.demonum = -1; // stop demo loop
}
+/*
+===============================================================================
+
+DEMO LOOP CONTROL
+
+===============================================================================
+*/
+
+
+/*
+==================
+CL_Startdemos_f
+==================
+*/
+static void CL_Startdemos_f(cmd_state_t *cmd)
+{
+ int i, c;
+
+ if (cls.state == ca_dedicated || COM_CheckParm("-listen") || COM_CheckParm("-benchmark") || COM_CheckParm("-demo") || COM_CheckParm("-capturedemo"))
+ return;
+
+ c = Cmd_Argc(cmd) - 1;
+ if (c > MAX_DEMOS)
+ {
+ Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS);
+ c = MAX_DEMOS;
+ }
+ Con_DPrintf("%i demo(s) in loop\n", c);
+
+ for (i=1 ; i<c+1 ; i++)
+ strlcpy (cls.demos[i-1], Cmd_Argv(cmd, i), sizeof (cls.demos[i-1]));
+
+ // LadyHavoc: clear the remaining slots
+ for (;i <= MAX_DEMOS;i++)
+ cls.demos[i-1][0] = 0;
+
+ if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
+ {
+ cls.demonum = 0;
+ CL_NextDemo ();
+ }
+ else
+ cls.demonum = -1;
+}
+
+
+/*
+==================
+CL_Demos_f
+
+Return to looping demos
+==================
+*/
+static void CL_Demos_f(cmd_state_t *cmd)
+{
+ if (cls.state == ca_dedicated)
+ return;
+ if (cls.demonum == -1)
+ cls.demonum = 1;
+ CL_Disconnect_f (cmd);
+ CL_NextDemo ();
+}
+
+/*
+==================
+CL_Stopdemo_f
+
+Return to looping demos
+==================
+*/
+static void CL_Stopdemo_f(cmd_state_t *cmd)
+{
+ if (!cls.demoplayback)
+ return;
+ CL_Disconnect ();
+ SV_Shutdown ();
+}
+
+// LadyHavoc: pausedemo command
+static void CL_PauseDemo_f(cmd_state_t *cmd)
+{
+ cls.demopaused = !cls.demopaused;
+ if (cls.demopaused)
+ Con_Print("Demo paused\n");
+ else
+ Con_Print("Demo unpaused\n");
+}
+
+void CL_Demo_Init(void)
+{
+ Cmd_AddCommand(CMD_CLIENT, "record", CL_Record_f, "record a demo");
+ Cmd_AddCommand(CMD_CLIENT, "stop", CL_Stop_f, "stop recording or playing a demo");
+ Cmd_AddCommand(CMD_CLIENT, "playdemo", CL_PlayDemo_f, "watch a demo file");
+ Cmd_AddCommand(CMD_CLIENT, "timedemo", CL_TimeDemo_f, "play back a demo as fast as possible and save statistics to benchmark.log");
+ Cmd_AddCommand(CMD_CLIENT, "startdemos", CL_Startdemos_f, "start playing back the selected demos sequentially (used at end of startup script)");
+ Cmd_AddCommand(CMD_CLIENT, "demos", CL_Demos_f, "restart looping demos defined by the last startdemos command");
+ Cmd_AddCommand(CMD_CLIENT, "stopdemo", CL_Stopdemo_f, "stop playing or recording demo (like stop command) and return to looping demos");
+ // LadyHavoc: added pausedemo
+ Cmd_AddCommand(CMD_CLIENT, "pausedemo", CL_PauseDemo_f, "pause demo playback (can also safely pause demo recording if using QUAKE, QUAKEDP or NEHAHRAMOVIE protocol, useful for making movies)");
+ Cvar_RegisterVariable (&cl_autodemo);
+ Cvar_RegisterVariable (&cl_autodemo_nameformat);
+ Cvar_RegisterVariable (&cl_autodemo_delete);
+}
\ No newline at end of file
r_refdef.scene.time = cl.time;
}
-// LadyHavoc: pausedemo command
-static void CL_PauseDemo_f(cmd_state_t *cmd)
-{
- cls.demopaused = !cls.demopaused;
- if (cls.demopaused)
- Con_Print("Demo paused\n");
- else
- Con_Print("Demo unpaused\n");
-}
-
/*
======================
CL_Fog_f
Cvar_RegisterVariable (&cl_itembobspeed);
Cvar_RegisterVariable (&cl_itembobheight);
+ CL_Demo_Init();
+
Cmd_AddCommand(CMD_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
Cmd_AddCommand(CMD_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
- Cmd_AddCommand(CMD_CLIENT, "record", CL_Record_f, "record a demo");
- Cmd_AddCommand(CMD_CLIENT, "stop", CL_Stop_f, "stop recording or playing a demo");
- Cmd_AddCommand(CMD_CLIENT, "playdemo", CL_PlayDemo_f, "watch a demo file");
- Cmd_AddCommand(CMD_CLIENT, "timedemo", CL_TimeDemo_f, "play back a demo as fast as possible and save statistics to benchmark.log");
// Support Client-side Model Index List
Cmd_AddCommand(CMD_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
// Support Client-side Sound Index List
Cmd_AddCommand(CMD_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
- Cvar_RegisterVariable (&cl_autodemo);
- Cvar_RegisterVariable (&cl_autodemo_nameformat);
- Cvar_RegisterVariable (&cl_autodemo_delete);
-
Cmd_AddCommand(CMD_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
Cmd_AddCommand(CMD_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
- // LadyHavoc: added pausedemo
- Cmd_AddCommand(CMD_CLIENT, "pausedemo", CL_PauseDemo_f, "pause demo playback (can also safely pause demo recording if using QUAKE, QUAKEDP or NEHAHRAMOVIE protocol, useful for making movies)");
-
Cmd_AddCommand(CMD_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
Cvar_RegisterVariable(&r_draweffects);
void CL_PlayDemo_f(cmd_state_t *cmd);
void CL_TimeDemo_f(cmd_state_t *cmd);
+void CL_Demo_Init(void);
+
//
// cl_parse.c
//
//===========================================================================
-/*
-===============================================================================
-
-DEMO LOOP CONTROL
-
-===============================================================================
-*/
-
-
-/*
-==================
-CL_Startdemos_f
-==================
-*/
-static void CL_Startdemos_f(cmd_state_t *cmd)
-{
- int i, c;
-
- if (cls.state == ca_dedicated || COM_CheckParm("-listen") || COM_CheckParm("-benchmark") || COM_CheckParm("-demo") || COM_CheckParm("-capturedemo"))
- return;
-
- c = Cmd_Argc(cmd) - 1;
- if (c > MAX_DEMOS)
- {
- Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS);
- c = MAX_DEMOS;
- }
- Con_DPrintf("%i demo(s) in loop\n", c);
-
- for (i=1 ; i<c+1 ; i++)
- strlcpy (cls.demos[i-1], Cmd_Argv(cmd, i), sizeof (cls.demos[i-1]));
-
- // LadyHavoc: clear the remaining slots
- for (;i <= MAX_DEMOS;i++)
- cls.demos[i-1][0] = 0;
-
- if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
- {
- cls.demonum = 0;
- CL_NextDemo ();
- }
- else
- cls.demonum = -1;
-}
-
-
-/*
-==================
-CL_Demos_f
-
-Return to looping demos
-==================
-*/
-static void CL_Demos_f(cmd_state_t *cmd)
-{
- if (cls.state == ca_dedicated)
- return;
- if (cls.demonum == -1)
- cls.demonum = 1;
- CL_Disconnect_f (cmd);
- CL_NextDemo ();
-}
-
-/*
-==================
-CL_Stopdemo_f
-
-Return to looping demos
-==================
-*/
-static void CL_Stopdemo_f(cmd_state_t *cmd)
-{
- if (!cls.demoplayback)
- return;
- CL_Disconnect ();
- SV_Shutdown ();
-}
-
static void CL_SendCvar_f(cmd_state_t *cmd)
{
int i;
Cmd_AddCommand(CMD_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
Cmd_AddCommand(CMD_CLIENT | CMD_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
- Cmd_AddCommand(CMD_CLIENT, "startdemos", CL_Startdemos_f, "start playing back the selected demos sequentially (used at end of startup script)");
- Cmd_AddCommand(CMD_CLIENT, "demos", CL_Demos_f, "restart looping demos defined by the last startdemos command");
- Cmd_AddCommand(CMD_CLIENT, "stopdemo", CL_Stopdemo_f, "stop playing or recording demo (like stop command) and return to looping demos");
Cmd_AddCommand(CMD_CLIENT, "sendcvar", CL_SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
Cmd_AddCommand(CMD_CLIENT, "rcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); note: if rcon_secure is set, client and server clocks must be synced e.g. via NTP");
Cmd_AddCommand(CMD_CLIENT, "srcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); this always works as if rcon_secure is set; note: client and server clocks must be synced e.g. via NTP");