1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 11:09:43 +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); mTemplate->configureLayout(offsets[0], offsets[1], offsets[2], totalBlockSize, stride);
} }
const std::unordered_map<std::string, LightingMethod> LightManager::mLightingMethodSettingMap = { const std::unordered_map<std::string, LightingMethod> LightManager::sLightingMethodSettingMap = {
{"legacy", LightingMethod::FFP} {"legacy", LightingMethod::FFP},
,{"shaders compatibility", LightingMethod::PerObjectUniform} {"shaders compatibility", LightingMethod::PerObjectUniform},
,{"shaders", LightingMethod::SingleUBO} {"shaders", LightingMethod::SingleUBO},
}; };
LightingMethod LightManager::getLightingMethodFromString(const std::string& value) LightingMethod LightManager::getLightingMethodFromString(const std::string& value)
{ {
auto it = LightManager::mLightingMethodSettingMap.find(value); auto it = LightManager::sLightingMethodSettingMap.find(value);
if (it != LightManager::mLightingMethodSettingMap.end()) if (it != LightManager::sLightingMethodSettingMap.end())
return it->second; return it->second;
constexpr const char* fallback = "shaders compatibility"; constexpr const char* fallback = "shaders compatibility";
@ -775,7 +775,7 @@ namespace SceneUtil
std::string LightManager::getLightingMethodString(LightingMethod method) std::string LightManager::getLightingMethodString(LightingMethod method)
{ {
for (const auto& p : LightManager::mLightingMethodSettingMap) for (const auto& p : LightManager::sLightingMethodSettingMap)
if (p.second == method) if (p.second == method)
return p.first; return p.first;
return ""; return "";
@ -801,7 +801,7 @@ namespace SceneUtil
if (ffp) if (ffp)
{ {
initFFP(mFFPMaxLights); initFFP(sFFPMaxLights);
return; return;
} }
@ -819,7 +819,7 @@ namespace SceneUtil
hasLoggedWarnings = true; 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) if (!supportsUBO || !supportsGPU4 || lightingMethod == LightingMethod::PerObjectUniform)
initPerObjectUniform(targetLights); initPerObjectUniform(targetLights);
@ -902,7 +902,7 @@ namespace SceneUtil
if (usingFFP()) if (usingFFP())
return; 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) if (getLightingMethod() == LightingMethod::PerObjectUniform)
{ {

View file

@ -360,11 +360,11 @@ namespace SceneUtil
SupportedMethods mSupported; SupportedMethods mSupported;
static constexpr auto mMaxLightsLowerLimit = 2; static constexpr auto sMaxLightsLowerLimit = 2;
static constexpr auto mMaxLightsUpperLimit = 64; static constexpr auto sMaxLightsUpperLimit = 64;
static constexpr auto mFFPMaxLights = 8; 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; std::shared_ptr<PPLightBuffer> mPPLightBuffer;
}; };