Skip to content

Commit

Permalink
[Immersive mode] add a resolution offset to avoid users modifying the…
Browse files Browse the repository at this point in the history
…ir default settings
  • Loading branch information
amwatson committed Jan 27, 2024
1 parent 6da5e59 commit 636f364
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/android/app/src/main/jni/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ void Config::ReadValues() {
if (Settings::values.vr_use_immersive_mode) {
LOG_INFO(Config, "VR immersive mode enabled");

// Use a min setting of 3x to avoid extremely low resolutions
VRSettings::values.resolution_factor = std::max(3, static_cast<int>(VRSettings::values.resolution_factor));

// no point rendering passthrough in immersive mode
VRSettings::values.vr_environment =
static_cast<uint32_t>(VRSettings::VREnvironmentType::VOID);
Expand Down
7 changes: 5 additions & 2 deletions src/android/app/src/main/jni/vr/vr_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ class VRApp {
const uint32_t defaultResolutionFactor =
GetDefaultGameResolutionFactorForHmd(VRSettings::values.hmd_type);
const uint32_t resolutionFactorFromPreferences = VRSettings::values.resolution_factor;
// add a couple factors to resolution with immersive mode so users
// aren't resetting their default settings to get higher res. min
// resolution factor for immersive is 3x.
const uint32_t immersiveModeOffset = (VRSettings::values.vr_immersive_mode > 0) ? 2 : 0;
const uint32_t resolutionFactor = (resolutionFactorFromPreferences > 0
? resolutionFactorFromPreferences
: defaultResolutionFactor);
: defaultResolutionFactor) + immersiveModeOffset;

if (resolutionFactor != defaultResolutionFactor) {
ALOGI("Using resolution factor of {}x instead of HMD default {}x", resolutionFactor,
Expand Down Expand Up @@ -905,4 +909,3 @@ Java_org_citra_citra_1emu_vr_VRUtils_getDefaultResolutionFactor(JNIEnv* env, jcl
const VRSettings::HMDType hmdType = VRSettings::HmdTypeFromStr(VRSettings::GetHMDTypeStr());
return GetDefaultGameResolutionFactorForHmd(hmdType);
}

0 comments on commit 636f364

Please sign in to comment.