1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

Merge remote-tracking branch 'torben/checkidlecomplete'

This commit is contained in:
Marc Zinnschlag 2013-05-25 12:35:34 +02:00
commit 94474e8952
7 changed files with 28 additions and 0 deletions

View file

@ -112,6 +112,8 @@ namespace MWBase
virtual void skipAnimation(const MWWorld::Ptr& ptr) = 0;
///< Skip the animation for the given MW-reference for one frame. Calls to this function for
/// references that are currently not in the scene should be ignored.
virtual bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string& groupName) = 0;
};
}

View file

@ -309,4 +309,12 @@ namespace MWMechanics
if(iter != mActors.end())
iter->second.skipAnim();
}
bool Actors::checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string& groupName)
{
PtrControllerMap::iterator iter = mActors.find(ptr);
if(iter != mActors.end())
return iter->second.isAnimPlaying(groupName);
return false;
}
}

View file

@ -82,6 +82,7 @@ namespace MWMechanics
void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number);
void skipAnimation(const MWWorld::Ptr& ptr);
bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string& groupName);
};
}

View file

@ -509,6 +509,14 @@ void CharacterController::skipAnim()
mSkipAnim = true;
}
bool CharacterController::isAnimPlaying(const std::string &groupName)
{
if(mAnimation == NULL)
return false;
else
return mAnimation->isPlaying(groupName);
}
void CharacterController::clearAnimQueue()
{

View file

@ -125,6 +125,7 @@ public:
void playGroup(const std::string &groupname, int mode, int count);
void skipAnim();
bool isAnimPlaying(const std::string &groupName);
void setState(CharacterState state);
CharacterState getState() const

View file

@ -668,5 +668,12 @@ namespace MWMechanics
else
mObjects.skipAnimation(ptr);
}
bool MechanicsManager::checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName)
{
if(MWWorld::Class::get(ptr).isActor())
return mActors.checkAnimationPlaying(ptr, groupName);
else
return false;
}
}

View file

@ -100,6 +100,7 @@ namespace MWMechanics
virtual void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number);
virtual void skipAnimation(const MWWorld::Ptr& ptr);
virtual bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName);
};
}