fix toggleSky

actorid
scrawl 13 years ago
parent c1d39bb35f
commit 932983c2fa

@ -535,23 +535,25 @@ int SkyManager::getSecundaPhase() const
} }
void SkyManager::update(float duration) void SkyManager::update(float duration)
{ {
if (!mEnabled) return;
// UV Scroll the clouds // UV Scroll the clouds
mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1); mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1);
mMasser->setPhase( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) ); mMasser->setPhase( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) );
mSecunda->setPhase ( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) ); mSecunda->setPhase ( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) );
mSunGlare->setVisible(mGlareEnabled && mSunEnabled);
mSun->setVisible(mSunEnabled);
mMasser->setVisible(mMasserEnabled);
mSecunda->setVisible(mSecundaEnabled);
} }
void SkyManager::enable() void SkyManager::enable()
{ {
mRootNode->setVisible(true); mRootNode->setVisible(true);
mEnabled = true; mEnabled = true;
mSunGlare->setVisible(mGlareEnabled && mSunEnabled);
mSun->setVisible(mSunEnabled);
mMasser->setVisible(mMasserEnabled);
mSecunda->setVisible(mSecundaEnabled);
} }
void SkyManager::disable() void SkyManager::disable()

@ -710,7 +710,6 @@ void WeatherManager::update(float duration)
mRendering->sunEnable(); mRendering->sunEnable();
mRendering->setSunColour(result.mSunColor); mRendering->setSunColour(result.mSunColor);
mRendering->skyEnable();
mRendering->getSkyManager()->setWeather(result); mRendering->getSkyManager()->setWeather(result);
} }
else else

@ -140,12 +140,16 @@ namespace MWWorld
void World::adjustSky() void World::adjustSky()
{ {
if (mSky) if (mSky && (isCellExterior() || isCellQuasiExterior()))
{ {
mRendering->skySetHour (mGlobalVariables->getFloat ("gamehour")); mRendering->skySetHour (mGlobalVariables->getFloat ("gamehour"));
mRendering->skySetDate (mGlobalVariables->getInt ("day"), mRendering->skySetDate (mGlobalVariables->getInt ("day"),
mGlobalVariables->getInt ("month")); mGlobalVariables->getInt ("month"));
mRendering->getSkyManager()->enable();
} }
else
mRendering->getSkyManager()->disable();
} }
World::World (OEngine::Render::OgreRenderer& renderer, World::World (OEngine::Render::OgreRenderer& renderer,
@ -153,7 +157,7 @@ namespace MWWorld
const std::string& master, const boost::filesystem::path& resDir, const std::string& master, const boost::filesystem::path& resDir,
bool newGame, Environment& environment, const std::string& encoding) bool newGame, Environment& environment, const std::string& encoding)
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0), : mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
mSky (false), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this) mSky (true), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this)
{ {
mPhysics = new PhysicsSystem(renderer); mPhysics = new PhysicsSystem(renderer);
mPhysEngine = mPhysics->getEngine(); mPhysEngine = mPhysics->getEngine();

Loading…
Cancel
Save