cleaning up case of enum names and aligning the PerformancePreset with the PlatformTier

This commit is contained in:
Sam Gateau 2019-05-31 00:00:44 -07:00
parent 916ff31cf6
commit 4e2480d032
5 changed files with 20 additions and 14 deletions

View file

@ -28,7 +28,7 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::
}
QStringList PerformanceScriptingInterface::getPerformancePresetNames() const {
static const QStringList performancePresetNames = { "Unknown", "Low", "Mid", "High" };
static const QStringList performancePresetNames = { "UNKNOWN", "LOW", "MID", "HIGH" };
return performancePresetNames;
}
@ -41,7 +41,7 @@ PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface:
}
QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const {
static const QStringList refreshRateProfileNames = { "Eco", "Interactive", "Realtime" };
static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" };
return refreshRateProfileNames;
}

View file

@ -24,10 +24,10 @@ public:
// PerformanceManager PerformancePreset tri state level enums
enum PerformancePreset {
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
LOW = PerformanceManager::PerformancePreset::LOW,
MID = PerformanceManager::PerformancePreset::MID,
HIGH = PerformanceManager::PerformancePreset::HIGH,
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
};
Q_ENUM(PerformancePreset)

View file

@ -186,8 +186,8 @@ public slots:
/**jsdoc
* Get the Platform TIer profiled on startup of the Computer
* Platform Tier is an ineger/enum value:
* LOW = 0, MID = 1, HIGH = 2
* Platform Tier is an integer/enum value:
* UNKNOWN = 0, LOW = 1, MID = 2, HIGH = 3
* @function PlatformInfo.getTierProfiled
* @returns {number} The Platform Tier profiled on startup.
*/
@ -195,8 +195,8 @@ public slots:
/**jsdoc
* Get the Platform Tier possible Names as an array of strings
* Platform Tier is an ineger/enum value:
* LOW = 0, MID = 1, HIGH = 2
* Platform Tier names are:
* [ "UNKNOWN", "LOW", "MID", "HIGH" ]
* @function PlatformInfo.getPlatformTierNames
* @returns {string} The array of names matching the number returned from PlatformInfo.getTierProfiled
*/

View file

@ -10,8 +10,6 @@
#include "LightingModel.h"
#include "AntialiasingEffect.h"
const QString DEFERRED = "deferred";
const QString FORWARD = "forward";
RenderScriptingInterface* RenderScriptingInterface::getInstance() {
static RenderScriptingInterface sharedInstance;
@ -45,11 +43,12 @@ void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderM
_renderMethodSetting.set(newMethod);
config->setBranch(newMethod);
emit config->dirtyEnabled();
emit settingsChanged();
}
}
QStringList RenderScriptingInterface::getRenderMethodNames() const {
static const QStringList refrenderMethodNames = { "Deferred", "Forward" };
static const QStringList refrenderMethodNames = { "DEFERRED", "FORWARD" };
return refrenderMethodNames;
}
@ -72,6 +71,7 @@ void RenderScriptingInterface::setShadowsEnabled(bool enabled) {
Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled);
_shadowsEnabledSetting.set(enabled);
lightingModelConfig->setShadow(enabled);
emit settingsChanged();
}
}
@ -94,6 +94,7 @@ void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) {
Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled);
_ambientOcclusionEnabledSetting.set(enabled);
lightingModelConfig->setAmbientOcclusion(enabled);
emit settingsChanged();
}
}
@ -123,5 +124,7 @@ void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) {
mainViewJitterCamConfig->none();
mainViewAntialiasingConfig->setDebugFXAA(true);
}
emit settingsChanged();
}
}

View file

@ -25,10 +25,10 @@
*/
class RenderScriptingInterface : public QObject {
Q_OBJECT
Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod)
Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled)
Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled)
Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled)
Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged)
Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged)
Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged)
Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged)
public:
RenderScriptingInterface();
@ -132,6 +132,9 @@ public slots:
*/
// void setViewportResolutionScale(float resolutionScale);
signals:
void settingsChanged();
private:
Setting::Handle<int> _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
Setting::Handle<bool> _shadowsEnabledSetting { "shadowsEnabled", true };