Skip to content

Commit

Permalink
Re-enable Fullscreen maode and resolution options when using the VR
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed Nov 2, 2024
1 parent a85269d commit 2f61fb0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 69 deletions.
69 changes: 20 additions & 49 deletions doomclassic/doom/m_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,17 +1146,12 @@ void M_DrawVideo(void)
std::string refreshString = va("%d Hz", com_engineHz.GetInteger());

int offset = 0;
if (!cl_engineHz_interp.GetBool()) {
if (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) {
offset = 1;
}
if(stereoRender_enable.GetInteger() == STEREO3D_VR) {
offset = 3;
}

if (stereoRender_enable.GetInteger() != STEREO3D_VR) {
V_DrawPatchDirect(::g->VideoDef.x + 150, ::g->VideoDef.y + LINEHEIGHT * endgame, 0,
/*(patch_t*)*/img2lmp(W_CacheLumpName(fullNames[fullscreenOnOff], PU_CACHE_SHARED), W_GetNumForName(fullNames[fullscreenOnOff])), false);
}
V_DrawPatchDirect(::g->VideoDef.x + 150, ::g->VideoDef.y + LINEHEIGHT * endgame, 0,
/*(patch_t*)*/img2lmp(W_CacheLumpName(fullNames[fullscreenOnOff], PU_CACHE_SHARED), W_GetNumForName(fullNames[fullscreenOnOff])), false);
V_DrawPatchDirect(::g->VideoDef.x + asoffset, ::g->VideoDef.y + LINEHEIGHT * (detail - offset), 0,
/*(patch_t*)*/img2lmp(W_CacheLumpName(detailNames[aspect + correct], PU_CACHE_SHARED), W_GetNumForName(detailNames[aspect + correct])), false);
V_DrawPatchDirect(::g->VideoDef.x + 135, ::g->VideoDef.y + LINEHEIGHT * (light - offset), 0,
Expand All @@ -1165,9 +1160,7 @@ void M_DrawVideo(void)
/*(patch_t*)*/img2lmp(W_CacheLumpName(syncNames[syncValue], PU_CACHE_SHARED), W_GetNumForName(syncNames[syncValue])), false);
//V_DrawPatchDirect(::g->VideoDef.x + 160, ::g->VideoDef.y + LINEHEIGHT * (blurry), 0,
// /*(patch_t*)*/img2lmp(W_CacheLumpName(msgNames[blurryeffect], PU_CACHE_SHARED), W_GetNumForName(msgNames[blurryeffect])));
if (stereoRender_enable.GetInteger() != STEREO3D_VR) {
M_WriteText(::g->VideoDef.x + 150, ::g->VideoDef.y + LINEHEIGHT * (resolution)+6, res, false);
}
M_WriteText(::g->VideoDef.x + 150, ::g->VideoDef.y + LINEHEIGHT * (resolution)+6, res, false);
M_WriteText(::g->VideoDef.x + 133, ::g->VideoDef.y + LINEHEIGHT * (framerate - offset) + 6, fps.c_str(), false);
if (cl_engineHz_interp.GetBool() && stereoRender_enable.GetInteger() != STEREO3D_VR) {
M_WriteText(::g->VideoDef.x + 160, ::g->VideoDef.y + LINEHEIGHT * (refresh)+6, refreshString.c_str(), false);
Expand Down Expand Up @@ -2931,30 +2924,27 @@ qboolean M_Responder (event_t* ev)
case KEY_DOWNARROW:
do
{
if (::g->itemOn + 1 > ::g->currentMenu->numitems - 1 && !(::g->currentMenu == &::g->VideoDef && stereoRender_enable.GetInteger() == STEREO3D_VR)) {
if (::g->itemOn + 1 > ::g->currentMenu->numitems - 1) {
::g->itemOn = 0;
} else

if (::g->currentMenu->menuitems == pageDef.menuitems && ::g->itemOn + 1 >= (pageIndex == 0 ? 11 : 12)) {
if (::g->currentMenu->menuitems == pageDef.menuitems && ::g->itemOn + 1 >= (pageIndex == 0 ? 11 : 12)) {
::g->itemOn = 0;
}
else if (::g->currentMenu->menuitems == pageDef.menuitems && pageIndex == numPages && ::g->itemOn + 1 >= activePageItems) {
if (numPages == 0) {
::g->itemOn = 0;
}
else if (::g->currentMenu->menuitems == pageDef.menuitems && pageIndex == numPages && ::g->itemOn + 1 >= activePageItems) {
if (numPages == 0) {
::g->itemOn = 0;
}
else {
::g->itemOn += (11 - ::g->itemOn);
}
}
else if ((::g->currentMenu == &::g->VideoDef && (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) && ::g->itemOn == vsync) ) {
::g->itemOn = vsync + 2;
}
else if (::g->currentMenu == &::g->VideoDef && stereoRender_enable.GetInteger() == STEREO3D_VR && ::g->itemOn == light) {
::g->itemOn = vsync;
}
else if (::g->currentMenu == &::g->GameDef && !cl_freelook.GetBool() && ::g->itemOn == look) {
::g->itemOn = jump;
else {
::g->itemOn += (11 - ::g->itemOn);
}
}
else if ((::g->currentMenu == &::g->VideoDef && (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) && ::g->itemOn == vsync) ) {
::g->itemOn = vsync + 2;
}
else if (::g->currentMenu == &::g->GameDef && !cl_freelook.GetBool() && ::g->itemOn == look) {
::g->itemOn = jump;
}
else ::g->itemOn++;
S_StartSound(NULL,sfx_pstop);
} while(::g->currentMenu->menuitems[::g->itemOn].status==-1);
Expand All @@ -2976,8 +2966,6 @@ qboolean M_Responder (event_t* ev)
}
else if ((::g->currentMenu == &::g->VideoDef && (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) && ::g->itemOn == framerate))
::g->itemOn = framerate - 2;
else if (::g->currentMenu == &::g->VideoDef && stereoRender_enable.GetInteger() == STEREO3D_VR && ::g->itemOn == vsync)
::g->itemOn = light;
else if (::g->currentMenu == &::g->GameDef && !cl_freelook.GetBool() && ::g->itemOn == jump)
::g->itemOn = look;
else if (::g->currentMenu->menuitems == pageDef.menuitems && pageIndex == numPages && ::g->itemOn == 11) {
Expand Down Expand Up @@ -3166,12 +3154,6 @@ void M_Drawer (void)
if (::g->currentMenu == &::g->VideoDef && (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) && i == refresh) {
continue;
}
if (::g->currentMenu == &::g->VideoDef && (stereoRender_enable.GetInteger() == STEREO3D_VR) && i == resolution) {
continue;
}
if (::g->currentMenu == &::g->VideoDef && (stereoRender_enable.GetInteger() == STEREO3D_VR) && i == endgame) {
continue;
}
if (::g->currentMenu == &::g->GameDef && !cl_freelook.GetBool() && i == aim) {
continue;
}
Expand All @@ -3192,17 +3174,9 @@ void M_Drawer (void)
if (::g->currentMenu == &::g->OptionsDef && ::g->itemOn > messages) {
lineoffs += (optoffs*LINEHEIGHT);
}
if ((::g->currentMenu == &::g->VideoDef && !cl_engineHz_interp.GetBool() && ::g->itemOn > refresh) && stereoRender_enable.GetInteger() != STEREO3D_VR) {
if ((::g->currentMenu == &::g->VideoDef && (!cl_engineHz_interp.GetBool() || stereoRender_enable.GetInteger() == STEREO3D_VR) && ::g->itemOn > refresh)) {
lineoffs = (::g->itemOn - 1) * LINEHEIGHT;
}
if (::g->currentMenu == &::g->VideoDef && stereoRender_enable.GetInteger() == STEREO3D_VR) {
if (::g->itemOn == vsync) {
lineoffs = (::g->itemOn - 2) * LINEHEIGHT;
}
if (::g->itemOn > vsync) {
lineoffs = (::g->itemOn - 3) * LINEHEIGHT;
}
}
if (::g->currentMenu == &::g->GameDef && !cl_freelook.GetBool() && ::g->itemOn > aim) {
lineoffs = (::g->itemOn - 1) * LINEHEIGHT;
}
Expand Down Expand Up @@ -3257,9 +3231,6 @@ void M_ClearMenus (void)
void M_SetupNextMenu(menu_t *menudef)
{
::g->currentMenu = menudef;
if (stereoRender_enable.GetInteger() == STEREO3D_VR && ::g->currentMenu == &::g->VideoDef && !::g->currentMenu->lastOn) {
::g->currentMenu->lastOn = vsync;
}
::g->itemOn = ::g->currentMenu->lastOn;
}

Expand Down
33 changes: 16 additions & 17 deletions neo/d3xp/menus/MenuScreen_Shell_SystemOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,24 @@ void idMenuScreen_Shell_SystemOptions::Initialize( idMenuHandler* data )
AddChild( options );
AddChild( btnBack );
idMenuWidget_ControlButton* control;
if (renderSystem->GetStereo3DMode() != STEREO3D_VR) {
control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TEXT);
control->SetLabel("#str_02154");
control->SetDataSource(&systemData, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN);
control->SetupEvents(DEFAULT_REPEAT_TIME, options->GetChildren().Num());
control->AddEventAction(WIDGET_EVENT_PRESS).Set(WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN);
options->AddChild(control);
control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TEXT);
control->SetLabel("#str_02154");
control->SetDataSource(&systemData, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN);
control->SetupEvents(DEFAULT_REPEAT_TIME, options->GetChildren().Num());
control->AddEventAction(WIDGET_EVENT_PRESS).Set(WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN);
options->AddChild(control);

//GK: Begin
//GK: Begin

control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TEXT);
control->SetLabel("#str_fullscreen");
control->SetDataSource(&systemData, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN_MODE);
control->SetupEvents(DEFAULT_REPEAT_TIME, options->GetChildren().Num());
control->AddEventAction(WIDGET_EVENT_PRESS).Set(WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN_MODE);
options->AddChild(control);
}
control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TEXT);
control->SetLabel("#str_fullscreen");
control->SetDataSource(&systemData, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN_MODE);
control->SetupEvents(DEFAULT_REPEAT_TIME, options->GetChildren().Num());
control->AddEventAction(WIDGET_EVENT_PRESS).Set(WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_FULLSCREEN_MODE);
options->AddChild(control);

control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TEXT);
control->SetLabel("#str_swf_aspect"); //Aspect Ratio
Expand Down
3 changes: 0 additions & 3 deletions neo/renderer/RenderSystem_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,9 +2386,6 @@ void idRenderSystemLocal::Init()
#ifdef USE_OPENXR
if (((stereo3DMode_t)stereoRender_enable.GetInteger()) == STEREO3D_VR && !xrSystem->IsInitialized()) {
if (xrSystem->InitXR()) {
r_fullscreen.SetInteger(0);
r_windowWidth.SetInteger(1920);
r_windowHeight.SetInteger(1080);
cl_HUD.SetBool(true);
r_useVirtualScreenResolution.SetBool(true);
r_useSRGB.SetBool(false);
Expand Down

0 comments on commit 2f61fb0

Please sign in to comment.