Expose VR options menu
This commit is contained in:
parent
56b5e8c38e
commit
cd5c374163
2 changed files with 83 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ _(OP_VIDEOMODE)
|
|||
_(OP_VISUAL)
|
||||
_(OP_VIDCOLORPROFILE)
|
||||
_(OP_OPENGL)
|
||||
_(OP_VR)
|
||||
|
||||
_(OP_SOUND)
|
||||
_(SR_SOUNDTEST)
|
||||
|
|
|
|||
82
src/m_menu.c
82
src/m_menu.c
|
|
@ -66,6 +66,7 @@
|
|||
#include "byteptr.h"
|
||||
#include "st_stuff.h"
|
||||
#include "i_sound.h"
|
||||
#include "dehacked.h"
|
||||
#include "k_hud.h" // SRB2kart
|
||||
#include "k_kart.h"
|
||||
#include "k_items.h" // KartItemCVars
|
||||
|
|
@ -671,6 +672,82 @@ INT32 MR_OpenGLOptionsMenu(INT32 choice)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
static menuitem_t *M_EnsureMenuItem(menutype_t menutype, const char *name)
|
||||
{
|
||||
menu_t *menu = &menudefs[menutype];
|
||||
menuitem_t *item = M_CheckMenuItem(menutype, name);
|
||||
|
||||
if (item)
|
||||
return item;
|
||||
|
||||
menu->menuitems = Z_Realloc(menu->menuitems, sizeof(menuitem_t)*(menu->numitems + 1), PU_STATIC, NULL);
|
||||
item = &menu->menuitems[menu->numitems++];
|
||||
memset(item, 0, sizeof(*item));
|
||||
DEH_Link(name, &item->info, &menunames);
|
||||
return item;
|
||||
}
|
||||
|
||||
static void M_SetMenuItemText(menuitem_t *item, const char *text)
|
||||
{
|
||||
if (item->text)
|
||||
Z_Free(item->text);
|
||||
item->text = Z_StrDup(text);
|
||||
}
|
||||
|
||||
static void M_SetVRMenuCvarItem(const char *name, const char *text, consvar_t *cvar)
|
||||
{
|
||||
menuitem_t *item = M_EnsureMenuItem(MN_OP_VR, name);
|
||||
|
||||
M_SetMenuItemText(item, text);
|
||||
item->status = IT_INTERACT;
|
||||
item->cvar = cvar;
|
||||
item->routine = NULL;
|
||||
item->submenu = MN_NONE;
|
||||
item->argument = 0;
|
||||
item->x = 0;
|
||||
item->y = 0;
|
||||
}
|
||||
|
||||
static void M_AddDefaultVROptionsMenu(void)
|
||||
{
|
||||
menu_t *video = &menudefs[MN_OP_VIDEO];
|
||||
menu_t *source = menudefs[MN_OP_OPENGL].numitems ? &menudefs[MN_OP_OPENGL] : video;
|
||||
menu_t *vr = &menudefs[MN_OP_VR];
|
||||
menuitem_t *videoitem = M_EnsureMenuItem(MN_OP_VIDEO, "VR");
|
||||
|
||||
M_SetMenuItemText(videoitem, "VR Options...");
|
||||
videoitem->status = IT_INTERACT;
|
||||
videoitem->submenu = MN_OP_VR;
|
||||
videoitem->cvar = NULL;
|
||||
videoitem->routine = NULL;
|
||||
videoitem->argument = 0;
|
||||
videoitem->x = 0;
|
||||
videoitem->y = 0;
|
||||
|
||||
vr->drawroutine = MD_DrawGenericMenu;
|
||||
vr->x = source->x ? source->x : 72;
|
||||
vr->y = source->y ? source->y : 36;
|
||||
vr->scrollheight = source->scrollheight ? source->scrollheight : 128;
|
||||
vr->cursoroffset = source->cursoroffset;
|
||||
vr->lineheight = source->lineheight ? source->lineheight : 10;
|
||||
vr->enterroutine = MR_OpenGLOptionsMenu;
|
||||
|
||||
M_SetVRMenuCvarItem("ENABLED", "Virtual Reality", &cv_vrenabled);
|
||||
M_SetVRMenuCvarItem("RESOLUTION", "Resolution Scale", &cv_vrresolution);
|
||||
M_SetVRMenuCvarItem("WORLDSCALE", "World Scale", &cv_vrscale);
|
||||
M_SetVRMenuCvarItem("PLAYERSCALE", "Scale World With Player", &cv_vrplayerscale);
|
||||
M_SetVRMenuCvarItem("UIDISTANCE", "UI Distance", &cv_vruidistance);
|
||||
M_SetVRMenuCvarItem("UISCALE", "UI Scale", &cv_vruiscale);
|
||||
M_SetVRMenuCvarItem("UIMODE", "UI Mode", &cv_vruimode);
|
||||
M_SetVRMenuCvarItem("SPRITEROTATE", "Rotate Sprites With HMD", &cv_vrspriterotate);
|
||||
M_SetVRMenuCvarItem("VIEWMODE", "Desktop Render Mode", &cv_vrviewmode);
|
||||
M_SetVRMenuCvarItem("LOCKCAMERA", "Lock Camera Forward", &cv_glshearing);
|
||||
M_SetVRMenuCvarItem("POSEMODE", "Pose Mode", &cv_vrposemode);
|
||||
M_SetVRMenuCvarItem("SKYSTEREO", "Disable Skybox Stereoscopy", &cv_vrdisableskystereo);
|
||||
M_SetVRMenuCvarItem("SKYBOXES", "Disable Skyboxes", &cv_vrcomfortmode);
|
||||
M_SetVRMenuCvarItem("TRACKINTROS", "Track Intros", &cv_vrtrackintro);
|
||||
}
|
||||
#endif
|
||||
|
||||
void M_UpdateNumServerPages(void)
|
||||
|
|
@ -2229,6 +2306,7 @@ void M_Ticker(void)
|
|||
// Hide some options based on the current render mode
|
||||
#ifdef HWRENDER
|
||||
M_SetItemVisible(MN_OP_VIDEO, "OPENGL", rendermode == render_opengl);
|
||||
M_SetItemVisible(MN_OP_VIDEO, "VR", rendermode == render_opengl);
|
||||
#endif
|
||||
//M_SetItemVisible(MN_OP_VIDEO, "PARALLEL", rendermode == render_soft);
|
||||
|
||||
|
|
@ -2305,6 +2383,10 @@ void M_Init(void)
|
|||
CV_RegisterVar(&cv_dummycolor);
|
||||
CV_RegisterVar(&cv_dummyserverpage);
|
||||
|
||||
#ifdef HWRENDER
|
||||
M_AddDefaultVROptionsMenu();
|
||||
#endif
|
||||
|
||||
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)");
|
||||
|
|
|
|||
Loading…
Reference in a new issue