Don't let VR options of other VR builds to break rendering of the non-VR master

This commit is contained in:
Robert Beckebans 2024-04-10 10:48:26 +02:00
parent 18755609de
commit d716661d90
7 changed files with 46 additions and 3 deletions

View file

@ -42,7 +42,9 @@ enum shellAreas_t
SHELL_AREA_SYSTEM_OPTIONS,
SHELL_AREA_MULTIPLAYER,
SHELL_AREA_GAME_LOBBY,
#if VR_OPTIONS
SHELL_AREA_STEREOSCOPICS,
#endif
SHELL_AREA_PARTY_LOBBY,
SHELL_AREA_SETTINGS,
SHELL_AREA_AUDIO,

View file

@ -485,7 +485,9 @@ void idMenuHandler_Shell::Initialize( const char* swfFile, idSoundWorld* sw )
BIND_SHELL_SCREEN( SHELL_AREA_SYSTEM_OPTIONS, idMenuScreen_Shell_SystemOptions, this );
BIND_SHELL_SCREEN( SHELL_AREA_GAME_OPTIONS, idMenuScreen_Shell_GameOptions, this );
BIND_SHELL_SCREEN( SHELL_AREA_SAVE, idMenuScreen_Shell_Save, this );
#if VR_OPTIONS
BIND_SHELL_SCREEN( SHELL_AREA_STEREOSCOPICS, idMenuScreen_Shell_Stereoscopics, this );
#endif
BIND_SHELL_SCREEN( SHELL_AREA_CONTROLS, idMenuScreen_Shell_Controls, this );
BIND_SHELL_SCREEN( SHELL_AREA_KEYBOARD, idMenuScreen_Shell_Bindings, this );
BIND_SHELL_SCREEN( SHELL_AREA_RESOLUTION, idMenuScreen_Shell_Resolution, this );
@ -509,7 +511,9 @@ void idMenuHandler_Shell::Initialize( const char* swfFile, idSoundWorld* sw )
BIND_SHELL_SCREEN( SHELL_AREA_GAME_OPTIONS, idMenuScreen_Shell_GameOptions, this );
BIND_SHELL_SCREEN( SHELL_AREA_PARTY_LOBBY, idMenuScreen_Shell_PartyLobby, this );
BIND_SHELL_SCREEN( SHELL_AREA_GAME_LOBBY, idMenuScreen_Shell_GameLobby, this );
#if VR_OPTIONS
BIND_SHELL_SCREEN( SHELL_AREA_STEREOSCOPICS, idMenuScreen_Shell_Stereoscopics, this );
#endif
BIND_SHELL_SCREEN( SHELL_AREA_DIFFICULTY, idMenuScreen_Shell_Difficulty, this );
BIND_SHELL_SCREEN( SHELL_AREA_CONTROLS, idMenuScreen_Shell_Controls, this );
BIND_SHELL_SCREEN( SHELL_AREA_KEYBOARD, idMenuScreen_Shell_Bindings, this );
@ -1036,8 +1040,14 @@ bool idMenuHandler_Shell::HandleAction( idWidgetAction& action, const idWidgetEv
session->Cancel();
}
if( cmd != SHELL_CMD_QUIT && ( nextScreen == SHELL_AREA_STEREOSCOPICS || nextScreen == SHELL_AREA_SYSTEM_OPTIONS || nextScreen == SHELL_AREA_GAME_OPTIONS ||
nextScreen == SHELL_AREA_GAMEPAD || nextScreen == SHELL_AREA_MATCH_SETTINGS ) )
if( cmd != SHELL_CMD_QUIT && (
#if VR_OPTIONS
nextScreen == SHELL_AREA_STEREOSCOPICS ||
#endif
nextScreen == SHELL_AREA_SYSTEM_OPTIONS ||
nextScreen == SHELL_AREA_GAME_OPTIONS ||
nextScreen == SHELL_AREA_GAMEPAD ||
nextScreen == SHELL_AREA_MATCH_SETTINGS ) )
{
cvarSystem->SetModifiedFlags( CVAR_ARCHIVE );
@ -1272,7 +1282,15 @@ void idMenuHandler_Shell::UpdateBGState()
{
if( nextScreen != SHELL_AREA_PLAYSTATION && nextScreen != SHELL_AREA_SETTINGS && nextScreen != SHELL_AREA_CAMPAIGN && nextScreen != SHELL_AREA_DEV )
{
if( nextScreen != SHELL_AREA_RESOLUTION && nextScreen != SHELL_AREA_GAMEPAD && nextScreen != SHELL_AREA_DIFFICULTY && nextScreen != SHELL_AREA_SYSTEM_OPTIONS && nextScreen != SHELL_AREA_GAME_OPTIONS && nextScreen != SHELL_AREA_NEW_GAME && nextScreen != SHELL_AREA_STEREOSCOPICS &&
if( nextScreen != SHELL_AREA_RESOLUTION &&
nextScreen != SHELL_AREA_GAMEPAD &&
nextScreen != SHELL_AREA_DIFFICULTY &&
nextScreen != SHELL_AREA_SYSTEM_OPTIONS &&
nextScreen != SHELL_AREA_GAME_OPTIONS &&
nextScreen != SHELL_AREA_NEW_GAME &&
#if VR_OPTIONS
nextScreen != SHELL_AREA_STEREOSCOPICS &&
#endif
nextScreen != SHELL_AREA_CONTROLS )
{
ShowSmallFrame( false );

View file

@ -1437,6 +1437,8 @@ private:
};
#if VR_OPTIONS
//*
//================================================
//idMenuScreen_Shell_Stereoscopics
@ -1505,6 +1507,8 @@ private:
const idMaterial* rightEyeMat;
};
#endif
//*
//================================================
//idMenuScreen_Shell_PartyLobby

View file

@ -36,7 +36,9 @@ enum settingMenuCmds_t
SETTING_CMD_CONTROLS,
SETTING_CMD_GAMEPLAY,
SETTING_CMD_SYSTEM,
#if VR_OPTIONS
SETTING_CMD_3D,
#endif
};
/*
@ -252,11 +254,13 @@ bool idMenuScreen_Shell_Settings::HandleAction( idWidgetAction& action, const id
menuData->SetNextScreen( SHELL_AREA_SYSTEM_OPTIONS, MENU_TRANSITION_SIMPLE );
break;
}
#if VR_OPTIONS
case SETTING_CMD_3D:
{
menuData->SetNextScreen( SHELL_AREA_STEREOSCOPICS, MENU_TRANSITION_SIMPLE );
break;
}
#endif
}
if( options != NULL )

View file

@ -29,6 +29,8 @@ If you have questions concerning this license or the applicable additional terms
#pragma hdrstop
#include "../Game_local.h"
#if VR_OPTIONS
const static int NUM_SYSTEM_OPTIONS_OPTIONS = 4;
// TRC requires a maximum interoccular distance of 6.5cm even though human adults can easily have an interoccular distance of over 7.5cm
@ -475,3 +477,5 @@ bool idMenuScreen_Shell_Stereoscopics::idMenuDataSource_StereoSettings::IsRestar
}
return false;
}
#endif

View file

@ -79,3 +79,5 @@ If you have questions concerning this license or the applicable additional terms
// raynorpat: GOG.com Galaxy Launcher Game ID for figuring out Steam base path
#define GOGPATH_ID "1733124578"
#define VR_OPTIONS 0

View file

@ -2504,7 +2504,11 @@ idRenderSystemLocal::IsStereoScopicRenderingSupported
*/
bool idRenderSystemLocal::IsStereoScopicRenderingSupported() const
{
#if VR_OPTIONS
return true;
#else
return false;
#endif
}
/*
@ -2541,7 +2545,12 @@ idRenderSystemLocal::GetStereoScopicRenderingMode
*/
stereo3DMode_t idRenderSystemLocal::GetStereoScopicRenderingMode() const
{
// RB: only support in VR builds
#if VR_OPTIONS
return ( !IsStereoScopicRenderingSupported() ) ? STEREO3D_OFF : ( stereo3DMode_t )stereoRender_enable.GetInteger();
#else
return STEREO3D_OFF;
#endif
}
/*