aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/talk.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-07 14:26:57 -0400
committerPaul Gilbert2015-06-07 14:26:57 -0400
commit9b837c308f3175586aaceb273c6d11bfc778fbb1 (patch)
treef7218e980bc4a3cefc3498d3f77928158e4a6d20 /engines/sherlock/talk.cpp
parentbe46bfd1f9eea2d74bb8dfe41841c4bfd9519a5d (diff)
downloadscummvm-rg350-9b837c308f3175586aaceb273c6d11bfc778fbb1.tar.gz
scummvm-rg350-9b837c308f3175586aaceb273c6d11bfc778fbb1.tar.bz2
scummvm-rg350-9b837c308f3175586aaceb273c6d11bfc778fbb1.zip
SHERLOCK: Fix for switching speakers
Diffstat (limited to 'engines/sherlock/talk.cpp')
-rw-r--r--engines/sherlock/talk.cpp43
1 files changed, 19 insertions, 24 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index d1e92a7fa5..3a009e9160 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -1073,31 +1073,9 @@ void Talk::doScript(const Common::String &script) {
_openTalkWindow = false;
}
- if (_wait) {
+ if (_wait)
// Handling pausing
- if (!_pauseFlag && _charCount < 160)
- _charCount = 160;
-
- _wait = waitForMore(_charCount);
- if (_wait == -1)
- _endStr = true;
-
- // If a key was pressed to finish the window, see if further voice files should be skipped
- if (_wait >= 0 && _wait < 254) {
- if (str[0] == _opcodes[OP_SFX_COMMAND])
- str += 9;
- }
-
- // Clear the window unless the wait was due to a PAUSE command
- if (!_pauseFlag && _wait != -1 && str < _scriptEnd && str[0] != _opcodes[OP_SFX_COMMAND]) {
- if (!_talkStealth)
- ui.clearWindow();
- _yp = CONTROLS_Y + 12;
- _charCount = _line = 0;
- }
-
- _pauseFlag = false;
- }
+ talkWait(str);
} while (!_vm->shouldQuit() && !_endStr);
if (_wait != -1) {
@@ -1490,4 +1468,21 @@ OpcodeReturn Talk::cmdWalkToCoords(const byte *&str) {
return RET_SUCCESS;
}
+void Talk::talkWait(const byte *&str) {
+ if (!_pauseFlag && _charCount < 160)
+ _charCount = 160;
+
+ _wait = waitForMore(_charCount);
+ if (_wait == -1)
+ _endStr = true;
+
+ // If a key was pressed to finish the window, see if further voice files should be skipped
+ if (_wait >= 0 && _wait < 254) {
+ if (str[0] == _opcodes[OP_SFX_COMMAND])
+ str += 9;
+ }
+
+ _pauseFlag = false;
+}
+
} // End of namespace Sherlock