From 6fe87ab05aa35ef56c33d17eb6a7784fbfa395b7 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 9 Feb 2024 14:41:35 +0100 Subject: [PATCH] Clean up cvar stuff a little --- src/d_netcmd.c | 52 +++++--------------------------------------------- src/d_netcmd.h | 6 ------ src/k_kart.c | 26 ++++++++++++------------- src/m_menu.c | 13 +++++++++++++ src/m_menu.h | 8 +++++++- src/s_sound.c | 18 +++++++++++++++++ src/screen.c | 8 ++++++++ 7 files changed, 63 insertions(+), 68 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c64804fef..9d55e76ca 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -196,7 +196,6 @@ static void Command_Cheats_f(void); static void Command_ListSkins(void); static void Command_SkinSearch(void); - #ifdef _DEBUG static void Command_Togglemodified_f(void); #ifdef HAVE_BLUA @@ -513,10 +512,6 @@ consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange, consvar_t cv_sleep = {"cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL}; -static CV_PossibleValue_t skinselectspin_cons_t[] = { - {0, "Off"}, {1, "Slow"}, {2, "2"}, {3, "3"}, {4, "4"}, {5, "5"}, {6, "6"}, {7, "7"}, {8, "8"}, {9, "9"}, {10, "Fast"}, {SKINSELECTSPIN_PAIN, "Pain"}, {0, NULL}}; -consvar_t cv_skinselectspin = {"skinselectspin", "5", CV_SAVE, skinselectspin_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; - static CV_PossibleValue_t perfstats_cons_t[] = { {0, "Off"}, {1, "Rendering"}, {2, "Logic"}, {3, "ThinkFrame"}, {4, "PreThinkFrame"}, {5, "PostThinkFrame"}, {0, NULL}}; consvar_t cv_perfstats = {"perfstats", "Off", CV_CALL, perfstats_cons_t, PS_PerfStats_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -530,8 +525,6 @@ static CV_PossibleValue_t ps_descriptor_cons_t[] = { {1, "Average"}, {2, "SD"}, {3, "Minimum"}, {4, "Maximum"}, {0, NULL}}; consvar_t cv_ps_descriptor = {"ps_descriptor", "Average", 0, ps_descriptor_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; - static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scroll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {SKINMENUTYPE_EXTENDED, "Extended"}, {0, NULL}}; consvar_t cv_skinselectmenu = {"skinselectmenu", "Extended", CV_SAVE, skinselectmenu_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -797,8 +790,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_pingtimeout); CV_RegisterVar(&cv_showping); CV_RegisterVar(&cv_pingmeasurement); - CV_RegisterVar(&cv_pingicon); - CV_RegisterVar(&cv_pingstyle); #ifdef SEENAMES CV_RegisterVar(&cv_allowseenames); @@ -816,8 +807,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_recordmultiplayerdemos); CV_RegisterVar(&cv_netdemosyncquality); CV_RegisterVar(&cv_maxdemosize); - - CV_RegisterVar(&cv_cechotoggle); } // ========================================================================= @@ -943,17 +932,6 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ghost_staff); COM_AddCommand("displayplayer", Command_Displayplayer_f); - - CV_RegisterVar(&cv_audbuffersize); - -#ifdef HAVE_OPENMPT - CV_RegisterVar(&cv_modfilter); - CV_RegisterVar(&cv_stereosep); - CV_RegisterVar(&cv_amigafilter); -#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 - CV_RegisterVar(&cv_amigatype); -#endif -#endif // m_menu.c //CV_RegisterVar(&cv_compactscoreboard); @@ -970,13 +948,10 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_growmusic); CV_RegisterVar(&cv_supermusic); - CV_RegisterVar(&cv_showtrackaddon); CV_RegisterVar(&cv_showviewpointtext); CV_RegisterVar(&cv_luaimmersion); CV_RegisterVar(&cv_fakelocalskin); - - CV_RegisterVar(&cv_showlocalskinmenus); //CV_RegisterVar(&cv_crosshair); //CV_RegisterVar(&cv_crosshair2); @@ -1082,37 +1057,20 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_useranalog3); CV_RegisterVar(&cv_useranalog4);*/ - // s_sound.c - CV_RegisterVar(&cv_soundvolume); - CV_RegisterVar(&cv_digmusicvolume); -#ifndef NO_MIDI - CV_RegisterVar(&cv_midimusicvolume); -#endif - CV_RegisterVar(&cv_numChannels); - - // screen.c - CV_RegisterVar(&cv_fullscreen); - CV_RegisterVar(&cv_renderview); - CV_RegisterVar(&cv_vhseffect); - CV_RegisterVar(&cv_shittyscreen); - CV_RegisterVar(&cv_scr_depth); - CV_RegisterVar(&cv_scr_width); - CV_RegisterVar(&cv_scr_height); - CV_RegisterVar(&cv_soundtest); - - CV_RegisterVar(&cv_skinselectspin); CV_RegisterVar(&cv_perfstats); CV_RegisterVar(&cv_ps_thinkframe_page); CV_RegisterVar(&cv_ps_samplesize); CV_RegisterVar(&cv_ps_descriptor); + CV_RegisterVar(&cv_cechotoggle); + + CV_RegisterVar(&cv_pingicon); + CV_RegisterVar(&cv_pingstyle); + //Value used to store last server player has joined CV_RegisterVar(&cv_lastserver); - - CV_RegisterVar(&cv_showallmaps); - CV_RegisterVar(&cv_showmusicfilename); // ingame object placing COM_AddCommand("objectplace", Command_ObjectPlace_f); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 8fbdf1d5f..ff94902de 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -167,22 +167,16 @@ extern consvar_t cv_showlapemblem; extern consvar_t cv_showviewpointtext; extern consvar_t cv_luaimmersion; extern consvar_t cv_fakelocalskin; -extern consvar_t cv_showlocalskinmenus; extern consvar_t cv_skipmapcheck; extern consvar_t cv_sleep; -#define SKINSELECTSPIN_PAIN 25 -extern consvar_t cv_skinselectspin; - extern consvar_t cv_perfstats; extern consvar_t cv_ps_thinkframe_page; extern consvar_t cv_ps_samplesize; extern consvar_t cv_ps_descriptor; -extern consvar_t cv_showtrackaddon; - typedef enum { SKINMENUTYPE_SCROLL = 0, diff --git a/src/k_kart.c b/src/k_kart.c index 3170bc143..a79e5fee1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -701,35 +701,33 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_showstats); CV_RegisterVar(&cv_showinput); CV_RegisterVar(&cv_newspeedometer); - - + CV_RegisterVar(&cv_saltyhop); CV_RegisterVar(&cv_saltyhopsfx); CV_RegisterVar(&cv_saltysquish); - + //Colourized HUD CV_RegisterVar(&cv_colorizedhud); CV_RegisterVar(&cv_colorizedhudcolor); CV_RegisterVar(&cv_colorizeditembox); - + CV_RegisterVar(&cv_darkitembox); - + CV_RegisterVar(&cv_biglaps); - + CV_RegisterVar(&cv_highresportrait); - + CV_RegisterVar(&cv_slamsound); - + CV_RegisterVar(&cv_minihead); CV_RegisterVar(&cv_showminimapnames); CV_RegisterVar(&cv_showlapemblem); - - CV_RegisterVar(&cv_stagetitle); - - CV_RegisterVar(&cv_lessflicker); - - CV_RegisterVar(&cv_mouseturn); + CV_RegisterVar(&cv_stagetitle); + + CV_RegisterVar(&cv_lessflicker); + + CV_RegisterVar(&cv_mouseturn); } //} diff --git a/src/m_menu.c b/src/m_menu.c index 80e0ba5db..7a0dcf1c1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -525,6 +525,12 @@ static consvar_t cv_dummycontinues = {"dummycontinues", "0", CV_HIDEN, liveslimi //static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dummymares_cons_t, Dummymares_OnChange, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaff_cons_t, Dummystaff_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; + +static CV_PossibleValue_t skinselectspin_cons_t[] = { + {0, "Off"}, {1, "Slow"}, {2, "2"}, {3, "3"}, {4, "4"}, {5, "5"}, {6, "6"}, {7, "7"}, {8, "8"}, {9, "9"}, {10, "Fast"}, {SKINSELECTSPIN_PAIN, "Pain"}, {0, NULL}}; +consvar_t cv_skinselectspin = {"skinselectspin", "5", CV_SAVE, skinselectspin_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + // ========================================================================== // ORGANIZATION START. // ========================================================================== @@ -4441,6 +4447,13 @@ void M_Init(void) //CV_RegisterVar(&cv_dummymares); CV_RegisterVar(&cv_dummystaff); + CV_RegisterVar(&cv_showtrackaddon); + CV_RegisterVar(&cv_showlocalskinmenus); + + CV_RegisterVar(&cv_skinselectspin); + CV_RegisterVar(&cv_showallmaps); + CV_RegisterVar(&cv_showmusicfilename); + quitmsg[QUITMSG] = M_GetText("Eggman's tied explosives\nto your girlfriend, and\nwill activate them if\nyou press the 'Y' key!\nPress 'N' to save her!\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG1] = M_GetText("What would Tails say if\nhe saw you quitting the game?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG2] = M_GetText("Hey!\nWhere do ya think you're goin'?\n\n(Press 'Y' to quit)"); diff --git a/src/m_menu.h b/src/m_menu.h index 8d1ebb723..574654894 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -242,10 +242,16 @@ extern INT32 mapwads[NUMMAPS]; extern description_t description[MAXSKINS]; +#define SKINSELECTSPIN_PAIN 25 + extern consvar_t cv_showfocuslost; -extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort; extern consvar_t cv_showallmaps; extern consvar_t cv_showmusicfilename; +extern consvar_t cv_skinselectspin; +extern consvar_t cv_showlocalskinmenus; +extern consvar_t cv_showtrackaddon; + +extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort; extern CV_PossibleValue_t gametype_cons_t[]; extern char dummystaffname[22]; diff --git a/src/s_sound.c b/src/s_sound.c index a2f81f210..c4c33d084 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -273,6 +273,13 @@ void S_RegisterSoundStuff(void) sound_disabled = true; return; } + + CV_RegisterVar(&cv_soundvolume); + CV_RegisterVar(&cv_digmusicvolume); +#ifndef NO_MIDI + CV_RegisterVar(&cv_midimusicvolume); +#endif + CV_RegisterVar(&cv_numChannels); CV_RegisterVar(&stereoreverse); CV_RegisterVar(&precachesound); @@ -285,6 +292,17 @@ void S_RegisterSoundStuff(void) CV_RegisterVar(&cv_gamemidimusic); #endif + CV_RegisterVar(&cv_audbuffersize); + +#ifdef HAVE_OPENMPT + CV_RegisterVar(&cv_modfilter); + CV_RegisterVar(&cv_stereosep); + CV_RegisterVar(&cv_amigafilter); +#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 + CV_RegisterVar(&cv_amigatype); +#endif +#endif + //bird music stuff CV_RegisterVar(&cv_playmusicifunfocused); CV_RegisterVar(&cv_playsoundifunfocused); diff --git a/src/screen.c b/src/screen.c index d7aa1407e..b5a7fe0fe 100644 --- a/src/screen.c +++ b/src/screen.c @@ -233,6 +233,14 @@ void SCR_Startup(void) CV_RegisterVar(&cv_menucaps); CV_RegisterVar(&cv_constextsize); + CV_RegisterVar(&cv_fullscreen); + CV_RegisterVar(&cv_renderview); + CV_RegisterVar(&cv_vhseffect); + CV_RegisterVar(&cv_shittyscreen); + CV_RegisterVar(&cv_scr_depth); + CV_RegisterVar(&cv_scr_width); + CV_RegisterVar(&cv_scr_height); + CV_RegisterVar(&cv_globalgamma); CV_RegisterVar(&cv_globalsaturation);