SHERLOCK: Change _lookPosition to use PositionFacing

This commit is contained in:
Paul Gilbert 2015-06-30 22:50:00 -04:00
parent d2c4074fa6
commit 6b3fe382ec
5 changed files with 13 additions and 17 deletions

View file

@ -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();

View file

@ -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

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {