[Scummvm-cvs-logs] scummvm master -> 9b837c308f3175586aaceb273c6d11bfc778fbb1
dreammaster
dreammaster at scummvm.org
Sun Jun 7 20:28:23 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:
9b837c308f SHERLOCK: Fix for switching speakers
Commit: 9b837c308f3175586aaceb273c6d11bfc778fbb1
https://github.com/scummvm/scummvm/commit/9b837c308f3175586aaceb273c6d11bfc778fbb1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-07T14:26:57-04:00
Commit Message:
SHERLOCK: Fix for switching speakers
Changed paths:
engines/sherlock/scalpel/scalpel_talk.cpp
engines/sherlock/scalpel/scalpel_talk.h
engines/sherlock/talk.cpp
engines/sherlock/talk.h
engines/sherlock/tattoo/tattoo_people.cpp
engines/sherlock/tattoo/tattoo_talk.cpp
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 23937de..f630534 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -492,6 +492,21 @@ OpcodeReturn ScalpelTalk::cmdCarriageReturn(const byte *&str) {
return RET_SUCCESS;
}
+void ScalpelTalk::talkWait(const byte *&str) {
+ UserInterface &ui = *_vm->_ui;
+ bool pauseFlag = _pauseFlag;
+
+ Talk::talkWait(str);
+
+ // 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;
+ }
+}
+
} // End of namespace Scalpel
} // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 6a11824..a3ac0f2 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -56,6 +56,11 @@ protected:
* Display the talk interface window
*/
virtual void talkInterface(const byte *&str);
+
+ /**
+ * Pause when displaying a talk dialog on-screen
+ */
+ virtual void talkWait(const byte *&str);
public:
ScalpelTalk(SherlockEngine *vm);
virtual ~ScalpelTalk() {}
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index d1e92a7..3a009e9 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
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index fbcc9e7..5385ab0 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -256,6 +256,11 @@ protected:
* Display the talk interface window
*/
virtual void talkInterface(const byte *&str) = 0;
+
+ /**
+ * Pause when displaying a talk dialog on-screen
+ */
+ virtual void talkWait(const byte *&str);
public:
TalkSequence _talkSequenceStack[TALK_SEQUENCE_STACK_SIZE];
bool _talkToAbort;
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index b253afd..4e4f11b 100644
--- a/engines/sherlock/tattoo/tattoo_people.cpp
+++ b/engines/sherlock/tattoo/tattoo_people.cpp
@@ -186,8 +186,7 @@ void TattooPeople::setTalkSequence(int speaker, int sequenceNum) {
// See if the NPC's sequence has to wait for an Abort Talk Code
if (person.hasAborts()) {
person._gotoSeq = newDir;
- }
- else {
+ } else {
if (person._seqTo) {
// Reset to previous value
person._walkSequences[person._sequenceNumber]._sequences[person._frameNumber] = person._seqTo;
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 3a06671..8e57ad5 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -215,6 +215,8 @@ OpcodeReturn TattooTalk::cmdSwitchSpeaker(const byte *&str) {
people.setListenSequence(_speaker, 129);
_speaker = *++str - 1;
+ ++str;
+
people.setTalkSequence(_speaker, 1);
return RET_SUCCESS;
More information about the Scummvm-git-logs
mailing list