[Scummvm-cvs-logs] scummvm master -> 5dc79a8f3272f8e5c9131fac925d4533a25ab4d9

dreammaster dreammaster at scummvm.org
Sat Jun 13 04:21:58 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:
5dc79a8f32 SHERLOCK: RT: Implement animation structure changes


Commit: 5dc79a8f3272f8e5c9131fac925d4533a25ab4d9
    https://github.com/scummvm/scummvm/commit/5dc79a8f3272f8e5c9131fac925d4533a25ab4d9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-12T22:20:28-04:00

Commit Message:
SHERLOCK: RT: Implement animation structure changes

Changed paths:
    engines/sherlock/objects.cpp
    engines/sherlock/objects.h
    engines/sherlock/scalpel/scalpel_scene.cpp
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/scene.cpp
    engines/sherlock/talk.cpp
    engines/sherlock/tattoo/tattoo_scene.cpp



diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 9e18f77..ee04644 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -1527,19 +1527,36 @@ void CAnim::load(Common::SeekableReadStream &s, bool isRoseTattoo) {
 		_flags = s.readByte();
 	}
 
-	_goto.x = s.readSint16LE();
-	_goto.y = s.readSint16LE();
-	_gotoDir = s.readSint16LE();
-	_teleportPos.x = s.readSint16LE();
-	_teleportPos.y = s.readSint16LE();
-	if (!isRoseTattoo) {
-		_goto.x = _goto.x * FIXED_INT_MULTIPLIER / 100;
-		_goto.y = _goto.y * FIXED_INT_MULTIPLIER / 100;
-		_teleportPos.x = _teleportPos.x * FIXED_INT_MULTIPLIER / 100;
-		_teleportPos.y = _teleportPos.y * FIXED_INT_MULTIPLIER / 100;
+	_goto[0].x = s.readSint16LE();
+	_goto[0].y = s.readSint16LE();
+	_goto[0]._facing = s.readSint16LE();
+
+	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();
+	} 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;
+
 	}
 
