aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-01 21:50:32 -0400
committerPaul Gilbert2015-07-01 21:50:32 -0400
commit76419173b556a094828160dfe37b944bb10bf9c0 (patch)
treeff6b6447953e0b74b252b854639d66be980c64dc
parentdc4689e4b901971448f2625a96d5708a0c6e8ddf (diff)
downloadscummvm-rg350-76419173b556a094828160dfe37b944bb10bf9c0.tar.gz
scummvm-rg350-76419173b556a094828160dfe37b944bb10bf9c0.tar.bz2
scummvm-rg350-76419173b556a094828160dfe37b944bb10bf9c0.zip
SHERLOCK: RT: Fix infinite empty talk dialog in intro
-rw-r--r--engines/sherlock/journal.cpp4
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp13
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.h1
-rw-r--r--engines/sherlock/talk.cpp6
-rw-r--r--engines/sherlock/talk.h6
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp10
6 files changed, 18 insertions, 22 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index bcac69f683..6a4347ae04 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -547,7 +547,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
replyP += (*replyP & 127) + 1;
} else if (c == opcodes[OP_GOTO_SCENE]) {
replyP += 5;
- } else if (c == opcodes[OP_CARRIAGE_RETURN]) {
+ } else if (c == opcodes[OP_END_TEXT_WINDOW]) {
journalString += "\n";
}
} else {
@@ -632,7 +632,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
// Put a space in the output for a control character, unless it's
// immediately coming after another control character
- if (ctrlSpace && c != opcodes[OP_ASSIGN_PORTRAIT_LOCATION] && c != opcodes[OP_CARRIAGE_RETURN] &&
+ if (ctrlSpace && c != opcodes[OP_ASSIGN_PORTRAIT_LOCATION] && c != opcodes[OP_END_TEXT_WINDOW] &&
!commentJustPrinted) {
journalString += " ";
ctrlSpace = false;
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 2669754061..ed529df17c 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -69,7 +69,7 @@ const byte SCALPEL_OPCODES[] = {
158, // OP_REMOVE_ITEM_FROM_INVENTORY
159, // OP_ENABLE_END_KEY
160, // OP_DISABLE_END_KEY
- 161, // OP_CARRIAGE_RETURN
+ 161, // OP_END_TEXT_WINDOW
0, // OP_MOUSE_ON_OFF
0, // OP_SET_WALK_CONTROL
0, // OP_SET_TALK_SEQUENCE
@@ -103,8 +103,7 @@ const byte SCALPEL_OPCODES[] = {
0, // OP_RESTORE_PEOPLE_SEQUENCE
0, // OP_NPC_VERB_TARGET
0, // OP_TURN_SOUNDS_OFF
- 0, // OP_NULL
- 0 // OP_END_TEXT_WINDOW
+ 0 // OP_NULL
};
/*----------------------------------------------------------------*/
@@ -148,14 +147,14 @@ ScalpelTalk::ScalpelTalk(SherlockEngine *vm) : Talk(vm) {
(OpcodeMethod)&ScalpelTalk::cmdEnableEndKey,
(OpcodeMethod)&ScalpelTalk::cmdDisableEndKey,
- (OpcodeMethod)&ScalpelTalk::cmdCarriageReturn,
+ (OpcodeMethod)&ScalpelTalk::cmdEndTextWindow,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
};
_opcodeTable = OPCODE_METHODS;
@@ -525,10 +524,6 @@ OpcodeReturn ScalpelTalk::cmdSummonWindow(const byte *&str) {
return RET_SUCCESS;
}
-OpcodeReturn ScalpelTalk::cmdCarriageReturn(const byte *&str) {
- return RET_SUCCESS;
-}
-
void ScalpelTalk::talkWait(const byte *&str) {
UserInterface &ui = *_vm->_ui;
bool pauseFlag = _pauseFlag;
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 01e7c053dd..24188d8fcd 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -50,7 +50,6 @@ private:
OpcodeReturn cmdRemovePortrait(const byte *&str);
OpcodeReturn cmdSfxCommand(const byte *&str);
OpcodeReturn cmdSummonWindow(const byte *&str);
- OpcodeReturn cmdCarriageReturn(const byte *&str);
OpcodeReturn cmdWalkToCoords(const byte *&str);
protected:
/**
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 11ae9b4c1f..abd41b94b9 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -857,7 +857,7 @@ void Talk::doScript(const Common::String &script) {
}
// Open window if it wasn't already open, and text has already been printed
- if ((_openTalkWindow && _wait) || (_openTalkWindow && str[0] >= _opcodes[0] && str[0] != _opcodes[OP_CARRIAGE_RETURN])) {
+ if ((_openTalkWindow && _wait) || (_openTalkWindow && str[0] >= _opcodes[0] && str[0] != _opcodes[OP_END_TEXT_WINDOW])) {
if (!ui._slideWindows) {
screen.slamRect(Common::Rect(0, CONTROLS_Y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
} else {
@@ -1128,6 +1128,10 @@ OpcodeReturn Talk::cmdEnableEndKey(const byte *&str) {
return RET_SUCCESS;
}
+OpcodeReturn Talk::cmdEndTextWindow(const byte *&str) {
+ return RET_SUCCESS;
+}
+
OpcodeReturn Talk::cmdHolmesOff(const byte *&str) {
People &people = *_vm->_people;
people[HOLMES]._type = REMOVE;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index ef11551d52..4230a03644 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -71,7 +71,7 @@ enum {
OP_REMOVE_ITEM_FROM_INVENTORY = 30,
OP_ENABLE_END_KEY = 31,
OP_DISABLE_END_KEY = 32,
- OP_CARRIAGE_RETURN = 33,
+ OP_END_TEXT_WINDOW = 33,
OP_MOUSE_OFF_ON = 34,
OP_SET_WALK_CONTROL = 35,
@@ -106,8 +106,7 @@ enum {
OP_RESTORE_PEOPLE_SEQUENCE = 64,
OP_NPC_VERB_TARGET = 65,
OP_TURN_SOUNDS_OFF = 66,
- OP_NULL = 67,
- OP_END_TEXT_WINDOW = 68
+ OP_NULL = 67
};
enum OpcodeReturn { RET_EXIT = -1, RET_SUCCESS = 0, RET_CONTINUE = 1 };
@@ -229,6 +228,7 @@ protected:
OpcodeReturn cmdCallTalkFile(const byte *&str);
OpcodeReturn cmdDisableEndKey(const byte *&str);
OpcodeReturn cmdEnableEndKey(const byte *&str);
+ OpcodeReturn cmdEndTextWindow(const byte *&str);
OpcodeReturn cmdHolmesOff(const byte *&str);
OpcodeReturn cmdHolmesOn(const byte *&str);
OpcodeReturn cmdPause(const byte *&str);
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index f875554870..84a7924c69 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -70,7 +70,7 @@ const byte TATTOO_OPCODES[] = {
200, // OP_REMOVE_ITEM_FROM_INVENTORY
201, // OP_ENABLE_END_KEY
202, // OP_DISABLE_END_KEY
- 0, // OP_CARRIAGE_RETURN
+ 203, // OP_END_TEXT_WINDOW
174, // OP_MOUSE_ON_OFF
175, // OP_SET_WALK_CONTROL
180, // OP_SET_TALK_SEQUENCE
@@ -104,8 +104,7 @@ const byte TATTOO_OPCODES[] = {
224, // OP_RESTORE_PEOPLE_SEQUENCE
226, // OP_NPC_VERB_TARGET
227, // OP_TURN_SOUNDS_OFF
- 225, // OP_NULL
- 203 // OP_END_TEXT_WINDOW
+ 225 // OP_NULL
};
/*----------------------------------------------------------------*/
@@ -149,7 +148,7 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm), _talkWidget(vm) {
(OpcodeMethod)&TattooTalk::cmdEnableEndKey,
(OpcodeMethod)&TattooTalk::cmdDisableEndKey,
- nullptr,
+ (OpcodeMethod)&TattooTalk::cmdEndTextWindow,
(OpcodeMethod)&TattooTalk::cmdWalkHomesAndNPCToCoords,
(OpcodeMethod)&TattooTalk::cmdSetNPCTalkFile,
(OpcodeMethod)&TattooTalk::cmdSetNPCOff,
@@ -174,8 +173,7 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm), _talkWidget(vm) {
nullptr,
(OpcodeMethod)&TattooTalk::cmdRestorePeopleSequence,
(OpcodeMethod)&TattooTalk::cmdSetNPCVerbTarget,
- (OpcodeMethod)&TattooTalk::cmdTurnSoundsOff,
- nullptr
+ (OpcodeMethod)&TattooTalk::cmdTurnSoundsOff
};
_opcodes = TATTOO_OPCODES;