diff options
author | Nicola Mettifogo | 2009-02-26 14:53:57 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2009-02-26 14:53:57 +0000 |
commit | 09196a35ad2a7dc226dc6f5ba4e3f5997fb83c42 (patch) | |
tree | e89eef44833da7543f802ce8dfd7e054341a0159 /engines | |
parent | b76ad3dc4ff3448c360e23e9af4aaf80ca2e1501 (diff) | |
download | scummvm-rg350-09196a35ad2a7dc226dc6f5ba4e3f5997fb83c42.tar.gz scummvm-rg350-09196a35ad2a7dc226dc6f5ba4e3f5997fb83c42.tar.bz2 scummvm-rg350-09196a35ad2a7dc226dc6f5ba4e3f5997fb83c42.zip |
Added filter to preserve needed Animation across location switch.
svn-id: r38903
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 16 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 3 |
3 files changed, 12 insertions, 9 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 7565346e39..abd8249d02 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -213,11 +213,17 @@ AnimationPtr Location::findAnimation(const char *name) { return AnimationPtr(); } -void Location::freeAnimations() { - for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); ++it) { - (*it)->_commands.clear(); // See comment for freeZones(), about circular references. +void Location::freeAnimations(bool removeAll) { + AnimationList::iterator it = _animations.begin(); + while (it != _animations.end()) { + AnimationPtr a = *it; + if (!removeAll && ((a->_flags & kFlagsSelfuse) || (ACTIONTYPE(a) == kZoneMerge))) { + ++it; + } else { + a->_commands.clear(); // See comment for freeZones(), about circular references. + it = _animations.erase(it); + } } - _animations.clear(); } @@ -266,7 +272,7 @@ void Location::cleanup(bool removeAll) { _endComment.clear(); freeZones(removeAll); - freeAnimations(); + freeAnimations(removeAll); _programs.clear(); _commands.clear(); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 0a20d519bb..8e7ba76648 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -157,7 +157,7 @@ struct Location { uint16 _followerStartFrame; protected: - void freeAnimations(); + void freeAnimations(bool removeAll); void freeZones(bool removeAll); public: diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index b790b90c7c..15d9385998 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -194,15 +194,12 @@ void Parallaction_br::freeCharacter() { } void Parallaction_br::freeLocation(bool removeAll) { - // free open location stuff clearSubtitles(); _subtitle[0] = _subtitle[1] = -1; _gfx->freeLocationObjects(); - // TODO: avoid removing needed animations from 'common.slf' - // when cleaning up!!! _location._animations.remove(_char._ani); _location.cleanup(removeAll); _location._animations.push_front(_char._ani); |