animation updates were hooked up to the wrong update function

This commit is contained in:
Marc Zinnschlag 2012-01-23 14:33:06 +01:00
parent 0c2de2c00c
commit 16bc374921
9 changed files with 35 additions and 36 deletions

View file

@ -158,6 +158,9 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
if (mEnvironment.mWindowManager->getMode()==MWGui::GM_Game)
mEnvironment.mWorld->doPhysics (movement, mEnvironment.mFrameDuration);
// update world
mEnvironment.mWorld->update (evt.timeSinceLastFrame);
// report focus object (for debugging)
if (mReportFocus)
updateFocusReport (mEnvironment.mFrameDuration);

View file

@ -16,11 +16,7 @@ void Actors::insertNPC(const MWWorld::Ptr& ptr){
insertBegin(ptr, true, true);
NpcAnimation* anim = new MWRender::NpcAnimation(ptr, mEnvironment, mRend);
//
mAllActors[ptr] = anim;
mAllActors[ptr] = anim;
}
void Actors::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
Ogre::SceneNode* cellnode;
@ -121,10 +117,9 @@ void Actors::skipAnimation (const MWWorld::Ptr& ptr){
if(mAllActors.find(ptr) != mAllActors.end())
mAllActors[ptr]->stopScript();
}
void Actors::addTime(){
//std::cout << "Adding time in actors\n";
void Actors::update (float duration){
for(std::map<MWWorld::Ptr, Animation*>::iterator iter = mAllActors.begin(); iter != mAllActors.end(); iter++)
{
(iter->second)->runAnimation(mEnvironment.mFrameDuration);
(iter->second)->runAnimation(duration);
}
}

View file

@ -52,7 +52,7 @@ namespace MWRender{
///< Skip the animation for the given MW-reference for one frame. Calls to this function for
/// references that are currently not in the rendered scene should be ignored.
void addTime();
void update (float duration);
};
}

View file

@ -121,7 +121,7 @@ void RenderingManager::moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Ve
void RenderingManager::update (float duration){
mActors.update (duration);
}
void RenderingManager::skyEnable ()
@ -240,9 +240,5 @@ void RenderingManager::skipAnimation (const MWWorld::Ptr& ptr)
{
mActors.skipAnimation(ptr);
}
void RenderingManager::addTime(){
mActors.addTime();
//Notify each animation that time has passed
}
}

View file

@ -105,8 +105,6 @@ class RenderingManager: private RenderingInterface {
///< Skip the animation for the given MW-reference for one frame. Calls to this function for
/// references that are currently not in the rendered scene should be ignored.
void addTime();
private:
void setAmbientMode();

View file

@ -52,8 +52,8 @@ void insertCellRefList(MWRender::RenderingManager& rendering, MWWorld::Environme
namespace MWWorld
{
void Scene::advanceTime(){
mRendering.addTime();
void Scene::update (float duration){
mRendering.update (duration);
}
void Scene::unloadCell (CellStoreCollection::iterator iter)
{

View file

@ -101,7 +101,8 @@ namespace MWWorld
void markCellAsUnchanged();
void insertCell(ESMS::CellStore<MWWorld::RefData> &cell, MWWorld::Environment& environment);
void advanceTime();
void update (float duration);
};
}

View file

@ -355,7 +355,6 @@ namespace MWWorld
if (days>0)
mGlobalVariables->setInt ("dayspassed", days + mGlobalVariables->getInt ("dayspassed"));
mWorldScene->advanceTime();
}
void World::setHour (double hour)
@ -691,4 +690,9 @@ namespace MWWorld
void World::setObjectPhysicsPosition(const std::string& handle, Ogre::Vector3 vec){
mPhysics->moveObject(handle, vec);
}
void World::update (float duration)
{
mWorldScene->update (duration);
}
}

View file

@ -220,6 +220,8 @@ namespace MWWorld
/// references that are currently not in the rendered scene should be ignored.
void setObjectPhysicsRotation(const std::string& handle,Ogre::Quaternion quat);
void setObjectPhysicsPosition(const std::string& handle,Ogre::Vector3 vector);
void update (float duration);
};
}