[Scummvm-cvs-logs] scummvm master -> 9c66934608cd6f756c170bcb050ee4d6452f0a36
bluegr
bluegr at gmail.com
Fri Jun 12 21:04:40 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9c66934608 SHERLOCK: RT: Initial implementation of cmdWalkHolmesToCoords
Commit: 9c66934608cd6f756c170bcb050ee4d6452f0a36
https://github.com/scummvm/scummvm/commit/9c66934608cd6f756c170bcb050ee4d6452f0a36
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-12T22:03:15+03:00
Commit Message:
SHERLOCK: RT: Initial implementation of cmdWalkHolmesToCoords
Changed paths:
engines/sherlock/scalpel/scalpel_talk.cpp
engines/sherlock/scalpel/scalpel_talk.h
engines/sherlock/talk.cpp
engines/sherlock/talk.h
engines/sherlock/tattoo/tattoo_talk.cpp
engines/sherlock/tattoo/tattoo_talk.h
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 3dc99c2..17b251f 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -452,6 +452,19 @@ OpcodeReturn ScalpelTalk::cmdRemovePortrait(const byte *&str) {
return RET_SUCCESS;
}
+OpcodeReturn ScalpelTalk::cmdWalkToCoords(const byte *&str) {
+ People &people = *_vm->_people;
+ ++str;
+
+ people.walkToCoords(Point32(((str[0] - 1) * 256 + str[1] - 1) * FIXED_INT_MULTIPLIER,
+ str[2] * FIXED_INT_MULTIPLIER), str[3] - 1);
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ str += 3;
+ return RET_SUCCESS;
+}
+
OpcodeReturn ScalpelTalk::cmdSfxCommand(const byte *&str) {
Sound &sound = *_vm->_sound;
Common::String tempString;
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index a3ac0f2..5794813 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -51,6 +51,7 @@ private:
OpcodeReturn cmdSfxCommand(const byte *&str);
OpcodeReturn cmdSummonWindow(const byte *&str);
OpcodeReturn cmdCarriageReturn(const byte *&str);
+ OpcodeReturn cmdWalkToCoords(const byte *&str);
protected:
/**
* Display the talk interface window
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 17e7333..bfb5a40 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -1455,19 +1455,6 @@ OpcodeReturn Talk::cmdWalkToCAnimation(const byte *&str) {
return _talkToAbort ? RET_EXIT : RET_SUCCESS;
}
-OpcodeReturn Talk::cmdWalkToCoords(const byte *&str) {
- People &people = *_vm->_people;
- ++str;
-
- people.walkToCoords(Point32(((str[0] - 1) * 256 + str[1] - 1) * FIXED_INT_MULTIPLIER,
- str[2] * FIXED_INT_MULTIPLIER), str[3] - 1);
- if (_talkToAbort)
- return RET_EXIT;
-
- str += 3;
- return RET_SUCCESS;
-}
-
void Talk::talkWait(const byte *&str) {
if (!_pauseFlag && _charCount < 160)
_charCount = 160;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index bbe3e86..e47f2d9 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -252,7 +252,6 @@ protected:
OpcodeReturn cmdStealthModeDeactivate(const byte *&str);
OpcodeReturn cmdToggleObject(const byte *&str);
OpcodeReturn cmdWalkToCAnimation(const byte *&str);
- OpcodeReturn cmdWalkToCoords(const byte *&str);
protected:
/**
* Display the talk interface window
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index a46ab40..ea1f16d 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -43,7 +43,7 @@ const byte TATTOO_OPCODES[] = {
0, // OP_REMOVE_PORTRAIT
0, // OP_CLEAR_WINDOW
176, // OP_ADJUST_OBJ_SEQUENCE
- 177, // OP_WALK_TO_COORDS
+ 177, // OP_WALK_HOlMES_TO_COORDS
178, // OP_PAUSE_WITHOUT_CONTROL
179, // OP_BANISH_WINDOW
0, // OP_SUMMON_WINDOW
@@ -124,7 +124,7 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm) {
(OpcodeMethod)&TattooTalk::cmdMouseOnOff,
(OpcodeMethod)&TattooTalk::cmdSetWalkControl,
(OpcodeMethod)&TattooTalk::cmdAdjustObjectSequence,
- (OpcodeMethod)&TattooTalk::cmdWalkToCoords,
+ (OpcodeMethod)&TattooTalk::cmdWalkHolmesToCoords,
(OpcodeMethod)&TattooTalk::cmdPauseWithoutControl,
(OpcodeMethod)&TattooTalk::cmdBanishWindow,
(OpcodeMethod)&TattooTalk::cmdSetTalkSequence,
@@ -234,6 +234,24 @@ OpcodeReturn TattooTalk::cmdMouseOnOff(const byte *&str) {
return RET_SUCCESS;
}
+OpcodeReturn TattooTalk::cmdWalkHolmesToCoords(const byte *&str) {
+ People &people = *_vm->_people;
+ ++str;
+
+ int x = (str[0] - 1) * 256 + str[1] - 1;
+ if (x > 16384)
+ x = -1 * (x - 16384);
+ // TODO: The RT walkToCoords call has an extra parameter, person, which is 0 (Holmes) here
+ warning("TODO: cmdWalkHolmesToCoords - call RT walkToCoords variant");
+ people.walkToCoords(Point32(x * FIXED_INT_MULTIPLIER,
+ ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER), DIRECTION_CONVERSION[str[4] - 1]);
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ str += 4;
+ return RET_SUCCESS;
+}
+
OpcodeReturn TattooTalk::cmdGotoScene(const byte *&str) {
Map &map = *_vm->_map;
People &people = *_vm->_people;
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index ab032a7..d7464c3 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -40,6 +40,7 @@ private:
OpcodeReturn cmdSwitchSpeaker(const byte *&str);
OpcodeReturn cmdMouseOnOff(const byte *&str);
OpcodeReturn cmdGotoScene(const byte *&str);
+ OpcodeReturn cmdWalkHolmesToCoords(const byte *&str);
OpcodeReturn cmdNextSong(const byte *&str);
OpcodeReturn cmdPassword(const byte *&str);
OpcodeReturn cmdPlaySong(const byte *&str);
More information about the Scummvm-git-logs
mailing list