Skip to content

Commit

Permalink
cvar: remove remaining uses of legacy internal functions
Browse files Browse the repository at this point in the history
Signed-off-by: bones_was_here <[email protected]>
  • Loading branch information
bones-was-here committed Aug 1, 2024
1 parent 26612fb commit 27c5895
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cl_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void CL_StopPlayback (void)
{
#ifdef CONFIG_VIDEO_CAPTURE
if (cl_capturevideo_demo_stop.integer)
Cvar_Set(&cvars_all, "cl_capturevideo", "0");
Cvar_SetQuick(&cl_capturevideo, "0");
#endif

if (!cls.demoplayback)
Expand Down
12 changes: 6 additions & 6 deletions gl_rmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ void FOG_clear(void)
{
if (gamemode == GAME_NEHAHRA)
{
Cvar_Set(&cvars_all, "gl_fogenable", "0");
Cvar_Set(&cvars_all, "gl_fogdensity", "0.2");
Cvar_Set(&cvars_all, "gl_fogred", "0.3");
Cvar_Set(&cvars_all, "gl_foggreen", "0.3");
Cvar_Set(&cvars_all, "gl_fogblue", "0.3");
Cvar_SetQuick(&gl_fogenable, "0");
Cvar_SetQuick(&gl_fogdensity, "0.2");
Cvar_SetQuick(&gl_fogred, "0.3");
Cvar_SetQuick(&gl_foggreen, "0.3");
Cvar_SetQuick(&gl_fogblue, "0.3");
}
r_refdef.fog_density = 0;
r_refdef.fog_red = 0;
Expand Down Expand Up @@ -3406,7 +3406,7 @@ void GL_Main_Init(void)
Cvar_RegisterVariable(&r_q1bsp_lightmap_updates_combine);
Cvar_RegisterVariable(&r_q1bsp_lightmap_updates_hidden_surfaces);
if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
Cvar_SetValue(&cvars_all, "r_fullbrights", 0);
Cvar_SetQuick(&r_fullbrights, "0");
#ifdef DP_MOBILETOUCH
// GLES devices have terrible depth precision in general, so...
Cvar_SetValueQuick(&r_nearclip, 4);
Expand Down
12 changes: 6 additions & 6 deletions menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,7 @@ static void M_LanConfig_Key(cmd_state_t *cmd, int key, int ascii)

Cbuf_AddText(cmd, "stopdemo\n");

Cvar_SetValue(&cvars_all, "port", lanConfig_port);
Cvar_SetValueQuick(&sv_netport, lanConfig_port);

if (lanConfig_cursor == 1 || lanConfig_cursor == 2)
{
Expand Down Expand Up @@ -4000,7 +4000,7 @@ void M_GameOptions_Draw (void)
if (gamemode == GAME_TRANSFUSION)
{
if (!coop.integer && !deathmatch.integer)
Cvar_SetValue(&cvars_all, "deathmatch", 1);
Cvar_SetQuick(&deathmatch, "1");
if (deathmatch.integer == 0)
M_Print(160, 64, "Cooperative");
else if (deathmatch.integer == 2)
Expand All @@ -4011,7 +4011,7 @@ void M_GameOptions_Draw (void)
else if (gamemode == GAME_BATTLEMECH)
{
if (!deathmatch.integer)
Cvar_SetValue(&cvars_all, "deathmatch", 1);
Cvar_SetQuick(&deathmatch, "1");
if (deathmatch.integer == 2)
M_Print(160, 64, "Rambo Match");
else
Expand All @@ -4020,7 +4020,7 @@ void M_GameOptions_Draw (void)
else
{
if (!coop.integer && !deathmatch.integer)
Cvar_SetValue(&cvars_all, "deathmatch", 1);
Cvar_SetQuick(&deathmatch, "1");
if (coop.integer)
M_Print(160, 64, "Cooperative");
else
Expand Down Expand Up @@ -4362,7 +4362,7 @@ static void M_GameOptions_Key(cmd_state_t *cmd, int key, int ascii)
l = min(l - 1, 37);
memcpy(hostnamebuf, hostname.string, l);
hostnamebuf[l] = 0;
Cvar_Set(&cvars_all, "hostname", hostnamebuf);
Cvar_SetQuick(&hostname, hostnamebuf);
}
}
break;
Expand All @@ -4378,7 +4378,7 @@ static void M_GameOptions_Key(cmd_state_t *cmd, int key, int ascii)
memcpy(hostnamebuf, hostname.string, l);
hostnamebuf[l] = ascii;
hostnamebuf[l+1] = 0;
Cvar_Set(&cvars_all, "hostname", hostnamebuf);
Cvar_SetQuick(&hostname, hostnamebuf);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,9 @@ static void SV_MaxPlayers_f(cmd_state_t *cmd)

svs.maxclients_next = n;
if (n == 1)
Cvar_Set (&cvars_all, "deathmatch", "0");
Cvar_SetQuick(&deathmatch, "0");
else
Cvar_Set (&cvars_all, "deathmatch", "1");
Cvar_SetQuick(&deathmatch, "1");
}

/*
Expand Down
2 changes: 1 addition & 1 deletion sv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static void SV_ServerOptions (void)
if (Sys_CheckParm ("-listen"))
Con_Printf ("Only one of -dedicated or -listen can be specified\n");
// default sv_public on for dedicated servers (often hosted by serious administrators), off for listen servers (often hosted by clueless users)
Cvar_SetValue(&cvars_all, "sv_public", 1);
Cvar_SetQuick(&sv_public, "1");
Cvar_SetQuick(&sv_dedicated, "1");
}
else if (cl_available)
Expand Down
2 changes: 1 addition & 1 deletion sv_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void SV_Loadgame_f(cmd_state_t *cmd)
COM_ParseToken_Simple(&t, false, false, true);
// this silliness is so we can load 1.06 save files, which have float skill values
current_skill = (int)(atof(com_token) + 0.5);
Cvar_SetValue (&cvars_all, "skill", (float)current_skill);
Cvar_SetValueQuick(&skill, (float)current_skill);

if(developer_entityparsing.integer)
Con_Printf("SV_Loadgame_f: loading mapname\n");
Expand Down

0 comments on commit 27c5895

Please sign in to comment.