aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-01 09:57:19 -1000
committerPaul Gilbert2015-05-01 09:57:19 -1000
commitffd65cfd36841f6e117d800043d1cf695951f8a9 (patch)
tree986af45c1470a77a1777b9e993a8bf8a2c078e2d
parentac642fdfb3689612f6efb263cc89419c55f019fa (diff)
downloadscummvm-rg350-ffd65cfd36841f6e117d800043d1cf695951f8a9.tar.gz
scummvm-rg350-ffd65cfd36841f6e117d800043d1cf695951f8a9.tar.bz2
scummvm-rg350-ffd65cfd36841f6e117d800043d1cf695951f8a9.zip
SHERLOCK: Fix animation for retrieving pocket watch
-rw-r--r--engines/sherlock/objects.cpp2
-rw-r--r--engines/sherlock/scene.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 3dc50e61b1..3cec0d800a 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -719,6 +719,8 @@ bool Object::checkEndOfSequence() {
// Free the images
delete _images;
+ _images = nullptr;
+ _imageFrame = nullptr;
}
} else {
_type = INVALID;
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index ec7831820a..a9763a7fc5 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -1050,6 +1050,12 @@ int Scene::startCAnim(int cAnimNum, int playRate) {
// Set canim to REMOVE type and free memory
cObj.checkObject();
+ for (uint idx = 0; idx < _canimShapes.size(); ++idx) {
+ if (&_canimShapes[idx] == &cObj) {
+ _canimShapes.remove_at(idx);
+ break;
+ }
+ }
if (gotoCode > 0 && !talk._talkToAbort) {
_goToScene = gotoCode;
@@ -1376,7 +1382,7 @@ void Scene::doBgAnim() {
if (_goToScene == -1)
screen.slamArea(o._position.x, o._position.y, o._delta.x, o._delta.y);
- _canimShapes.remove_at(idx);
+ _canimShapes[idx]._type = INVALID;
if (_ongoingCans > 0)
--_ongoingCans;
} else if (o._type == ACTIVE_BG_SHAPE) {