mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'more-legacy-gl-gatekeeping' into 'master'
Legacy GL options hidden in Software; message box confirmation to switch to Legacy GL Closes #1264 See merge request KartKrew/Kart!2261
This commit is contained in:
commit
a27c41b23d
4 changed files with 76 additions and 1 deletions
32
src/k_menu.h
32
src/k_menu.h
|
|
@ -398,6 +398,36 @@ typedef enum
|
|||
sopt_restart,
|
||||
} sopt_e;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
vaopt_spacer1,
|
||||
vaopt_drawdist,
|
||||
vaopt_weatherdist,
|
||||
vaopt_skybox,
|
||||
vaopt_parallel,
|
||||
vaopt_frameskip,
|
||||
vaopt_spacer2,
|
||||
vaopt_spacer3,
|
||||
vaopt_spacer4,
|
||||
vaopt_spacer5,
|
||||
vaopt_spacer6,
|
||||
vaopt_spacer7,
|
||||
vaopt_spacer8,
|
||||
vaopt_spacer9,
|
||||
vaopt_renderer,
|
||||
vaopt_legacygl_begin,
|
||||
vaopt_spacer10 = vaopt_legacygl_begin,
|
||||
vaopt_3dmodels,
|
||||
vaopt_shaders,
|
||||
vaopt_spacer11,
|
||||
vaopt_texturequal,
|
||||
vaopt_anisotropic,
|
||||
vaopt_spacer12,
|
||||
vaopt_billboarding,
|
||||
vaopt_perspective,
|
||||
vaopt_legacygl_end,
|
||||
} vaopt_e;
|
||||
|
||||
extern menuitem_t OPTIONS_Profiles[];
|
||||
extern menu_t OPTIONS_ProfilesDef;
|
||||
|
||||
|
|
@ -1110,6 +1140,8 @@ void M_SoundOptions(INT32 choice);
|
|||
void M_GameplayOptions(INT32 choice);
|
||||
void M_ServerOptions(INT32 choice);
|
||||
|
||||
void M_RefreshAdvancedVideoOptions(void);
|
||||
|
||||
void M_HandleItemToggles(INT32 choice); // For item toggling
|
||||
void M_EraseData(INT32 choice); // For data erasing
|
||||
void M_CheckProfileData(INT32 choice); // check if we have profiles.
|
||||
|
|
|
|||
|
|
@ -176,9 +176,41 @@ void M_ChangeCvarDirect(INT32 choice, consvar_t *cv)
|
|||
}
|
||||
}
|
||||
|
||||
static void M_ChangeCvarResponse(INT32 choice)
|
||||
{
|
||||
if (choice != MA_YES)
|
||||
return;
|
||||
|
||||
consvar_t *cvar = currentMenu->menuitems[itemOn].itemaction.cvar;
|
||||
M_ChangeCvarDirect(choice, cvar);
|
||||
}
|
||||
|
||||
static void M_ChangeCvar(INT32 choice)
|
||||
{
|
||||
M_ChangeCvarDirect(choice, currentMenu->menuitems[itemOn].itemaction.cvar);
|
||||
consvar_t *cvar = currentMenu->menuitems[itemOn].itemaction.cvar;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (cvar == &cv_renderer &&
|
||||
// Switching from Software [to Legacy GL]
|
||||
cv_renderer.value == 1 &&
|
||||
// Not setting to default (ie changing the value)
|
||||
choice != -1)
|
||||
{
|
||||
M_StartMessage(
|
||||
"Switching to Legacy GL",
|
||||
"Legacy GL is \x85" "INCOMPLETE and BROKEN.\x80\n"
|
||||
"\n"
|
||||
"ARE YOU SURE?",
|
||||
M_ChangeCvarResponse,
|
||||
MM_YESNO,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
M_ChangeCvarDirect(choice, cvar);
|
||||
}
|
||||
|
||||
static const char *M_QueryCvarAction(const char *replace)
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@
|
|||
#include "../k_menu.h"
|
||||
#include "../r_main.h" // cv_skybox
|
||||
#include "../hardware/hw_main.h" // gl consvars
|
||||
#include "../i_video.h" // rendermode
|
||||
|
||||
extern consvar_t cv_menuframeskip;
|
||||
|
||||
// see vaopt_e
|
||||
menuitem_t OPTIONS_VideoAdvanced[] =
|
||||
{
|
||||
{IT_HEADER, "Performance...", NULL,
|
||||
|
|
@ -113,3 +115,10 @@ menu_t OPTIONS_VideoAdvancedDef = {
|
|||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
void M_RefreshAdvancedVideoOptions(void)
|
||||
{
|
||||
OPTIONS_VideoAdvancedDef.numitems = rendermode == render_opengl
|
||||
? sizeof (OPTIONS_VideoAdvanced) / sizeof (menuitem_t)
|
||||
: vaopt_legacygl_begin;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1484,6 +1484,8 @@ boolean VID_CheckRenderer(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
M_RefreshAdvancedVideoOptions();
|
||||
|
||||
return rendererchanged;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue