[Scummvm-cvs-logs] scummvm master -> 6862c9dd9bc03b0ce425c71c62f203d9ae996e8a
dreammaster
dreammaster at scummvm.org
Sat Aug 22 03:39:11 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:
6862c9dd9b SHERLOCK: 3DO: Cleanup of conversation message playback
Commit: 6862c9dd9bc03b0ce425c71c62f203d9ae996e8a
https://github.com/scummvm/scummvm/commit/6862c9dd9bc03b0ce425c71c62f203d9ae996e8a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-21T21:37:29-04:00
Commit Message:
SHERLOCK: 3DO: Cleanup of conversation message playback
The changes remove most of the hardcoding that was in place for showing
the conversation movies, and have them triggered like the Rose Tattoo
speech files. It will still need some work to hook it into our new
voice playback, though, so text dialogs are closed at the right time
Changed paths:
engines/sherlock/scalpel/scalpel_talk.cpp
engines/sherlock/scalpel/scalpel_talk.h
engines/sherlock/talk.cpp
engines/sherlock/talk.h
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 6f98a17..9b38a95 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -540,10 +540,10 @@ void ScalpelTalk::nothingToSay() {
error("Character had no talk options available");
}
-void ScalpelTalk::switchSpeaker(int subIndex) {
+void ScalpelTalk::switchSpeaker() {
// If it's the 3DO, pass on to start the actor's conversation movie
if (IS_3DO)
- talk3DOMovieTrigger(subIndex);
+ talk3DOMovieTrigger(_3doSpeechIndex++);
}
void ScalpelTalk::talk3DOMovieTrigger(int subIndex) {
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 9e07b26..4d13258 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -68,7 +68,7 @@ protected:
/**
* Called when the active speaker is switched
*/
- virtual void switchSpeaker(int subIndex);
+ virtual void switchSpeaker();
/**
* Called when a character being spoken to has no talk options to display
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index fffb830..dad6b41 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -113,6 +113,7 @@ Talk::Talk(SherlockEngine *vm) : _vm(vm) {
_scriptSaveIndex = -1;
_opcodes = nullptr;
_opcodeTable = nullptr;
+ _3doSpeechIndex = -1;
_charCount = 0;
_line = 0;
@@ -575,6 +576,8 @@ void Talk::loadTalkFile(const Common::String &filename) {
// Create the base of the sound filename used for talking in Rose Tattoo
if (IS_ROSE_TATTOO && _scriptMoreFlag != 1)
sound._talkSoundFile = Common::String(filename.c_str(), filename.c_str() + 7) + ".";
+ else if (IS_3DO)
+ _3doSpeechIndex = 1;
// Open the talk file for reading
Common::SeekableReadStream *talkStream = res.load(talkFile);
@@ -744,9 +747,6 @@ void Talk::doScript(const Common::String &script) {
}
}
- bool speakerSwitched = true;
- uint16 subIndex = 1;
-
do {
Common::String tempString;
_wait = 0;
@@ -769,9 +769,6 @@ void Talk::doScript(const Common::String &script) {
break;
}
- if (c == _opcodes[OP_SWITCH_SPEAKER])
- speakerSwitched = true;
-
++str;
} else {
// Handle drawing the talk interface with the text
@@ -790,12 +787,6 @@ void Talk::doScript(const Common::String &script) {
_openTalkWindow = false;
}
- if ((_wait) && (speakerSwitched)) {
- switchSpeaker(subIndex);
- speakerSwitched = false;
- ++subIndex;
- }
-
if (_wait)
// Handling pausing
talkWait(str);
@@ -839,11 +830,12 @@ int Talk::waitForMore(int delay) {
}
// Handle playing any speech associated with the text being displayed
- if (IS_ROSE_TATTOO && sound._speechOn) {
+ switchSpeaker();
+ if (sound._speechOn && IS_ROSE_TATTOO) {
sound.playSpeech(sound._talkSoundFile);
sound._talkSoundFile.setChar(sound._talkSoundFile.lastChar() + 1, sound._talkSoundFile.size() - 1);
- playingSpeech = sound.isSpeechPlaying();
}
+ playingSpeech = sound.isSpeechPlaying();
do {
if (IS_SERRATED_SCALPEL && sound._speechOn && !sound.isSpeechPlaying())
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index adb7aec..694ac08 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -180,6 +180,7 @@ protected:
int _talkStealth;
int _talkToFlag;
int _scriptSaveIndex;
+ int _3doSpeechIndex;
// These fields are used solely by doScript, but are fields because all the script opcodes are
// separate methods now, and need access to these fields
@@ -252,7 +253,7 @@ protected:
/**
* Called when the active speaker is switched
*/
- virtual void switchSpeaker(int subIndex) {}
+ virtual void switchSpeaker() {}
public:
Common::Array<Statement> _statements;
bool _talkToAbort;
More information about the Scummvm-git-logs
mailing list