From: bones_was_here Date: Thu, 1 Aug 2024 09:19:50 +0000 (+1000) Subject: cvar: remove remaining uses of legacy internal functions X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=27c5895996188ae347307c370bbfe7a7716a768e;p=xonotic%2Fdarkplaces.git cvar: remove remaining uses of legacy internal functions Signed-off-by: bones_was_here --- diff --git a/cl_demo.c b/cl_demo.c index f44e539f..a2ee5f92 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -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) diff --git a/gl_rmain.c b/gl_rmain.c index 7113caca..cf07e8fc 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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; @@ -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); diff --git a/menu.c b/menu.c index 6519feca..6324d971 100644 --- a/menu.c +++ b/menu.c @@ -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) { @@ -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) @@ -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 @@ -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 @@ -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; @@ -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); } } } diff --git a/sv_ccmds.c b/sv_ccmds.c index aa6790e5..fa776ae5 100644 --- a/sv_ccmds.c +++ b/sv_ccmds.c @@ -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"); } /* diff --git a/sv_main.c b/sv_main.c index c0b44334..23649b51 100644 --- a/sv_main.c +++ b/sv_main.c @@ -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) diff --git a/sv_save.c b/sv_save.c index 39e1f783..c2c7442b 100644 --- a/sv_save.c +++ b/sv_save.c @@ -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");