1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 08:15:35 +00:00

Remove redundant variables from RenderingManager

This commit is contained in:
Andrei Kortunov 2020-06-06 14:10:24 +04:00
parent 3b1c717ab9
commit 6de97e6bc2
3 changed files with 5 additions and 10 deletions

View file

@ -213,10 +213,8 @@ namespace MWRender
, mUnderwaterIndoorFog(Fallback::Map::getFloat("Water_UnderwaterIndoorFog")) , mUnderwaterIndoorFog(Fallback::Map::getFloat("Water_UnderwaterIndoorFog"))
, mNightEyeFactor(0.f) , mNightEyeFactor(0.f)
, mDistantFog(false) , mDistantFog(false)
, mDistantTerrain(false)
, mFieldOfViewOverridden(false) , mFieldOfViewOverridden(false)
, mFieldOfViewOverride(0.f) , mFieldOfViewOverride(0.f)
, mBorders(false)
{ {
resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem); resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem);
resourceSystem->getSceneManager()->setShaderPath(resourcePath + "/shaders"); resourceSystem->getSceneManager()->setShaderPath(resourcePath + "/shaders");
@ -290,9 +288,7 @@ namespace MWRender
DLUnderwaterFogEnd = Settings::Manager::getFloat("distant underwater fog end", "Fog"); DLUnderwaterFogEnd = Settings::Manager::getFloat("distant underwater fog end", "Fog");
DLInteriorFogStart = Settings::Manager::getFloat("distant interior fog start", "Fog"); DLInteriorFogStart = Settings::Manager::getFloat("distant interior fog start", "Fog");
DLInteriorFogEnd = Settings::Manager::getFloat("distant interior fog end", "Fog"); DLInteriorFogEnd = Settings::Manager::getFloat("distant interior fog end", "Fog");
mDistantFog = Settings::Manager::getBool("use distant fog", "Fog"); mDistantFog = Settings::Manager::getBool("use distant fog", "Fog");
mDistantTerrain = Settings::Manager::getBool("distant terrain", "Terrain");
const std::string normalMapPattern = Settings::Manager::getString("normal map pattern", "Shaders"); const std::string normalMapPattern = Settings::Manager::getString("normal map pattern", "Shaders");
const std::string heightMapPattern = Settings::Manager::getString("normal height map pattern", "Shaders"); const std::string heightMapPattern = Settings::Manager::getString("normal height map pattern", "Shaders");
@ -302,7 +298,7 @@ namespace MWRender
mTerrainStorage = new TerrainStorage(mResourceSystem, normalMapPattern, heightMapPattern, useTerrainNormalMaps, specularMapPattern, useTerrainSpecularMaps); mTerrainStorage = new TerrainStorage(mResourceSystem, normalMapPattern, heightMapPattern, useTerrainNormalMaps, specularMapPattern, useTerrainSpecularMaps);
if (mDistantTerrain) if (Settings::Manager::getBool("distant terrain", "Terrain"))
{ {
const int compMapResolution = Settings::Manager::getInt("composite map resolution", "Terrain"); const int compMapResolution = Settings::Manager::getInt("composite map resolution", "Terrain");
int compMapPower = Settings::Manager::getInt("composite map level", "Terrain"); int compMapPower = Settings::Manager::getInt("composite map level", "Terrain");
@ -558,9 +554,9 @@ namespace MWRender
bool RenderingManager::toggleBorders() bool RenderingManager::toggleBorders()
{ {
mBorders = !mBorders; bool borders = !mTerrain->getBordersVisible();
mTerrain->setBordersVisible(mBorders); mTerrain->setBordersVisible(borders);
return mBorders; return borders;
} }
bool RenderingManager::toggleRenderMode(RenderMode mode) bool RenderingManager::toggleRenderMode(RenderMode mode)

View file

@ -299,12 +299,10 @@ namespace MWRender
float mNearClip; float mNearClip;
float mViewDistance; float mViewDistance;
bool mDistantFog : 1; bool mDistantFog : 1;
bool mDistantTerrain : 1;
bool mFieldOfViewOverridden : 1; bool mFieldOfViewOverridden : 1;
float mFieldOfViewOverride; float mFieldOfViewOverride;
float mFieldOfView; float mFieldOfView;
float mFirstPersonFieldOfView; float mFirstPersonFieldOfView;
bool mBorders;
void operator = (const RenderingManager&); void operator = (const RenderingManager&);
RenderingManager(const RenderingManager&); RenderingManager(const RenderingManager&);

View file

@ -139,6 +139,7 @@ namespace Terrain
virtual void enable(bool enabled) {} virtual void enable(bool enabled) {}
virtual void setBordersVisible(bool visible); virtual void setBordersVisible(bool visible);
virtual bool getBordersVisible() { return mBorderVisible; }
/// Create a View to use with preload feature. The caller is responsible for deleting the view. /// Create a View to use with preload feature. The caller is responsible for deleting the view.
/// @note Thread safe. /// @note Thread safe.