aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/moves/enter_exit_first_class_state.cpp13
-rw-r--r--engines/titanic/moves/enter_exit_first_class_state.h2
-rw-r--r--engines/titanic/pet_control/pet_text.cpp29
-rw-r--r--engines/titanic/titanic.h1
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp2
-rw-r--r--engines/titanic/true_talk/tt_sentence.cpp4
6 files changed, 27 insertions, 24 deletions
diff --git a/engines/titanic/moves/enter_exit_first_class_state.cpp b/engines/titanic/moves/enter_exit_first_class_state.cpp
index efdead533a..4b58c1b86d 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.cpp
+++ b/engines/titanic/moves/enter_exit_first_class_state.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/moves/enter_exit_first_class_state.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -30,13 +31,13 @@ END_MESSAGE_MAP()
void CEnterExitFirstClassState::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(_viewName, indent);
+ file->writeQuotedLine(g_vm->_stateRoomExitView, indent);
CGameObject::save(file, indent);
}
void CEnterExitFirstClassState::load(SimpleFile *file) {
file->readNumber();
- _viewName = file->readString();
+ g_vm->_stateRoomExitView = file->readString();
CGameObject::load(file);
}
@@ -44,10 +45,12 @@ bool CEnterExitFirstClassState::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
switch (getPassengerClass()) {
case 1:
if (compareRoomNameTo("1stClassLobby")) {
- _viewName = getRoomNodeName() + ".E";
- changeView(_viewName);
+ // Entering room, so save where you were and change to stateroom
+ g_vm->_stateRoomExitView = getRoomNodeName() + ".E";
+ changeView("1stClassState.Node 1.S");
} else if (compareRoomNameTo("1stClassState")) {
- changeView(_viewName);
+ // Return to where you entered room from
+ changeView(g_vm->_stateRoomExitView);
}
break;
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
index fe63e553de..ea5c52a35e 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.h
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -30,8 +30,6 @@ namespace Titanic {
class CEnterExitFirstClassState : public CGameObject {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-private:
- CString _viewName;
public:
CLASSDEF;
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 7bb0bad16e..05038d2fd0 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -249,20 +249,21 @@ void CPetText::setColor(byte r, byte g, byte b) {
}
void CPetText::remapColors(uint count, uint *srcColors, uint *destColors) {
- if (_lineCount >= 0) {
- for (int lineNum = 0; lineNum <= _lineCount; ++lineNum) {
- // Get the rgb values
- uint r = _array[lineNum]._rgb[1];
- uint g = _array[lineNum]._rgb[2];
- uint b = _array[lineNum]._rgb[3];
- uint color = r | (g << 8) | (b << 16);
-
- for (uint index = 0; index < count; ++index) {
- if (color == srcColors[index]) {
- // Found a match, so replace the color
- setLineColor(lineNum, destColors[lineNum]);
- break;
- }
+ for (int lineNum = 0; lineNum <= _lineCount; ++lineNum) {
+ if (_array[lineNum]._rgb.empty())
+ continue;
+
+ // Get the rgb values
+ uint r = _array[lineNum]._rgb[1];
+ uint g = _array[lineNum]._rgb[2];
+ uint b = _array[lineNum]._rgb[3];
+ uint color = r | (g << 8) | (b << 16);
+
+ for (uint index = 0; index < count; ++index) {
+ if (color == srcColors[index]) {
+ // Found a match, so replace the color
+ setLineColor(lineNum, destColors[lineNum]);
+ break;
}
}
}
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index d8e0f880f7..43f3fa07f3 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -123,6 +123,7 @@ public:
StringArray _itemIds;
StringArray _roomNames;
Strings _strings;
+ CString _stateRoomExitView;
public:
TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
virtual ~TitanicEngine();
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 7540a738b5..2a5c155421 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -707,7 +707,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
for (uint loopCtr = 0; loopCtr < 2; ++loopCtr) {
for (uint entryCtr = 0; entryCtr < entryCount; ++entryCtr) {
const TTsentenceEntry &entry = (*entries)[entryCtr];
- if (entry._category != categoryNum && (loopCtr == 0 || entry._category))
+ if (entry._category == categoryNum && (loopCtr == 0 || entry._category))
continue;
bool flag;
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 451582383d..8d897aaa38 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -212,7 +212,7 @@ bool TTsentence::fn2(int slotIndex, const TTstring &str, const TTconceptNode *no
if (g_vm->_exeResources._owner->_concept1P && (slotIndex == 0 ||
slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5)) {
- if (str == g_vm->_exeResources._owner->_concept2P->getText() &&
+ if (str == g_vm->_exeResources._owner->_concept1P->getText() &&
(conceptText == "it" || conceptText == "that" || conceptText == "he" ||
conceptText == "she" || conceptText == "him" || conceptText == "her" ||
conceptText == "them" || conceptText == "they" || conceptText == "those" ||
@@ -221,7 +221,7 @@ bool TTsentence::fn2(int slotIndex, const TTstring &str, const TTconceptNode *no
}
if (g_vm->_exeResources._owner->_concept1P && (slotIndex == 0 || slotIndex == 2)) {
- if (conceptText == "?" && str == g_vm->_exeResources._owner->_concept2P->getText()) {
+ if (conceptText == "?" && str == g_vm->_exeResources._owner->_concept1P->getText()) {
delete concept;
concept = getFrameSlot(5, node);
conceptText = concept->getText();