[Scummvm-cvs-logs] scummvm master -> bc839e4c3f7361120790bbaf42af8a0528c9281a

dreammaster dreammaster at scummvm.org
Wed Aug 19 14:22:24 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bc839e4c3f SHERLOCK: RT: Clear sequence stack when changing scenes


Commit: bc839e4c3f7361120790bbaf42af8a0528c9281a
    https://github.com/scummvm/scummvm/commit/bc839e4c3f7361120790bbaf42af8a0528c9281a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-19T08:21:53-04:00

Commit Message:
SHERLOCK: RT: Clear sequence stack when changing scenes

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h
    engines/sherlock/tattoo/tattoo_scene.cpp
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_talk.h
    engines/sherlock/tattoo/tattoo_user_interface.cpp



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index b2fe0a2..4e40032 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -278,6 +278,7 @@ void Scene::freeScene() {
 
 	_vm->_ui->clearWindow();
 	_vm->_talk->freeTalkVars();
+	_vm->_talk->clearSequences();
 	_vm->_inventory->freeInv();
 	_vm->_music->freeSong();
 	_vm->_sound->freeLoadedSounds();
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index a81041a..b5f0249 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -195,8 +195,12 @@ void Talk::talkTo(const Common::String &filename) {
 		}
 	}
 
-	while (!isSequencesEmpty())
+	if (IS_ROSE_TATTOO) {
 		pullSequence();
+	} else {
+		while (!isSequencesEmpty())
+			pullSequence();
+	}
 
 	if (IS_SERRATED_SCALPEL) {
 		// Restore any pressed button
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index d0c26b5..adb7aec 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -323,7 +323,7 @@ public:
 	/**
 	 * Clears the stack of pending object sequences associated with speakers in the scene
 	 */
-	virtual void clearSequences() {}
+	virtual void clearSequences() = 0;
 
 	/**
 	 * Pops an entry off of the script stack
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index e94e10c..03c80d7 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 455d41b..c7a9709 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 3976f15..d2ddda0 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 9a3eb4e..6ede31d 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) {






More information about the Scummvm-git-logs mailing list