aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-14 22:32:11 -0400
committerPaul Gilbert2016-07-10 16:39:38 -0400
commit76b61324de85c92302ed76b67a09c1c60c9b8470 (patch)
treee7055bbac1a7c5a99991ccd631c2e1954774513b /engines/titanic
parent69134c66cc700fef16b202354e491b9ab6d0b8c0 (diff)
downloadscummvm-rg350-76b61324de85c92302ed76b67a09c1c60c9b8470.tar.gz
scummvm-rg350-76b61324de85c92302ed76b67a09c1c60c9b8470.tar.bz2
scummvm-rg350-76b61324de85c92302ed76b67a09c1c60c9b8470.zip
TITANIC: Renaming for normalized input line
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/tt_input.cpp4
-rw-r--r--engines/titanic/true_talk/tt_input.h4
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp13
3 files changed, 16 insertions, 5 deletions
diff --git a/engines/titanic/true_talk/tt_input.cpp b/engines/titanic/true_talk/tt_input.cpp
index 5d480425bd..102f86fc27 100644
--- a/engines/titanic/true_talk/tt_input.cpp
+++ b/engines/titanic/true_talk/tt_input.cpp
@@ -35,9 +35,9 @@ TTinputSubBase::TTinputSubBase() : _field0(0), _field4(0), _field8(0),
TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
TTroomScript *roomScript, TTnpcScript *npcScript) :
_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
- _field38(0), _line(line), _field4C(0), _roomScript(roomScript),
+ _field38(0), _initialLine(line), _field4C(0), _roomScript(roomScript),
_npcScript(npcScript), _field58(0), _field5C(0) {
- _status = _line.isValid() && _string2.isValid() ? SS_11: SS_VALID;
+ _status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
}
void TTinput::set38(int val) {
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
index e4d91d7a58..e378e9b3ab 100644
--- a/engines/titanic/true_talk/tt_input.h
+++ b/engines/titanic/true_talk/tt_input.h
@@ -59,7 +59,6 @@ private:
int _inputCtr;
int _field34;
int _field38;
- TTstring _string2;
int _field4C;
TTroomScript *_roomScript;
TTnpcScript *_npcScript;
@@ -67,7 +66,8 @@ private:
int _field5C;
int _status;
public:
- TTstring _line;
+ TTstring _initialLine;
+ TTstring _normalizedLine;
public:
TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
TTroomScript *roomScript, TTnpcScript *npcScript);
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 5aa3576a0f..343d0aa7d1 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -37,7 +37,7 @@ int TTparser::processInput(TTinput *input) {
int TTparser::normalize(TTinput *input) {
TTstring *destLine = new TTstring();
- const TTstring &srcLine = input->_line;
+ const TTstring &srcLine = input->_initialLine;
int srcSize = srcLine.size();
int savedIndex = 0;
int counter1 = 0;
@@ -136,6 +136,17 @@ int TTparser::normalize(TTinput *input) {
}
}
+ if (counter1 >= 4)
+ input->set38(4);
+
+ // Remove any trailing spaces
+ while (destLine->hasSuffix(" "))
+ destLine->deleteLastChar();
+
+ // Copy out the normalized line
+ input->_normalizedLine = *destLine;
+ delete destLine;
+
return 0;
}