Merge pull request #706 from overte-org/fix/graphics_settings

Fix for custom graphics setting
This commit is contained in:
ksuprynowicz 2023-11-06 00:17:11 +01:00 committed by GitHub
commit 3abd98b642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

View file

@ -126,9 +126,9 @@ Flickable {
fontSize: 16 fontSize: 16
leftPadding: 0 leftPadding: 0
text: "Custom" text: "Custom"
checked: Performance.getPerformancePreset() === PerformanceEnums.UNKNOWN checked: Performance.getPerformancePreset() === PerformanceEnums.CUSTOM
onClicked: { onClicked: {
Performance.setPerformancePreset(PerformanceEnums.UNKNOWN); Performance.setPerformancePreset(PerformanceEnums.CUSTOM);
} }
} }
} }

View file

@ -30,7 +30,7 @@ PerformanceManager::PerformanceManager()
void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTier) { void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTier) {
if (evaluatePlatformTier || (getPerformancePreset() == UNKNOWN)) { if (evaluatePlatformTier || (getPerformancePreset() == UNKNOWN)) {
// If evaluatePlatformTier, evalute the Platform Tier and assign the matching Performance profile by default. // If evaluatePlatformTier, evaluate the Platform Tier and assign the matching Performance profile by default.
// A bunch of Performance, Simulation and Render settings will be set to a matching default value from this // A bunch of Performance, Simulation and Render settings will be set to a matching default value from this
// Here is the mapping between platformTier and performance profile // Here is the mapping between platformTier and performance profile
@ -39,7 +39,8 @@ void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTie
PerformanceManager::PerformancePreset::LOW_POWER, // platform::Profiler::LOW_POWER PerformanceManager::PerformancePreset::LOW_POWER, // platform::Profiler::LOW_POWER
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH PerformanceManager::PerformancePreset::HIGH, // platform::Profiler::HIGH
PerformanceManager::PerformancePreset::CUSTOM // platform::Profiler::CUSTOM
} }; } };
// What is our profile? // What is our profile?
@ -134,6 +135,8 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW); DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
break; break;
case PerformancePreset::CUSTOM:
// Intentionally unbroken.
case PerformancePreset::UNKNOWN: case PerformancePreset::UNKNOWN:
// Intentionally unbroken. // Intentionally unbroken.
default: default:

View file

@ -25,9 +25,10 @@ public:
LOW, LOW,
MID, MID,
HIGH, HIGH,
CUSTOM,
PROFILE_COUNT PROFILE_COUNT
}; };
static bool isValidPerformancePreset(int value) { return (value >= PerformancePreset::UNKNOWN && value <= PerformancePreset::HIGH); } static bool isValidPerformancePreset(int value) { return (value >= PerformancePreset::UNKNOWN && value <= PerformancePreset::CUSTOM); }
PerformanceManager(); PerformanceManager();
~PerformanceManager() = default; ~PerformanceManager() = default;

View file

@ -63,6 +63,7 @@ public:
LOW = PerformanceManager::PerformancePreset::LOW, LOW = PerformanceManager::PerformancePreset::LOW,
MID = PerformanceManager::PerformancePreset::MID, MID = PerformanceManager::PerformancePreset::MID,
HIGH = PerformanceManager::PerformancePreset::HIGH, HIGH = PerformanceManager::PerformancePreset::HIGH,
CUSTOM = PerformanceManager::PerformancePreset::CUSTOM
}; };
Q_ENUM(PerformancePreset) Q_ENUM(PerformancePreset)

View file

@ -23,6 +23,7 @@ public:
LOW, LOW,
MID, MID,
HIGH, HIGH,
CUSTOM, // Never used, added for consistency with performance presets
NumTiers, // not a valid Tier NumTiers, // not a valid Tier
}; };