diff options
author | Gregory Montoir | 2004-01-02 20:05:18 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-02 20:05:18 +0000 |
commit | 8bd9ce2949ca7e607da2aa18d3af7cd8e8d25a09 (patch) | |
tree | fbf95fb2723091aa63c94e9b4729dc05420b4d3e /queen/talk.cpp | |
parent | bf23fe5fea5713a38954b43c4d13abb8320938b4 (diff) | |
download | scummvm-rg350-8bd9ce2949ca7e607da2aa18d3af7cd8e8d25a09.tar.gz scummvm-rg350-8bd9ce2949ca7e607da2aa18d3af7cd8e8d25a09.tar.bz2 scummvm-rg350-8bd9ce2949ca7e607da2aa18d3af7cd8e8d25a09.zip |
- added missing MOVE_SPEAK code (only CHEF.DOG seems to use that)
- clear Talk::_dialogueTree[0] to avoid problems when accessing oldLevel / level 0
svn-id: r12093
Diffstat (limited to 'queen/talk.cpp')
-rw-r--r-- | queen/talk.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/queen/talk.cpp b/queen/talk.cpp index 4b401f76a8..eeb9bce9d8 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -30,6 +30,7 @@ #include "queen/resource.h" #include "queen/sound.h" #include "queen/state.h" +#include "queen/walk.h" #include "common/file.h" @@ -261,7 +262,6 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) { // Check selected person to see if any Gamestates need setting int16 index = _dialogueTree[level][0].gameStateIndex; - if (index > 0) _vm->logic()->gameState(index, _dialogueTree[level][0].gameStateValue); @@ -462,6 +462,7 @@ void Talk::load(const char *filename) { ptr = dataPtr; + memset(&_dialogueTree[0], 0, sizeof(_dialogueTree[0])); for (i = 1; i <= _levelMax; i++) for (int j = 0; j <= 5; j++) { ptr += 2; @@ -521,10 +522,13 @@ void Talk::initialTalk() { } -int Talk::getSpeakCommand(const char *sentence, unsigned &index) { +int Talk::getSpeakCommand(const Person *person, const char *sentence, unsigned &index) { // Lines 1299-1362 in talk.c int commandCode = SPEAK_DEFAULT; + // cyx: what about something like: + // uint16 id = (sentence[index] << 8) | sentence[index + 1]; + // switch(id) { case 'AO': ... } switch (sentence[index]) { case 'A': if (sentence[index + 1] == 'O') @@ -581,10 +585,13 @@ int Talk::getSpeakCommand(const char *sentence, unsigned &index) { commandCode = atoi(sentence + index + 2); int x = atoi(sentence + index + 5); int y = atoi(sentence + index + 9); - debug(6, "Calling MOVE_SPEAK(person, %i, %i)",x, y); - // XXX MOVE_SPEAK(person, x, y) + if (0 == strcmp(person->name, "JOE")) + _vm->walk()->moveJoe(0, x, y, _vm->input()->cutawayRunning()); + else + _vm->walk()->movePerson(person, x, y, _vm->logic()->numFrames(), 0); index += 11; - /// XXX personWalking = true; + // if(JOEWALK==3) CUTQUIT=0; + // XXX personWalking = true; } else warning("Unknown command string: '%2s'", sentence + index); @@ -657,7 +664,7 @@ bool Talk::speak(const char *sentence, Person *person, const char *voiceFilePref int segmentLength = i - segmentStart; i++; - int command = getSpeakCommand(sentence, i); + int command = getSpeakCommand(person, sentence, i); if (SPEAK_NONE != command) { speakSegment( |