From b7e4ed8744c815b687ce0e4b89df2d204dd28a2a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 May 2016 18:33:18 -0400 Subject: TITANIC: Further fleshing out of vocab loading --- engines/titanic/true_talk/st_vocab.cpp | 4 +--- engines/titanic/true_talk/tt_word.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp index 578ffe569a..2a3beff3d6 100644 --- a/engines/titanic/true_talk/st_vocab.cpp +++ b/engines/titanic/true_talk/st_vocab.cpp @@ -34,13 +34,11 @@ STVocab::STVocab(int val): _field0(0), _field4(0), _word(nullptr), int STVocab::load(const CString &name) { SimpleFile *file = g_vm->_fileReader._owner->openResource(name); int result = 0; - int param = -1; - int mode = 0; bool skipFlag; while (!result && !file->eos()) { skipFlag = false; - int param = file->readNumber(); + int mode = file->readNumber(); TTString space(" "); switch (mode) { diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp index 0bc3611589..3d0aae5f67 100644 --- a/engines/titanic/true_talk/tt_word.cpp +++ b/engines/titanic/true_talk/tt_word.cpp @@ -93,8 +93,17 @@ TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5 } int TTWord3::load(SimpleFile *file) { - // TODO - return 0; + CString str; + int val1, val2; + + if (!TTWord::load(file, 2) && file->scanf("%d %d %d", &str, &val1, &val2)) { + _field34 = readNumber(str.c_str()); + _field30 = val1; + _field3C = val2; + return 0; + } else { + return 3; + } } /*------------------------------------------------------------------------*/ -- cgit v1.2.3