aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-19 08:21:53 -0400
committerPaul Gilbert2015-08-19 08:21:53 -0400
commitbc839e4c3f7361120790bbaf42af8a0528c9281a (patch)
treec31d0a1b7ce7603773837bfb795a970827452e78 /engines/sherlock/tattoo
parentd4e5e447925d251afca20afec0e090b210740c82 (diff)
downloadscummvm-rg350-bc839e4c3f7361120790bbaf42af8a0528c9281a.tar.gz
scummvm-rg350-bc839e4c3f7361120790bbaf42af8a0528c9281a.tar.bz2
scummvm-rg350-bc839e4c3f7361120790bbaf42af8a0528c9281a.zip
SHERLOCK: RT: Clear sequence stack when changing scenes
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.cpp3
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp6
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.h5
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp3
4 files changed, 11 insertions, 6 deletions
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index e94e10caf0..03c80d7f96 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -301,9 +301,6 @@ void TattooScene::freeScene() {
delete ui._mask;
delete ui._mask1;
ui._mask = ui._mask1 = nullptr;
-
- // Ensure that there wasn't anything left on the talk stack, since their _obj pointers will no longer be valid
- assert(talk.isSequencesEmpty());
}
void TattooScene::doBgAnimCheckCursor() {
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 455d41bd48..c7a970984c 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -983,6 +983,12 @@ bool TattooTalk::isSequencesEmpty() const {
return true;
}
+void TattooTalk::clearSequences() {
+ for (int idx = 0; idx < TALK_SEQUENCE_STACK_SIZE; ++idx) {
+ _sequenceStack[idx]._obj = nullptr;
+ }
+}
+
} // End of namespace Tattoo
} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index 3976f15e32..d2ddda08a8 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -119,6 +119,11 @@ public:
* Returns true if the script stack is empty
*/
virtual bool isSequencesEmpty() const;
+
+ /**
+ * Clears the stack of pending object sequences associated with speakers in the scene
+ */
+ virtual void clearSequences();
};
} // End of namespace Tattoo
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 9a3eb4e4d1..6ede31db81 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -378,9 +378,6 @@ void TattooUserInterface::doStandardControl() {
if (vm._runningProlog)
return;
- // There shouldn't be anything left on the talk sequence stack since we're back in control
- assert(talk.isSequencesEmpty());
-
// When the end credits are active, any press will open the ScummVM global main menu
if (_creditsWidget.active()) {
if (_keyState.keycode || events._released || events._rightReleased) {