[Scummvm-cvs-logs] scummvm master -> 864dc6acb7915f9b45ce958ff0ad645de74019d5
bluegr
bluegr at gmail.com
Sat Jun 13 22:28: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:
864dc6acb7 SHERLOCK: Initial implementation of the NPC-related opcodes
Commit: 864dc6acb7915f9b45ce958ff0ad645de74019d5
https://github.com/scummvm/scummvm/commit/864dc6acb7915f9b45ce958ff0ad645de74019d5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-13T23:27:21+03:00
Commit Message:
SHERLOCK: Initial implementation of the NPC-related opcodes
This includes cmdWalkHolmesAndNPCToCAnimation, cmdWalkNPCToCAnimation,
cmdWalkNPCToCoords and cmdWalkHomesAndNPCToCoords
Changed paths:
engines/sherlock/tattoo/tattoo_people.cpp
engines/sherlock/tattoo/tattoo_people.h
engines/sherlock/tattoo/tattoo_talk.cpp
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index 7560ca1..609d3d7 100644
--- a/engines/sherlock/tattoo/tattoo_people.cpp
+++ b/engines/sherlock/tattoo/tattoo_people.cpp
@@ -243,7 +243,7 @@ void TattooPerson::gotoStand() {
}
void TattooPerson::setWalking() {
- error("TODO: setWalking");
+ warning("TODO: setWalking");
}
void TattooPerson::clearNPC() {
@@ -253,7 +253,11 @@ void TattooPerson::clearNPC() {
}
void TattooPerson::updateNPC() {
- // TODO
+ warning("TODO: updateNPC");
+}
+
+void TattooPerson::pushNPCPath() {
+ warning("TODO: pushNPCPath");
}
/*----------------------------------------------------------------*/
diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h
index 110063d..50a0cb1 100644
--- a/engines/sherlock/tattoo/tattoo_people.h
+++ b/engines/sherlock/tattoo/tattoo_people.h
@@ -103,6 +103,11 @@ public:
void updateNPC();
/**
+ * Push the NPC's path
+ */
+ void pushNPCPath();
+
+ /**
* This adjusts the sprites position, as well as it's animation sequence:
*/
virtual void adjustSprite();
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 78396c9..84ee63d 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -241,10 +241,12 @@ OpcodeReturn TattooTalk::cmdWalkHolmesToCoords(const byte *&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[HOLMES].walkToCoords(Point32(x * FIXED_INT_MULTIPLIER,
- ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER), DIRECTION_CONVERSION[str[4] - 1]);
+ people[HOLMES].walkToCoords(
+ Point32(x * FIXED_INT_MULTIPLIER, ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER),
+ DIRECTION_CONVERSION[str[4] - 1]
+ //HOLMES
+ );
if (_talkToAbort)
return RET_EXIT;
@@ -698,10 +700,115 @@ OpcodeReturn TattooTalk::cmdTalkInterruptsDisable(const byte *&str) { error("Dum
OpcodeReturn TattooTalk::cmdTalkInterruptsEnable(const byte *&str) { error("Dummy opcode cmdTalkInterruptsEnable called"); }
OpcodeReturn TattooTalk::cmdTurnSoundsOff(const byte *&str) { error("TODO: script opcode (cmdTurnSoundsOff)"); }
-OpcodeReturn TattooTalk::cmdWalkHolmesAndNPCToCAnimation(const byte *&str) { error("TODO: script opcode (cmdWalkHolmesAndNPCToCAnimation)"); }
-OpcodeReturn TattooTalk::cmdWalkNPCToCAnimation(const byte *&str) { error("TODO: script opcode (cmdWalkNPCToCAnimation)"); }
-OpcodeReturn TattooTalk::cmdWalkNPCToCoords(const byte *&str) { error("TODO: script opcode (cmdWalkNPCToCoords)"); }
-OpcodeReturn TattooTalk::cmdWalkHomesAndNPCToCoords(const byte *&str) { error("TODO: script opcode (cmdWalkHomesAndNPCToCoords)"); }
+
+OpcodeReturn TattooTalk::cmdWalkHolmesAndNPCToCAnimation(const byte *&str) {
+ int npcNum = *++str;
+ int cAnimNum = *++str;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
+ Scene &scene = *_vm->_scene;
+ CAnim &anim = scene._cAnim[cAnimNum];
+
+ if (person._npcStack == 0)
+ person.pushNPCPath();
+ person._npcMoved = true;
+
+ warning("TODO: cmdWalkNPCToCAnimation - walkBothToCoords call");
+ person.walkToCoords(
+ Point32(anim._goto[1].x * FIXED_INT_MULTIPLIER, anim._goto[1].y * FIXED_INT_MULTIPLIER),
+ anim._goto[1]._facing
+ //Point32(anim._goto[1].x * FIXED_INT_MULTIPLIER, anim._goto[1].y * FIXED_INT_MULTIPLIER),
+ //anim._goto[1]._facing,
+ //npcNum + 1
+ );
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdWalkNPCToCAnimation(const byte *&str) {
+ int npcNum = *++str;
+ int cAnimNum = *++str;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
+ Scene &scene = *_vm->_scene;
+ CAnim &anim = scene._cAnim[cAnimNum];
+
+ if (person._npcStack == 0)
+ person.pushNPCPath();
+ person._npcMoved = true;
+
+ warning("TODO: cmdWalkNPCToCAnimation - call RT walkToCoords variant");
+ person.walkToCoords(
+ Point32(anim._goto[1].x * FIXED_INT_MULTIPLIER, anim._goto[1].y * FIXED_INT_MULTIPLIER),
+ anim._goto[1]._facing
+ // npcNum + 1
+ );
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdWalkNPCToCoords(const byte *&str) {
+ int npcNum = *++str;
+ str++;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
+
+ if (person._npcStack == 0)
+ person.pushNPCPath();
+ person._npcMoved = true;
+
+ int x = (str[0] - 1) * 256 + str[1] - 1;
+ if (x > 16384)
+ x = -1 * (x - 16384);
+
+ warning("TODO: cmdWalkNPCToCoords - call RT walkToCoords variant");
+ person.walkToCoords(
+ Point32(x * FIXED_INT_MULTIPLIER, ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER),
+ DIRECTION_CONVERSION[str[4] - 1]
+ // npcNum + 1
+ );
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ str += 4;
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdWalkHomesAndNPCToCoords(const byte *&str) {
+ int npcNum = *++str;
+ str++;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
+
+ if (person._npcStack == 0)
+ person.pushNPCPath();
+ person._npcMoved = true;
+
+ int x = (str[0] - 1) * 256 + str[1] - 1;
+ if (x > 16384)
+ x = -1 * (x - 16384);
+ //int x1 = (str[5] - 1) * 256 + str[6] - 1;
+ //if (x1 > 16384)
+ // x1 = -1 * (x1 - 16384);
+
+ warning("TODO: cmdWalkHomesAndNPCToCoords - walkBothToCoords call");
+ person.walkToCoords(
+ Point32(x * FIXED_INT_MULTIPLIER, ((str[2] - 1) * 256 + str[3] - 1) * FIXED_INT_MULTIPLIER),
+ DIRECTION_CONVERSION[str[4] - 1]
+ //Point32(x1 * FIXED_INT_MULTIPLIER, ((str[7] - 1) * 256 + str[8] - 1) * FIXED_INT_MULTIPLIER),
+ //DIRECTION_CONVERSION[str[9] - 1],
+ //npcNum + 1
+ );
+ if (_talkToAbort)
+ return RET_EXIT;
+
+ str += 9;
+ return RET_SUCCESS;
+}
} // End of namespace Tattoo
More information about the Scummvm-git-logs
mailing list