1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 08:45:33 +00:00

Use uniform indent and apply openmw naming policy

This commit is contained in:
elsid 2022-07-08 17:11:22 +02:00
parent 98f839982e
commit 4211cf1c24
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
2 changed files with 14 additions and 14 deletions

View file

@ -756,16 +756,16 @@ namespace SceneUtil
mTemplate->configureLayout(offsets[0], offsets[1], offsets[2], totalBlockSize, stride);
}
const std::unordered_map<std::string, LightingMethod> LightManager::mLightingMethodSettingMap = {
{"legacy", LightingMethod::FFP}
,{"shaders compatibility", LightingMethod::PerObjectUniform}
,{"shaders", LightingMethod::SingleUBO}
const std::unordered_map<std::string, LightingMethod> LightManager::sLightingMethodSettingMap = {
{"legacy", LightingMethod::FFP},
{"shaders compatibility", LightingMethod::PerObjectUniform},
{"shaders", LightingMethod::SingleUBO},
};
LightingMethod LightManager::getLightingMethodFromString(const std::string& value)
{
auto it = LightManager::mLightingMethodSettingMap.find(value);
if (it != LightManager::mLightingMethodSettingMap.end())
auto it = LightManager::sLightingMethodSettingMap.find(value);
if (it != LightManager::sLightingMethodSettingMap.end())
return it->second;
constexpr const char* fallback = "shaders compatibility";
@ -775,7 +775,7 @@ namespace SceneUtil
std::string LightManager::getLightingMethodString(LightingMethod method)
{
for (const auto& p : LightManager::mLightingMethodSettingMap)
for (const auto& p : LightManager::sLightingMethodSettingMap)
if (p.second == method)
return p.first;
return "";
@ -801,7 +801,7 @@ namespace SceneUtil
if (ffp)
{
initFFP(mFFPMaxLights);
initFFP(sFFPMaxLights);
return;
}
@ -819,7 +819,7 @@ namespace SceneUtil
hasLoggedWarnings = true;
}
int targetLights = std::clamp(Settings::Manager::getInt("max lights", "Shaders"), mMaxLightsLowerLimit, mMaxLightsUpperLimit);
int targetLights = std::clamp(Settings::Manager::getInt("max lights", "Shaders"), sMaxLightsLowerLimit, sMaxLightsUpperLimit);
if (!supportsUBO || !supportsGPU4 || lightingMethod == LightingMethod::PerObjectUniform)
initPerObjectUniform(targetLights);
@ -902,7 +902,7 @@ namespace SceneUtil
if (usingFFP())
return;
setMaxLights(std::clamp(Settings::Manager::getInt("max lights", "Shaders"), mMaxLightsLowerLimit, mMaxLightsUpperLimit));
setMaxLights(std::clamp(Settings::Manager::getInt("max lights", "Shaders"), sMaxLightsLowerLimit, sMaxLightsUpperLimit));
if (getLightingMethod() == LightingMethod::PerObjectUniform)
{

View file

@ -360,11 +360,11 @@ namespace SceneUtil
SupportedMethods mSupported;
static constexpr auto mMaxLightsLowerLimit = 2;
static constexpr auto mMaxLightsUpperLimit = 64;
static constexpr auto mFFPMaxLights = 8;
static constexpr auto sMaxLightsLowerLimit = 2;
static constexpr auto sMaxLightsUpperLimit = 64;
static constexpr auto sFFPMaxLights = 8;
static const std::unordered_map<std::string, LightingMethod> mLightingMethodSettingMap;
static const std::unordered_map<std::string, LightingMethod> sLightingMethodSettingMap;
std::shared_ptr<PPLightBuffer> mPPLightBuffer;
};