aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2009-02-26 14:53:57 +0000
committerNicola Mettifogo2009-02-26 14:53:57 +0000
commit09196a35ad2a7dc226dc6f5ba4e3f5997fb83c42 (patch)
treee89eef44833da7543f802ce8dfd7e054341a0159 /engines/parallaction/parallaction.cpp
parentb76ad3dc4ff3448c360e23e9af4aaf80ca2e1501 (diff)
downloadscummvm-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/parallaction/parallaction.cpp')
-rw-r--r--engines/parallaction/parallaction.cpp16
1 files changed, 11 insertions, 5 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();