diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index b2cf6839d..3e4d06668 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -766,58 +766,6 @@ static int osdcmd_inittimer(osdcmdptr_t parm) #endif #endif -static int osdcmd_cvar_set_game(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set(parm); - - if (r != OSDCMD_OK) return r; - - if (!Bstrcasecmp(parm->name, "r_upscalefactor")) - { - if (in3dmode()) - { - videoSetGameMode(fullscreen, xres, yres, bpp, gUpscaleFactor); - } - } - else if (!Bstrcasecmp(parm->name, "vid_gamma")) - { - gBrightness = GAMMA_CALC; - gBrightness <<= 2; - videoSetPalette(gBrightness>>2,gLastPal,0); - } - else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) - { - videoSetPalette(gBrightness>>2,gLastPal,0); - } -#if 0 - else if (!Bstrcasecmp(parm->name, "color")) - { - ud.color = G_CheckPlayerColor(ud.color); - g_player[0].ps->palookup = g_player[0].pcolor = ud.color; - } - else if (!Bstrcasecmp(parm->name, "osdscale")) - { - osdrscale = 1.f/osdscale; - - if (xdim && ydim) - OSD_ResizeDisplay(xdim, ydim); - } -#endif - - return r; -} - -static int osdcmd_cvar_set_multi(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set_game(parm); - - if (r != OSDCMD_OK) return r; - - //G_UpdatePlayerFromMenu(); - - return r; -} - int32_t registerosdcommands(void) { char buffer[256]; @@ -832,16 +780,10 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); // } // -// OSD_RegisterFunction("addpath","addpath : adds path to game filesystem", osdcmd_addpath); OSD_RegisterFunction("bind",R"(bind : associates a keypress with a string of console input. Type "bind showkeys" for a list of keys and "listsymbols" for a list of valid console commands.)", osdcmd_bind); // OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu); OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor); OSD_RegisterFunction("crosshairreset", "crosshairreset: restores the original crosshair", osdcmd_resetcrosshair); -// -//#if !defined NETCODE_DISABLE -// OSD_RegisterFunction("connect","connect: connects to a multiplayer game", osdcmd_connect); -// OSD_RegisterFunction("disconnect","disconnect: disconnects from the local multiplayer game", osdcmd_disconnect); -//#endif for (auto & func : gamefunctions) { diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index b59a7879e..d6af4ee08 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -369,14 +369,6 @@ CUSTOM_CVARD(String, wchoice, "3457860291", CVAR_ARCHIVE | CVAR_NOINITCALL | CVA #if 0 -// DN3D - static osdcvardata_t cvars_game[] = - { - - - - }; - // These I don't care about. //{ "r_upscalefactor", "increase performance by rendering at upscalefactor less than the screen resolution and upscale to the full resolution in the software renderer", (void *)&ud.detail, CVAR_INT|CVAR_FUNCPTR, 1, 16 }, //{ "r_upscalefactor", "increase performance by rendering at upscalefactor less than the screen resolution and upscale to the full resolution in the software renderer", (void *)&gUpscaleFactor, CVAR_INT|CVAR_FUNCPTR, 1, 16 @@ -402,6 +394,11 @@ CUSTOM_CVARD(String, wchoice, "3457860291", CVAR_ARCHIVE | CVAR_NOINITCALL | CVA // This needs some serious internal cleanup first, the implementation is all over the place and prone to whacking the user setting. { "color", "changes player palette", (void *)&ud.color, CVAR_INT|CVAR_MULTI, 0, MAXPALOOKUPS-1 }, + if (!Bstrcasecmp(parm->name, "color")) + { + ud.color = G_CheckPlayerColor(ud.color); + g_player[0].ps->palookup = g_player[0].pcolor = ud.color; + } // This one gets changed at run time by the game code, so making it persistent does not work @@ -413,4 +410,19 @@ CUSTOM_CVARD(String, wchoice, "3457860291", CVAR_ARCHIVE | CVAR_NOINITCALL | CVA // requires cleanup first //{ "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 }, + + // just as a reminder: + /* + else if (!Bstrcasecmp(parm->name, "vid_gamma")) + { + gBrightness = GAMMA_CALC; + gBrightness <<= 2; + videoSetPalette(gBrightness >> 2, gLastPal, 0); + } + else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) + { + videoSetPalette(gBrightness >> 2, gLastPal, 0); + } + */ + #endif diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index 94a8db507..907f3e703 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -720,16 +720,6 @@ static int osdcmd_lua(osdcmdptr_t parm) } #endif -static int osdcmd_addpath(osdcmdptr_t parm) -{ - if (parm->numparms != 1) - return OSDCMD_SHOWHELP; - - addsearchpath(parm->parms[0]); - - return OSDCMD_OK; -} - static int osdcmd_initgroupfile(osdcmdptr_t parm) { if (parm->numparms != 1) @@ -1432,55 +1422,6 @@ static int osdcmd_printtimes(osdcmdptr_t UNUSED(parm)) return OSDCMD_OK; } -static int osdcmd_cvar_set_game(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set(parm); - - if (r != OSDCMD_OK) return r; - - if (!Bstrcasecmp(parm->name, "r_upscalefactor")) - { - if (in3dmode()) - { - videoSetGameMode(fullscreen, xres, yres, bpp, ud.detail); - } - } - else if (!Bstrcasecmp(parm->name, "vid_gamma")) - { - ud.brightness = GAMMA_CALC; - ud.brightness <<= 2; - videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) - { - videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - else if (!Bstrcasecmp(parm->name, "color")) - { - ud.color = G_CheckPlayerColor(ud.color); - g_player[0].ps->palookup = g_player[0].pcolor = ud.color; - } - else if (!Bstrcasecmp(parm->name, "osdscale")) - { - osdrscale = 1.f/osdscale; - - if (xdim && ydim) - OSD_ResizeDisplay(xdim, ydim); - } - - return r; -} - -static int osdcmd_cvar_set_multi(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set_game(parm); - - if (r != OSDCMD_OK) return r; - - G_UpdatePlayerFromMenu(); - - return r; -} int32_t registerosdcommands(void) { @@ -1507,7 +1448,6 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); } - OSD_RegisterFunction("addpath","addpath : adds path to game filesystem", osdcmd_addpath); OSD_RegisterFunction("bind",R"(bind : associates a keypress with a string of console input. Type "bind showkeys" for a list of keys and "listsymbols" for a list of valid console commands.)", osdcmd_bind); OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu); OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor); diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index 4ba1d39aa..8d6248076 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -575,16 +575,6 @@ static int osdcmd_spawn(osdcmdptr_t parm) return OSDCMD_OK; } -static int osdcmd_addpath(osdcmdptr_t parm) -{ - if (parm->numparms != 1) - return OSDCMD_SHOWHELP; - - addsearchpath(parm->parms[0]); - - return OSDCMD_OK; -} - static int osdcmd_initgroupfile(osdcmdptr_t parm) { if (parm->numparms != 1) @@ -1219,54 +1209,6 @@ static int osdcmd_printtimes(osdcmdptr_t UNUSED(parm)) return OSDCMD_OK; } -static int osdcmd_cvar_set_game(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set(parm); - - if (r != OSDCMD_OK) return r; - - if (!Bstrcasecmp(parm->name, "r_upscalefactor")) - { - if (in3dmode()) - { - videoSetGameMode(fullscreen, xres, yres, bpp, ud.detail); - } - } - else if (!Bstrcasecmp(parm->name, "vid_gamma")) - { - ud.brightness = GAMMA_CALC; - ud.brightness <<= 2; - videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) - { - videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); - } - else if (!Bstrcasecmp(parm->name, "color")) - { - ud.color = G_CheckPlayerColor(ud.color); - g_player[0].ps->palookup = g_player[0].pcolor = ud.color; - } - else if (!Bstrcasecmp(parm->name, "osdscale")) - { - osdrscale = 1.f/osdscale; - - if (xdim && ydim) - OSD_ResizeDisplay(xdim, ydim); - } - return r; -} - -static int osdcmd_cvar_set_multi(osdcmdptr_t parm) -{ - int const r = osdcmd_cvar_set_game(parm); - - if (r != OSDCMD_OK) return r; - - G_UpdatePlayerFromMenu(); - - return r; -} int32_t registerosdcommands(void) { @@ -1280,7 +1222,6 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("demo","demo : starts the given demo", osdcmd_demo); } - OSD_RegisterFunction("addpath","addpath : adds path to game filesystem", osdcmd_addpath); OSD_RegisterFunction("bind",R"(bind : associates a keypress with a string of console input. Type "bind showkeys" for a list of keys and "listsymbols" for a list of valid console commands.)", osdcmd_bind); OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu); OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor);