]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
cvar: remove remaining uses of legacy internal functions
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 1 Aug 2024 09:19:50 +0000 (19:19 +1000)
committerDes <xon@damianv.com.ar>
Mon, 5 Aug 2024 11:59:15 +0000 (08:59 -0300)
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_demo.c
gl_rmain.c
menu.c
sv_ccmds.c
sv_main.c
sv_save.c

index 10457bdfe460abbe135689c802748fc9b5748aee..b61ebf26441ac4fbbf9803b50d808c1ad6cb3208 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -86,7 +86,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)
index 7113cacad923e20daea780f7f83572272b44dcbb..cf07e8fc23d2013737bfff5b04ab086cc41553cf 100644 (file)
@@ -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 6519feca9260d3ef9414ef7e007ea3740b614f64..6324d9713161fd6c3b788b3c2808410069a079ad 100644 (file)
--- 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);
                        }
                }
        }
index ca713b58f5462e91f248d09e3496c644271fa65e..2246a200f056daac1b8029467e0210434f5e31f4 100644 (file)
@@ -1166,9 +1166,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");
 }
 
 /*
index c0b4433465dc97ab4bead7f2340d04604a619ea3..23649b5110da324fa7e44ba95eb9e37904ed2f7f 100644 (file)
--- 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)
index 39e1f78352dab7c666753526264486cedc4476b9..c2c7442bbd6d0f1bc4b77549cedcaab50507ba87 100644 (file)
--- 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");