mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 03:18:17 +00:00
GRIM: Deactivate the animations of an AnimManager when deleting it.
This commit is contained in:
parent
3c4999dbc6
commit
eb3eb1170a
@ -20,6 +20,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/foreach.h"
|
||||
|
||||
#include "engines/grim/animation.h"
|
||||
#include "engines/grim/resource.h"
|
||||
#include "engines/grim/model.h"
|
||||
@ -203,6 +205,14 @@ AnimManager::AnimManager() {
|
||||
|
||||
}
|
||||
|
||||
AnimManager::~AnimManager() {
|
||||
foreach (const AnimationEntry &entry, _activeAnims) {
|
||||
Animation *anim = entry._anim;
|
||||
// Don't call deactivate() here so we don't mess with the list we're using.
|
||||
anim->_manager = NULL;
|
||||
anim->_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
void AnimManager::addAnimation(Animation *anim, int priority1, int priority2) {
|
||||
// Keep the list of animations sorted by priorities in descending order. Because
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
class AnimManager {
|
||||
public:
|
||||
AnimManager();
|
||||
~AnimManager();
|
||||
void addAnimation(Animation *anim, int pr1, int pr2);
|
||||
void removeAnimation(Animation *anim);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user