diff options
author | Paul Gilbert | 2015-05-24 21:28:12 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-24 21:28:12 -0400 |
commit | 5513f725102ad95b748810328a123d7a90ddd24a (patch) | |
tree | 7fa5767f591ee5a88e918b3feef9d766fccba4b3 /engines/sherlock/talk.cpp | |
parent | f9a2d091e9d3174b767221ce2f1379a6e86e80d0 (diff) | |
download | scummvm-rg350-5513f725102ad95b748810328a123d7a90ddd24a.tar.gz scummvm-rg350-5513f725102ad95b748810328a123d7a90ddd24a.tar.bz2 scummvm-rg350-5513f725102ad95b748810328a123d7a90ddd24a.zip |
SHERLOCK: Implement cmdSetNPCWalkGraphics method
Diffstat (limited to 'engines/sherlock/talk.cpp')
-rw-r--r-- | engines/sherlock/talk.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 8d553d65d0..3e3fccee30 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -1164,7 +1164,7 @@ void Talk::doScript(const Common::String &script) { // Start of comment, so skip over it while (*str++ != '}') ; - } else if (_opcodeTable[c - 128]) { + } else if (c >= 128 && c <= 227 && _opcodeTable[c - 128]) { // Handle control code switch ((this->*_opcodeTable[c - 128])(str)) { case RET_EXIT: @@ -1789,7 +1789,14 @@ ScalpelTalk::ScalpelTalk(SherlockEngine *vm) : Talk(vm) { (OpcodeMethod)&ScalpelTalk::cmdEnableEndKey, (OpcodeMethod)&ScalpelTalk::cmdDisableEndKey, - (OpcodeMethod)&ScalpelTalk::cmdCarriageReturn + (OpcodeMethod)&ScalpelTalk::cmdCarriageReturn, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; _opcodeTable = OPCODE_METHODS; @@ -2065,7 +2072,29 @@ OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) { error("TODO: script o OpcodeReturn TattooTalk::cmdSetNPCVerbCAnimation(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdSetNPCVerbScript(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdSetNPCVerbTarget(const byte *&str) { error("TODO: script opcode"); } -OpcodeReturn TattooTalk::cmdSetNPCWalkGraphics(const byte *&str) { error("TODO: script opcode"); } + +OpcodeReturn TattooTalk::cmdSetNPCWalkGraphics(const byte *&str) { + ++str; + int npc = *str - 1; + People &people = *_vm->_people; + Person &person = people[npc]; + + // Build up walk library name for the given NPC + person._walkVGSName = ""; + for (int idx = 0; idx < 8; ++idx) { + if (str[idx + 1] != '~') + person._walkVGSName += str[idx + 1]; + else + break; + } + person._walkVGSName += ".VGS"; + + people._forceWalkReload = true; + str += 8; + + return RET_SUCCESS; +} + OpcodeReturn TattooTalk::cmdSetSceneEntryFlag(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdSetTalkSequence(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdSetWalkControl(const byte *&str) { error("TODO: script opcode"); } |