mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
Add a method to clear the animation queue
This commit is contained in:
parent
6c6200efef
commit
6201cb0093
@ -476,9 +476,7 @@ void CharacterController::playGroup(const std::string &groupname, int mode, int
|
||||
count = std::max(count, 1);
|
||||
if(mode != 0 || mAnimQueue.size() == 0)
|
||||
{
|
||||
if(mAnimQueue.size() > 0)
|
||||
mAnimation->disable(mAnimQueue.front().first);
|
||||
mAnimQueue.clear();
|
||||
clearAnimQueue();
|
||||
mAnimQueue.push_back(std::make_pair(groupname, count-1));
|
||||
|
||||
mCharState = CharState_SpecialIdle;
|
||||
@ -500,6 +498,14 @@ void CharacterController::skipAnim()
|
||||
}
|
||||
|
||||
|
||||
void CharacterController::clearAnimQueue()
|
||||
{
|
||||
if(mAnimQueue.size() > 0)
|
||||
mAnimation->disable(mAnimQueue.front().first);
|
||||
mAnimQueue.clear();
|
||||
}
|
||||
|
||||
|
||||
void CharacterController::setState(CharacterState state)
|
||||
{
|
||||
if(mCharState == state)
|
||||
@ -513,9 +519,7 @@ void CharacterController::forceStateUpdate()
|
||||
{
|
||||
if(!mAnimation)
|
||||
return;
|
||||
if(mAnimQueue.size() > 0)
|
||||
mAnimation->disable(mAnimQueue.front().first);
|
||||
mAnimQueue.clear();
|
||||
clearAnimQueue();
|
||||
|
||||
std::string group;
|
||||
Priority prio;
|
||||
|
@ -111,6 +111,8 @@ class CharacterController
|
||||
|
||||
static void getWeaponGroup(WeaponType weaptype, std::string &group);
|
||||
|
||||
void clearAnimQueue();
|
||||
|
||||
public:
|
||||
CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim, CharacterState state);
|
||||
virtual ~CharacterController();
|
||||
|
Loading…
Reference in New Issue
Block a user