Add cl_demoreel cvar.

This commit is contained in:
Shpoike 2021-09-09 02:50:35 +01:00
parent 7e8c5ecd29
commit 3dd6a85a9f
5 changed files with 29 additions and 3 deletions

View file

@ -56,6 +56,7 @@ cvar_t cl_maxpitch = {"cl_maxpitch", "90", CVAR_ARCHIVE}; //johnfitz -- variable
cvar_t cl_minpitch = {"cl_minpitch", "-90", CVAR_ARCHIVE}; //johnfitz -- variable pitch clamping
cvar_t cl_recordingdemo = {"cl_recordingdemo", "", CVAR_ROM}; //the name of the currently-recording demo.
cvar_t cl_demoreel = {"cl_demoreel", "0", CVAR_ARCHIVE};
client_static_t cls;
client_state_t cl;
@ -1570,6 +1571,7 @@ void CL_Init (void)
Cvar_RegisterVariable (&cl_maxpitch); //johnfitz -- variable pitch clamping
Cvar_RegisterVariable (&cl_minpitch); //johnfitz -- variable pitch clamping
Cvar_RegisterVariable (&cl_recordingdemo); //spike -- for mod hacks. combine with cvar_string or something
Cvar_RegisterVariable (&cl_demoreel);
Cmd_AddCommand ("entities", CL_PrintEntities_f);
Cmd_AddCommand ("disconnect", CL_Disconnect_f);

View file

@ -339,6 +339,7 @@ extern cvar_t cl_autofire;
extern cvar_t cl_recordingdemo;
extern cvar_t cl_shownet;
extern cvar_t cl_nolerp;
extern cvar_t cl_demoreel;
extern cvar_t cfg_unbindall;

View file

@ -1845,7 +1845,10 @@ void COM_Init (void)
}
if (COM_CheckParm("-fitz"))
{
fitzmode = true;
cl_demoreel.string = "1"; //shouldn't be registered yet.
}
#ifdef _DEBUG
Cmd_AddCommand ("fitztest", FitzTest_f); //johnfitz
#endif

View file

@ -2484,7 +2484,7 @@ void Host_Startdemos_f (void)
if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
{
cls.demonum = 0;
if (!fitzmode)
if (!cl_demoreel.value)
{ /* QuakeSpasm customization: */
/* go straight to menu, no CL_NextDemo */
cls.demonum = -1;

View file

@ -251,8 +251,10 @@ void M_Main_Key (int key)
m_state = m_none;
cls.demonum = m_save_demonum;
IN_UpdateGrabs();
if (!fitzmode) /* QuakeSpasm customization: */
if (!cl_demoreel.value) /* QuakeSpasm customization: */
break;
if (cl_demoreel.value >= 2 && cls.demonum == -1)
cls.demonum = 0;
if (cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected)
CL_NextDemo ();
break;
@ -1628,6 +1630,7 @@ static enum extras_e
EXTRAS_MODELLERP,
EXTRAS_FPSCAP,
EXTRAS_YIELD,
EXTRAS_DEMOREEL,
EXTRAS_RENDERSCALE,
EXTRAS_NETEXTENSIONS,
EXTRAS_QCEXTENSIONS,
@ -1713,6 +1716,14 @@ static void M_Extras_AdjustSliders (int dir)
case EXTRAS_YIELD:
Cvar_SetQuick (&sys_throttle, sys_throttle.value?"0":sys_throttle.default_string);
break;
case EXTRAS_DEMOREEL:
m = cl_demoreel.value+dir;
if (m < 0)
m = 2;
else if (m > 2)
m = 0;
Cvar_SetValueQuick (&cl_demoreel, m);
break;
case EXTRAS_RENDERSCALE:
m = r_scale.value-dir;
m = CLAMP(1, m, 4);
@ -1790,6 +1801,15 @@ void M_Extras_Draw (void)
else
M_Print (220, y, "off");
break;
case EXTRAS_DEMOREEL:
M_Print (16, y, " Attract Mode");
if (cl_demoreel.value>1)
M_Print (220, y, "on");
else if (cl_demoreel.value)
M_Print (220, y, "startup only");
else
M_Print (220, y, "off");
break;
case EXTRAS_RENDERSCALE:
M_Print (16, y, " Render Scale");
if (r_scale.value==1)
@ -3237,7 +3257,7 @@ void M_Draw (void)
case m_extras:
M_Extras_Draw ();
return;
break;
case m_video:
M_Video_Draw ();