-	_teleportDir = s.readSint16LE();
+	_teleport[0].x = s.readSint16LE();
+	_teleport[0].y = s.readSint16LE();
+	_teleport[0]._facing = s.readSint16LE();
+
+	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();
+	} else {
+		// For Serrated Scalpel, adjust the loaded co-ordinates
+		_teleport[0].x = _teleport[0].x * FIXED_INT_MULTIPLIER / 100;
+		_teleport[0].y = _teleport[0].y * FIXED_INT_MULTIPLIER / 100;
+	}
 }
 
 void CAnim::load3DO(Common::SeekableReadStream &s) {
@@ -1553,13 +1570,13 @@ void CAnim::load3DO(Common::SeekableReadStream &s) {
 
 	_type = (SpriteType)s.readUint16BE();
 
-	_goto.x = s.readSint16BE();
-	_goto.y = s.readSint16BE();
-	_gotoDir = s.readSint16BE();
+	_goto[0].x = s.readSint16BE();
+	_goto[0].y = s.readSint16BE();
+	_goto[0]._facing = s.readSint16BE();
 
-	_teleportPos.x = s.readSint16BE();
-	_teleportPos.y = s.readSint16BE();
-	_teleportDir = s.readSint16BE();
+	_teleport[0].x = s.readSint16BE();
+	_teleport[0].y = s.readSint16BE();
+	_teleport[0]._facing = s.readSint16BE();
 
 	char buffer[12];
 	s.read(buffer, 12);
@@ -1570,10 +1587,10 @@ void CAnim::load3DO(Common::SeekableReadStream &s) {
 
 	s.skip(3); // Filler
 
-	_goto.x = _goto.x * FIXED_INT_MULTIPLIER / 100;
-	_goto.y = _goto.y * FIXED_INT_MULTIPLIER / 100;
-	_teleportPos.x = _teleportPos.x * FIXED_INT_MULTIPLIER / 100;
-	_teleportPos.y = _teleportPos.y * FIXED_INT_MULTIPLIER / 100;
+	_goto[0].x = _goto[0].x * FIXED_INT_MULTIPLIER / 100;
+	_goto[0].y = _goto[0].y * FIXED_INT_MULTIPLIER / 100;
+	_teleport[0].x = _teleport[0].x * FIXED_INT_MULTIPLIER / 100;
+	_teleport[0].y = _teleport[0].y * FIXED_INT_MULTIPLIER / 100;
 }
 
 /*----------------------------------------------------------------*/
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h
index a22606b..6035bb4 100644
--- a/engines/sherlock/objects.h
+++ b/engines/sherlock/objects.h
@@ -433,15 +433,21 @@ public:
 	void setObjTalkSequence(int seq);
 };
 
+
+class PositionFacing : public Point32 {
+public:
+	int _facing;
+
+	PositionFacing() : Point32(), _facing(0) {}
+};
+
 struct CAnim {
 	Common::String _name;			// Name
 	Common::Point _position;		// Position
 	int _size;						// Size of uncompressed animation
 	int _flags;						// Tells if can be walked behind
-	Point32 _goto;			// coords holmes should walk to before starting canim
-	int _gotoDir;
-	Point32 _teleportPos;		// Location Holmes shoul teleport to after
-	int _teleportDir;					// playing canim
+	PositionFacing _goto[2];		// Position Holmes (and NPC in Rose Tattoo) should walk to before anim starts
+	PositionFacing _teleport[2];	// Location Holmes (and NPC) shoul teleport to after playing canim
 
 	// Scalpel specific
 	byte _sequences[MAX_FRAME];		// Animation sequences
diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp
index 47ec639..a1943e5 100644
--- a/engines/sherlock/scalpel/scalpel_scene.cpp
+++ b/engines/sherlock/scalpel/scalpel_scene.cpp
@@ -508,16 +508,16 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
 	CAnim &cAnim = _cAnim[cAnimNum];
 	if (playRate < 0) {
 		// Reverse direction
-		walkPos = cAnim._teleportPos;
-		walkDir = cAnim._teleportDir;
-		tpPos = cAnim._goto;
-		tpDir = cAnim._gotoDir;
+		walkPos = cAnim._teleport[0];
+		walkDir = cAnim._teleport[0]._facing;
+		tpPos = cAnim._goto[0];
+		tpDir = cAnim._goto[0]._facing;
 	} else {
 		// Forward direction
-		walkPos = cAnim._goto;
-		walkDir = cAnim._gotoDir;
-		tpPos = cAnim._teleportPos;
-		tpDir = cAnim._teleportDir;
+		walkPos = cAnim._goto[0];
+		walkDir = cAnim._goto[0]._facing;
+		tpPos = cAnim._teleport[0];
+		tpDir = cAnim._teleport[0]._facing;
 	}
 
 	CursorId oldCursor = events.getCursor();
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 739eb5d..dfe4d25 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -2200,11 +2200,11 @@ void ScalpelUserInterface::checkAction(ActionType &action, const char *const mes
 
 			if (action._cAnimNum != 99) {
 				if (action._cAnimSpeed & REVERSE_DIRECTION) {
-					pt = anim._teleportPos;
-					dir = anim._teleportDir;
+					pt = anim._teleport[0];
+					dir = anim._teleport[0]._facing;
 				} else {
-					pt = anim._goto;
-					dir = anim._gotoDir;
+					pt = anim._goto[0];
+					dir = anim._goto[0]._facing;
 				}
 			}
 		} else {
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index a1039d9..2e80f07 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -1070,13 +1070,13 @@ void Scene::transitionToScene() {
 	// Start any initial animation for the scene
 	if (cAnimNum != -1) {
 		CAnim &c = _cAnim[cAnimNum];
-		Common::Point pt = c._goto;
+		PositionFacing pt = c._goto[0];
 
-		c._goto = Common::Point(-1, -1);
+		c._goto[0].x = c._goto[0].y = -1;
 		people[PLAYER]._position = Common::Point(0, 0);
 
 		startCAnim(cAnimNum, 1);
-		c._goto = pt;
+		c._goto[0] = pt;
 	}
 }
 
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 5127d1e..65d9d21 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -1452,7 +1452,7 @@ OpcodeReturn Talk::cmdWalkToCAnimation(const byte *&str) {
 
 	++str;
 	CAnim &animation = scene._cAnim[str[0] - 1];
-	people.walkToCoords(animation._goto, animation._gotoDir);
+	people.walkToCoords(animation._goto[0], animation._goto[0]._facing);
 	
 	return _talkToAbort ? RET_EXIT : RET_SUCCESS;
 }
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 5ebf38b..ce20f17 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -820,7 +820,7 @@ void TattooScene::setNPCPath(int npc) {
 		return;
 
 	// Turn off all the NPCs, since the talk script will turn them back on as needed
-	for (uint idx = 1; idx < MAX_CHARACTERS; ++idx)
+	for (int idx = 1; idx < MAX_CHARACTERS; ++idx)
 		people[idx]._type = INVALID;
 
 	// Call the path script for the scene






More information about the Scummvm-git-logs mailing list