Remove dead code

pull/3236/head
Andrei Kortunov 2 months ago
parent bac0018a09
commit 192807609d

@ -686,11 +686,6 @@ namespace MWRender
updateAmbient(); updateAmbient();
} }
void RenderingManager::skySetDate(int day, int month)
{
mSky->setDate(day, month);
}
int RenderingManager::skyGetMasserPhase() const int RenderingManager::skyGetMasserPhase() const
{ {
return mSky->getMasserPhase(); return mSky->getMasserPhase();

@ -135,7 +135,6 @@ namespace MWRender
void setAmbientColour(const osg::Vec4f& colour); void setAmbientColour(const osg::Vec4f& colour);
void skySetDate(int day, int month);
int skyGetMasserPhase() const; int skyGetMasserPhase() const;
int skyGetSecundaPhase() const; int skyGetSecundaPhase() const;
void skySetMoonColour(bool red); void skySetMoonColour(bool red);

@ -238,11 +238,8 @@ namespace MWRender
, mAtmosphereNightRoll(0.f) , mAtmosphereNightRoll(0.f)
, mCreated(false) , mCreated(false)
, mIsStorm(false) , mIsStorm(false)
, mDay(0)
, mMonth(0)
, mTimescaleClouds(Fallback::Map::getBool("Weather_Timescale_Clouds")) , mTimescaleClouds(Fallback::Map::getBool("Weather_Timescale_Clouds"))
, mCloudAnimationTimer(0.f) , mCloudAnimationTimer(0.f)
, mRainTimer(0.f)
, mStormParticleDirection(MWWorld::Weather::defaultDirection()) , mStormParticleDirection(MWWorld::Weather::defaultDirection())
, mStormDirection(MWWorld::Weather::defaultDirection()) , mStormDirection(MWWorld::Weather::defaultDirection())
, mClouds() , mClouds()
@ -250,8 +247,6 @@ namespace MWRender
, mCloudBlendFactor(0.f) , mCloudBlendFactor(0.f)
, mCloudSpeed(0.f) , mCloudSpeed(0.f)
, mStarsOpacity(0.f) , mStarsOpacity(0.f)
, mRemainingTransitionTime(0.f)
, mRainEnabled(false)
, mRainSpeed(0.f) , mRainSpeed(0.f)
, mRainDiameter(0.f) , mRainDiameter(0.f)
, mRainMinHeight(0.f) , mRainMinHeight(0.f)
@ -263,7 +258,6 @@ namespace MWRender
, mWindSpeed(0.f) , mWindSpeed(0.f)
, mBaseWindSpeed(0.f) , mBaseWindSpeed(0.f)
, mEnabled(true) , mEnabled(true)
, mSunEnabled(true)
, mSunglareEnabled(true) , mSunglareEnabled(true)
, mPrecipitationAlpha(0.f) , mPrecipitationAlpha(0.f)
, mDirtyParticlesEffect(false) , mDirtyParticlesEffect(false)
@ -921,12 +915,6 @@ namespace MWRender
mSecunda->setState(state); mSecunda->setState(state);
} }
void SkyManager::setDate(int day, int month)
{
mDay = day;
mMonth = month;
}
void SkyManager::setGlareTimeOfDayFade(float val) void SkyManager::setGlareTimeOfDayFade(float val)
{ {
mSun->setGlareTimeOfDayFade(val); mSun->setGlareTimeOfDayFade(val);

@ -54,12 +54,6 @@ namespace MWRender
void setEnabled(bool enabled); void setEnabled(bool enabled);
void setHour(double hour);
///< will be called even when sky is disabled.
void setDate(int day, int month);
///< will be called even when sky is disabled.
int getMasserPhase() const; int getMasserPhase() const;
///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half, ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half,
/// 3 waxing or waning gibbous, 4 full moon /// 3 waxing or waning gibbous, 4 full moon
@ -85,8 +79,6 @@ namespace MWRender
float getPrecipitationAlpha() const; float getPrecipitationAlpha() const;
void setRainSpeed(float speed);
void setStormParticleDirection(const osg::Vec3f& direction); void setStormParticleDirection(const osg::Vec3f& direction);
void setSunDirection(const osg::Vec3f& direction); void setSunDirection(const osg::Vec3f& direction);
@ -165,14 +157,9 @@ namespace MWRender
bool mIsStorm; bool mIsStorm;
int mDay;
int mMonth;
bool mTimescaleClouds; bool mTimescaleClouds;
float mCloudAnimationTimer; float mCloudAnimationTimer;
float mRainTimer;
// particle system rotation is independent of cloud rotation internally // particle system rotation is independent of cloud rotation internally
osg::Vec3f mStormParticleDirection; osg::Vec3f mStormParticleDirection;
osg::Vec3f mStormDirection; osg::Vec3f mStormDirection;
@ -190,9 +177,6 @@ namespace MWRender
VFS::Path::Normalized mCurrentParticleEffect; VFS::Path::Normalized mCurrentParticleEffect;
float mRemainingTransitionTime;
bool mRainEnabled;
std::string mRainEffect; std::string mRainEffect;
float mRainSpeed; float mRainSpeed;
float mRainDiameter; float mRainDiameter;
@ -206,7 +190,6 @@ namespace MWRender
float mBaseWindSpeed; float mBaseWindSpeed;
bool mEnabled; bool mEnabled;
bool mSunEnabled;
bool mSunglareEnabled; bool mSunglareEnabled;
float mPrecipitationAlpha; float mPrecipitationAlpha;

@ -183,22 +183,19 @@ namespace MWWorld
return months[month]; return months[month];
} }
bool DateTimeManager::updateGlobalFloat(GlobalVariableName name, float value) void DateTimeManager::updateGlobalFloat(GlobalVariableName name, float value)
{ {
if (name == Globals::sGameHour) if (name == Globals::sGameHour)
{ {
setHour(value); setHour(value);
return true;
} }
else if (name == Globals::sDay) else if (name == Globals::sDay)
{ {
setDay(static_cast<int>(value)); setDay(static_cast<int>(value));
return true;
} }
else if (name == Globals::sMonth) else if (name == Globals::sMonth)
{ {
setMonth(static_cast<int>(value)); setMonth(static_cast<int>(value));
return true;
} }
else if (name == Globals::sYear) else if (name == Globals::sYear)
{ {
@ -212,26 +209,21 @@ namespace MWWorld
{ {
mDaysPassed = static_cast<int>(value); mDaysPassed = static_cast<int>(value);
} }
return false;
} }
bool DateTimeManager::updateGlobalInt(GlobalVariableName name, int value) void DateTimeManager::updateGlobalInt(GlobalVariableName name, int value)
{ {
if (name == Globals::sGameHour) if (name == Globals::sGameHour)
{ {
setHour(static_cast<float>(value)); setHour(static_cast<float>(value));
return true;
} }
else if (name == Globals::sDay) else if (name == Globals::sDay)
{ {
setDay(value); setDay(value);
return true;
} }
else if (name == Globals::sMonth) else if (name == Globals::sMonth)
{ {
setMonth(value); setMonth(value);
return true;
} }
else if (name == Globals::sYear) else if (name == Globals::sYear)
{ {
@ -245,8 +237,6 @@ namespace MWWorld
{ {
mDaysPassed = value; mDaysPassed = value;
} }
return false;
} }
void DateTimeManager::setSimulationTimeScale(float scale) void DateTimeManager::setSimulationTimeScale(float scale)

@ -53,8 +53,8 @@ namespace MWWorld
private: private:
friend class World; friend class World;
void setup(Globals& globalVariables); void setup(Globals& globalVariables);
bool updateGlobalInt(GlobalVariableName name, int value); void updateGlobalInt(GlobalVariableName name, int value);
bool updateGlobalFloat(GlobalVariableName name, float value); void updateGlobalFloat(GlobalVariableName name, float value);
void advanceTime(double hours, Globals& globalVariables); void advanceTime(double hours, Globals& globalVariables);
void setHour(double hour); void setHour(double hour);

@ -241,7 +241,6 @@ namespace MWWorld
{ {
if (mSky && (isCellExterior() || isCellQuasiExterior())) if (mSky && (isCellExterior() || isCellQuasiExterior()))
{ {
updateSkyDate();
mRendering->setSkyEnabled(true); mRendering->setSkyEnabled(true);
} }
else else
@ -635,19 +634,13 @@ namespace MWWorld
void World::setGlobalInt(GlobalVariableName name, int value) void World::setGlobalInt(GlobalVariableName name, int value)
{ {
bool dateUpdated = mTimeManager->updateGlobalInt(name, value); mTimeManager->updateGlobalInt(name, value);
if (dateUpdated)
updateSkyDate();
mGlobalVariables[name].setInteger(value); mGlobalVariables[name].setInteger(value);
} }
void World::setGlobalFloat(GlobalVariableName name, float value) void World::setGlobalFloat(GlobalVariableName name, float value)
{ {
bool dateUpdated = mTimeManager->updateGlobalFloat(name, value); mTimeManager->updateGlobalFloat(name, value);
if (dateUpdated)
updateSkyDate();
mGlobalVariables[name].setFloat(value); mGlobalVariables[name].setFloat(value);
} }
@ -921,7 +914,6 @@ namespace MWWorld
mWeatherManager->advanceTime(hours, incremental); mWeatherManager->advanceTime(hours, incremental);
mTimeManager->advanceTime(hours, mGlobalVariables); mTimeManager->advanceTime(hours, mGlobalVariables);
updateSkyDate();
if (!incremental) if (!incremental)
{ {
@ -3853,12 +3845,6 @@ namespace MWWorld
mWorldScene->reportStats(frameNumber, stats); mWorldScene->reportStats(frameNumber, stats);
} }
void World::updateSkyDate()
{
ESM::EpochTimeStamp currentDate = mTimeManager->getEpochTimeStamp();
mRendering->skySetDate(currentDate.mDay, currentDate.mMonth);
}
std::vector<MWWorld::Ptr> World::getAll(const ESM::RefId& id) std::vector<MWWorld::Ptr> World::getAll(const ESM::RefId& id)
{ {
return mWorldModel.getAll(id); return mWorldModel.getAll(id);

@ -172,8 +172,6 @@ namespace MWWorld
void fillGlobalVariables(); void fillGlobalVariables();
void updateSkyDate();
void loadContentFiles(const Files::Collections& fileCollections, const std::vector<std::string>& content, void loadContentFiles(const Files::Collections& fileCollections, const std::vector<std::string>& content,
ToUTF8::Utf8Encoder* encoder, Loading::Listener* listener); ToUTF8::Utf8Encoder* encoder, Loading::Listener* listener);

Loading…
Cancel
Save