Skip to content
Snippets Groups Projects
Commit 61de0ae6 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix animations playing inconsistently(This was never meant to be commited in the first place)

parent 110a6b16
No related branches found
No related tags found
No related merge requests found
...@@ -333,7 +333,7 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp) ...@@ -333,7 +333,7 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp)
motionp->deactivate(); motionp->deactivate();
mLoadingMotions.erase(motionp); mLoadingMotions.erase(motionp);
mLoadedMotions.erase(motionp); mLoadedMotions.erase(motionp);
mActiveMotions.erase(motionp); mActiveMotions.remove(motionp);
delete motionp; delete motionp;
} }
} }
...@@ -961,9 +961,9 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) ...@@ -961,9 +961,9 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
if (motion->isActive()) if (motion->isActive())
{ {
mActiveMotions.erase(motion); mActiveMotions.remove(motion);
} }
mActiveMotions.emplace(motion); mActiveMotions.push_front(motion);
motion->activate(time); motion->activate(time);
motion->onUpdate(0.f, mJointSignature[1]); motion->onUpdate(0.f, mJointSignature[1]);
...@@ -998,7 +998,7 @@ BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion) ...@@ -998,7 +998,7 @@ BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
else else
{ {
// for motions that we are keeping, simply remove from active queue // for motions that we are keeping, simply remove from active queue
mActiveMotions.erase(motion); mActiveMotions.remove(motion);
} }
return TRUE; return TRUE;
...@@ -1062,7 +1062,7 @@ void LLMotionController::dumpMotions() ...@@ -1062,7 +1062,7 @@ void LLMotionController::dumpMotions()
state_string += std::string("l"); state_string += std::string("l");
if (mLoadedMotions.find(motion) != mLoadedMotions.cend()) if (mLoadedMotions.find(motion) != mLoadedMotions.cend())
state_string += std::string("L"); state_string += std::string("L");
if (mActiveMotions.find(motion) != mActiveMotions.cend()) if (std::find(mActiveMotions.cbegin(), mActiveMotions.cend(), motion)!=mActiveMotions.cend())
state_string += std::string("A"); state_string += std::string("A");
if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.cend()) if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.cend())
state_string += std::string("D"); state_string += std::string("D");
......
...@@ -83,6 +83,7 @@ class LLMotionController ...@@ -83,6 +83,7 @@ class LLMotionController
{ {
public: public:
using motion_set_t = absl::flat_hash_set<LLMotion*>; using motion_set_t = absl::flat_hash_set<LLMotion*>;
using motion_list_t = std::list<LLMotion*>;
using motion_deque_t = std::deque<LLMotion*>; using motion_deque_t = std::deque<LLMotion*>;
BOOL mIsSelf; BOOL mIsSelf;
...@@ -212,7 +213,7 @@ protected: ...@@ -212,7 +213,7 @@ protected:
motion_set_t mLoadingMotions; motion_set_t mLoadingMotions;
motion_set_t mLoadedMotions; motion_set_t mLoadedMotions;
motion_set_t mActiveMotions; motion_list_t mActiveMotions;
motion_set_t mDeprecatedMotions; motion_set_t mDeprecatedMotions;
LLFrameTimer mTimer; LLFrameTimer mTimer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment