[Scummvm-cvs-logs] scummvm master -> 6b3fe382ec70ac027bb87722fab0d7d612d42ea7

dreammaster dreammaster at scummvm.org
Wed Jul 1 04:51:03 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:
6b3fe382ec SHERLOCK: Change _lookPosition to use PositionFacing


Commit: 6b3fe382ec70ac027bb87722fab0d7d612d42ea7
    https://github.com/scummvm/scummvm/commit/6b3fe382ec70ac027bb87722fab0d7d612d42ea7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-30T22:50:00-04:00

Commit Message:
SHERLOCK: Change _lookPosition to use PositionFacing

Changed paths:
    engines/sherlock/objects.cpp
    engines/sherlock/objects.h
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/talk.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp



diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 0a4b7e9..1d2cb1b 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -66,7 +66,6 @@ BaseObject::BaseObject() {
 	_aType = OBJECT;
 	_lookFrames = 0;
 	_seqCounter = 0;
-	_lookFacing = 0;
 	_lookcAnim = 0;
 	_seqStack = 0;
 	_seqTo = 0;
@@ -986,7 +985,7 @@ void Object::load(Common::SeekableReadStream &s, bool isRoseTattoo) {
 		_lookPosition.x = s.readUint16LE() * FIXED_INT_MULTIPLIER / 100;
 		_lookPosition.y = s.readByte() * FIXED_INT_MULTIPLIER;
 	}
-	_lookFacing = s.readByte();
+	_lookPosition._facing = s.readByte();
 	_lookcAnim = s.readByte();
 
 	if (!isRoseTattoo)
@@ -1113,7 +1112,7 @@ void Object::load3DO(Common::SeekableReadStream &s) {
 	// Unverified END
 
 	_lookPosition.y = s.readByte() * FIXED_INT_MULTIPLIER;
-	_lookFacing = s.readByte();
+	_lookPosition._facing = s.readByte();
 
 	// Unverified
 	_lookcAnim = s.readByte();
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h
index 7e94dd2..60b5b33 100644
--- a/engines/sherlock/objects.h
+++ b/engines/sherlock/objects.h
@@ -117,6 +117,12 @@ public:
 	void operator-=(const Point32 &delta) { x -= delta.x; y -= delta.y; }
 };
 
+class PositionFacing : public Point32 {
+public:
+	int _facing;
+
+	PositionFacing() : Point32(), _facing(0) {}
+};
 
 struct WalkSequence {
 	Common::String _vgsName;
@@ -210,8 +216,7 @@ public:
 	AType _aType;					// Tells if this is an object, person, talk, etc.
 	int _lookFrames;				// How many frames to play of the look anim before pausing
 	int _seqCounter;				// How many times this sequence has been executed
-	Point32 _lookPosition;			// Where to walk when examining object
-	int _lookFacing;				// Direction to face when examining object
+	PositionFacing _lookPosition;	// Where to walk when examining object
 	int _lookcAnim;
 	int _seqStack;					// Allows gosubs to return to calling frame
 	int _seqTo;						// Allows 1-5, 8-3 type sequences encoded in 2 bytes
@@ -427,14 +432,6 @@ public:
 	virtual 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
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 684824c..8fcc92b 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -500,7 +500,7 @@ void ScalpelUserInterface::examine() {
 			scene.startCAnim(_cNum, canimSpeed);
 		} else if (obj._lookPosition.y != 0) {
 			// Need to walk to the object to be examined
-			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookFacing);
+			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookPosition._facing);
 		}
 
 		if (!talk._talkToAbort) {
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 1195ba0..11ae9b4 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -488,7 +488,7 @@ void Talk::talk(int objNum) {
 		events.setCursor(WAIT);
 		if (obj._lookPosition.y != 0)
 			// Need to walk to character first
-			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookFacing);
+			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookPosition._facing);
 		events.setCursor(ARROW);
 
 		if (!_talkToAbort)
@@ -503,7 +503,7 @@ void Talk::talk(int objNum) {
 		events.setCursor(WAIT);
 		if (obj._lookPosition.y != 0)
 			// Walk over to person to talk to
-			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookFacing);
+			people[HOLMES].walkToCoords(obj._lookPosition, obj._lookPosition._facing);
 		events.setCursor(ARROW);
 
 		if (!_talkToAbort) {
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 7de7845..107eeba 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -87,7 +87,7 @@ void TattooUserInterface::lookAtObject() {
 		} else if (_bgShape->_lookPosition.y != 0) {
 			// Need to walk to object before looking at it
 			people[HOLMES].walkToCoords(Common::Point(_bgShape->_lookPosition.x * FIXED_INT_MULTIPLIER,
-				_bgShape->_lookPosition.y * FIXED_INT_MULTIPLIER), _bgShape->_lookFacing);
+				_bgShape->_lookPosition.y * FIXED_INT_MULTIPLIER), _bgShape->_lookPosition._facing);
 		}
 
 		if (!talk._talkToAbort) {






More information about the Scummvm-git-logs mailing list