aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-27 06:50:52 -0400
committerPaul Gilbert2016-07-15 19:15:49 -0400
commit1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3 (patch)
tree2f70b81ffbca60faae8bb08c5114fc51b04bd3fb /engines/titanic/true_talk
parent63439a1c94d0279e6b00e8663d3ae554a3379b0f (diff)
downloadscummvm-rg350-1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3.tar.gz
scummvm-rg350-1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3.tar.bz2
scummvm-rg350-1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3.zip
TITANIC: Added TTparser processRequests
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 498c0cc015..5a94196552 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -888,8 +888,44 @@ int TTparser::considerRequests(TTword *word) {
}
int TTparser::processRequests(TTword *word) {
- // TODO
- return 0;
+ int status = loadRequests(word);
+ switch (status) {
+ case 0:
+ status = considerRequests(word);
+
+ // Iterate through the words
+ while (_currentWordP) {
+ considerRequests(_currentWordP);
+ TTword *nextP = _currentWordP->_nextP;
+
+ delete _currentWordP;
+ _currentWordP = nextP;
+ }
+ break;
+
+ case 1: {
+ TTword *newWord = new TTword(word);
+ newWord->_nextP = nullptr;
+
+ // Add word to word chain
+ if (_currentWordP) {
+ // Add at end of existing chain
+ for (word = _currentWordP; word->_nextP; word = word->_nextP)
+ ;
+ word->_nextP = newWord;
+ } else {
+ // First word, so set as head
+ _currentWordP = newWord;
+ }
+ break;
+ }
+
+ default:
+ warning("unexpected return from consider requests");
+ break;
+ }
+
+ return status;
}
void TTparser::addToConceptList(TTword *word) {