use global variable timescale instead of fixed factor

This commit is contained in:
Marc Zinnschlag 2010-07-21 14:10:52 +02:00
parent cf7150e585
commit c8a18b7d70
3 changed files with 10 additions and 2 deletions

View file

@ -51,8 +51,9 @@ bool OMW::Engine::frameStarted(const Ogre::FrameEvent& evt)
// global scripts
mEnvironment.mGlobalScripts->run (mEnvironment);
// passing of time (30 times as fast as RL time)
mEnvironment.mWorld->advanceTime ((mEnvironment.mFrameDuration*30)/3600);
// passing of time
mEnvironment.mWorld->advanceTime (
mEnvironment.mFrameDuration*mEnvironment.mWorld->getTimeScaleFactor()/3600);
return true;
}

View file

@ -358,4 +358,9 @@ namespace MWWorld
{
mSkyManager->setMoonColour (red);
}
float World::getTimeScaleFactor() const
{
return mGlobalVariables->getInt ("timescale");
}
}

View file

@ -103,6 +103,8 @@ namespace MWWorld
int getSecundaPhase() const;
void setMoonColour (bool red);
float getTimeScaleFactor() const;
};
}