diff options
author | Filippos Karapetis | 2015-06-07 20:51:16 +0300 |
---|---|---|
committer | Filippos Karapetis | 2015-06-07 20:51:45 +0300 |
commit | dc43979a9c73e7f93733d050716b8afd02a1741c (patch) | |
tree | 3dd525c18a4fb28aaf41a47554889eb3c1126cfb /engines | |
parent | 0f8f40c11185edd361bedf443f79b64328be6088 (diff) | |
download | scummvm-rg350-dc43979a9c73e7f93733d050716b8afd02a1741c.tar.gz scummvm-rg350-dc43979a9c73e7f93733d050716b8afd02a1741c.tar.bz2 scummvm-rg350-dc43979a9c73e7f93733d050716b8afd02a1741c.zip |
SHERLOCK: Split cmdGotoScene and add the Rose Tattoo implementation
This also adds some code missing from the Serrated Scalpel implementation
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.cpp | 34 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.h | 1 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 28 | ||||
-rw-r--r-- | engines/sherlock/talk.h | 1 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.cpp | 36 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.h | 1 |
6 files changed, 72 insertions, 29 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index b3ac27c137..2d9db77552 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -287,6 +287,40 @@ OpcodeReturn ScalpelTalk::cmdSwitchSpeaker(const byte *&str) { return RET_SUCCESS; } +OpcodeReturn ScalpelTalk::cmdGotoScene(const byte *&str) { + Map &map = *_vm->_map; + People &people = *_vm->_people; + Scene &scene = *_vm->_scene; + scene._goToScene = str[1] - 1; + + if (scene._goToScene != 100) { + // Not going to the map overview + map._oldCharPoint = scene._goToScene; + map._overPos.x = map[scene._goToScene].x * 100 - 600; + map._overPos.y = map[scene._goToScene].y * 100 + 900; + + // Run a canimation? + if (str[2] > 100) { + people._hSavedFacing = str[2]; + people._hSavedPos = Point32(160, 100); + } else { + people._hSavedFacing = str[2] - 1; + int32 posX = (str[3] - 1) * 256 + str[4] - 1; + int32 posY = str[5] - 1; + people._hSavedPos = Point32(posX, posY); + } + } // if (scene._goToScene != 100) + + str += 6; + + _scriptMoreFlag = (scene._goToScene == 100) ? 2 : 1; + _scriptSaveIndex = str - _scriptStart; + _endStr = true; + _wait = 0; + + return RET_SUCCESS; +} + OpcodeReturn ScalpelTalk::cmdAssignPortraitLocation(const byte *&str) { People &people = *_vm->_people; diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h index eb97b5760d..6a11824ee3 100644 --- a/engines/sherlock/scalpel/scalpel_talk.h +++ b/engines/sherlock/scalpel/scalpel_talk.h @@ -39,6 +39,7 @@ class ScalpelTalk : public Talk { private: OpcodeReturn cmdSwitchSpeaker(const byte *&str); OpcodeReturn cmdAssignPortraitLocation(const byte *&str); + OpcodeReturn cmdGotoScene(const byte *&str); OpcodeReturn cmdClearInfoLine(const byte *&str); OpcodeReturn cmdClearWindow(const byte *&str); OpcodeReturn cmdDisplayInfoLine(const byte *&str); diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index fe1ff705fd..e11fc66447 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -1336,34 +1336,6 @@ OpcodeReturn Talk::cmdEnableEndKey(const byte *&str) { return RET_SUCCESS; } -OpcodeReturn Talk::cmdGotoScene(const byte *&str) { - Map &map = *_vm->_map; - People &people = *_vm->_people; - Scene &scene = *_vm->_scene; - scene._goToScene = str[1] - 1; - - if (scene._goToScene != 100) { - // Not going to the map overview - map._oldCharPoint = scene._goToScene; - map._overPos.x = map[scene._goToScene].x * 100 - 600; - map._overPos.y = map[scene._goToScene].y * 100 + 900; - - // Run a canimation? - if (str[2] > 100) { - people._hSavedFacing = str[2]; - people._hSavedPos = Common::Point(160, 100); - } - } - str += 6; - - _scriptMoreFlag = (scene._goToScene == 100) ? 2 : 1; - _scriptSaveIndex = str - _scriptStart; - _endStr = true; - _wait = 0; - - return RET_SUCCESS; -} - OpcodeReturn Talk::cmdHolmesOff(const byte *&str) { People &people = *_vm->_people; people[PLAYER]._type = REMOVE; diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index ec8f52699e..fbcc9e7ab2 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -238,7 +238,6 @@ protected: OpcodeReturn cmdCallTalkFile(const byte *&str); OpcodeReturn cmdDisableEndKey(const byte *&str); OpcodeReturn cmdEnableEndKey(const byte *&str); - OpcodeReturn cmdGotoScene(const byte *&str); OpcodeReturn cmdHolmesOff(const byte *&str); OpcodeReturn cmdHolmesOn(const byte *&str); OpcodeReturn cmdPause(const byte *&str); diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp index 9e20ad4237..92e64a87cd 100644 --- a/engines/sherlock/tattoo/tattoo_talk.cpp +++ b/engines/sherlock/tattoo/tattoo_talk.cpp @@ -230,6 +230,42 @@ OpcodeReturn TattooTalk::cmdMouseOnOff(const byte *&str) { return RET_SUCCESS; } +OpcodeReturn TattooTalk::cmdGotoScene(const byte *&str) { + Map &map = *_vm->_map; + People &people = *_vm->_people; + Scene &scene = *_vm->_scene; + scene._goToScene = str[1] - 1; + + if (scene._goToScene != 100) { + // Not going to the map overview + map._oldCharPoint = scene._goToScene; + + // Run a canimation? + if (str[2] > 100) { + people._hSavedFacing = str[2]; + people._hSavedPos = Point32(160, 100); + } else { + people._hSavedFacing = str[2] - 1; + int32 posX = (str[3] - 1) * 256 + str[4] - 1; + if (posX > 16384) + posX = -1 * (posX - 16384); + int32 posY = (str[5] - 1) * 256 + str[6] - 1; + people._hSavedPos = Point32(posX, posY); + } + + _scriptMoreFlag = 1; + } // if (scene._goToScene != 100) + + str += 7; + if (scene._goToScene != 100) + _scriptSaveIndex = str - _scriptStart; + + _endStr = true; + _wait = 0; + + return RET_SUCCESS; +} + OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) { Sound &sound = *_vm->_sound; diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h index 0b5e7e4ae7..ab032a7434 100644 --- a/engines/sherlock/tattoo/tattoo_talk.h +++ b/engines/sherlock/tattoo/tattoo_talk.h @@ -39,6 +39,7 @@ class TattooTalk : public Talk { private: OpcodeReturn cmdSwitchSpeaker(const byte *&str); OpcodeReturn cmdMouseOnOff(const byte *&str); + OpcodeReturn cmdGotoScene(const byte *&str); OpcodeReturn cmdNextSong(const byte *&str); OpcodeReturn cmdPassword(const byte *&str); OpcodeReturn cmdPlaySong(const byte *&str); |