- cleaned out the remains of the frontends' CVAR definitions.

This commit is contained in:
Christoph Oelckers 2019-10-23 18:58:34 +02:00
parent 20a393871b
commit ee5f0a7cf6
4 changed files with 20 additions and 185 deletions

View file

@ -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 <demofile or demonum>: starts the given demo", osdcmd_demo);
// }
//
// OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
OSD_RegisterFunction("bind",R"(bind <key> <string>: 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)
{

View file

@ -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

View file

@ -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 <demofile or demonum>: starts the given demo", osdcmd_demo);
}
OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
OSD_RegisterFunction("bind",R"(bind <key> <string>: 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);

View file

@ -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 <demofile or demonum>: starts the given demo", osdcmd_demo);
}
OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
OSD_RegisterFunction("bind",R"(bind <key> <string>: 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);