From dbf82dd92af5f0b8b04dfa4e6175740dc80e24ad Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 1 Jul 2015 19:20:18 -0400 Subject: SHERLOCK: RT: Move ADJUST_CORD usage to initial anim loading --- engines/sherlock/objects.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/sherlock/objects.cpp') diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp index 1d2cb1b725..a42fce5ea9 100644 --- a/engines/sherlock/objects.cpp +++ b/engines/sherlock/objects.cpp @@ -39,6 +39,12 @@ namespace Sherlock { #define CLEAR_DIST_X 5 #define CLEAR_DIST_Y 0 +#define ADJUST_COORD(COORD) \ + if (COORD.x != -1) \ + COORD.x *= FIXED_INT_MULTIPLIER; \ + if (COORD.y != -1) \ + COORD.y *= FIXED_INT_MULTIPLIER + SherlockEngine *BaseObject::_vm; bool BaseObject::_countCAnimFrames; @@ -1430,28 +1436,31 @@ void CAnim::load(Common::SeekableReadStream &s, bool isRoseTattoo, uint32 dataOf _goto[0].x = s.readSint16LE(); _goto[0].y = s.readSint16LE(); _goto[0]._facing = s.readSint16LE(); + ADJUST_COORD(_goto[0]); if (isRoseTattoo) { // Get Goto position and facing for second NPC _goto[1].x = s.readSint16LE(); _goto[1].y = s.readSint16LE(); _goto[1]._facing = s.readSint16LE(); + ADJUST_COORD(_goto[1]); } else { // For Serrated Scalpel, adjust the loaded co-ordinates _goto[0].x = _goto[0].x * FIXED_INT_MULTIPLIER / 100; _goto[0].y = _goto[0].y * FIXED_INT_MULTIPLIER / 100; - } _teleport[0].x = s.readSint16LE(); _teleport[0].y = s.readSint16LE(); _teleport[0]._facing = s.readSint16LE(); + ADJUST_COORD(_teleport[0]); if (isRoseTattoo) { // Get Teleport position and facing for second NPC _teleport[1].x = s.readSint16LE(); _teleport[1].y = s.readSint16LE(); _teleport[1]._facing = s.readSint16LE(); + ADJUST_COORD(_teleport[1]); } else { // For Serrated Scalpel, adjust the loaded co-ordinates _teleport[0].x = _teleport[0].x * FIXED_INT_MULTIPLIER / 100; -- cgit v1.2.3