fix toggleSky

actorid
scrawl 13 years ago
parent c1d39bb35f
commit 932983c2fa

@ -536,22 +536,24 @@ int SkyManager::getSecundaPhase() const
void SkyManager::update(float duration)
{
if (!mEnabled) return;
// UV Scroll the clouds
mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1);
mMasser->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()
{
mRootNode->setVisible(true);
mEnabled = true;
mSunGlare->setVisible(mGlareEnabled && mSunEnabled);
mSun->setVisible(mSunEnabled);
mMasser->setVisible(mMasserEnabled);
mSecunda->setVisible(mSecundaEnabled);
}
void SkyManager::disable()

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

@ -140,12 +140,16 @@ namespace MWWorld
void World::adjustSky()
{
if (mSky)
if (mSky && (isCellExterior() || isCellQuasiExterior()))
{
mRendering->skySetHour (mGlobalVariables->getFloat ("gamehour"));
mRendering->skySetDate (mGlobalVariables->getInt ("day"),
mGlobalVariables->getInt ("month"));
mRendering->getSkyManager()->enable();
}
else
mRendering->getSkyManager()->disable();
}
World::World (OEngine::Render::OgreRenderer& renderer,
@ -153,7 +157,7 @@ namespace MWWorld
const std::string& master, const boost::filesystem::path& resDir,
bool newGame, Environment& environment, const std::string& encoding)
: 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);
mPhysEngine = mPhysics->getEngine();

Loading…
Cancel
Save