mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 19:36:21 +00:00
SHERLOCK: RT: Initial implementation of cmdWalkHolmesToCoords
This commit is contained in:
parent
91558e5f25
commit
9c66934608
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user