aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-11 22:02:33 -0400
committerPaul Gilbert2015-06-11 22:02:33 -0400
commit3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad (patch)
treef3780949461d600f733e33cea286f425d5f80619 /engines/sherlock/scalpel
parentf812447274fc1de46560e4e611c9d4cb9bf39beb (diff)
downloadscummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.tar.gz
scummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.tar.bz2
scummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.zip
SHERLOCK: Beginning of descendent Person classes
Tattoo has some different Sprite methods, and since Person descends from Sprite, need to create descendents from it. And this has also necessitated some refactoring of People class's _data array
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp18
-rw-r--r--engines/sherlock/scalpel/scalpel_map.cpp44
-rw-r--r--engines/sherlock/scalpel/scalpel_people.cpp121
-rw-r--r--engines/sherlock/scalpel/scalpel_people.h13
-rw-r--r--engines/sherlock/scalpel/scalpel_scene.cpp72
-rw-r--r--engines/sherlock/scalpel/scalpel_user_interface.cpp6
6 files changed, 196 insertions, 78 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index e0c91ee7c5..a3ada427ad 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -961,7 +961,7 @@ void ScalpelEngine::startScene() {
}
void ScalpelEngine::eraseMirror12() {
- Common::Point pt((*_people)[AL]._position.x / FIXED_INT_MULTIPLIER, (*_people)[AL]._position.y / FIXED_INT_MULTIPLIER);
+ Common::Point pt((*_people)[PLAYER]._position.x / FIXED_INT_MULTIPLIER, (*_people)[PLAYER]._position.y / FIXED_INT_MULTIPLIER);
// If player is in range of the mirror, then restore background from the secondary back buffer
if (Common::Rect(70, 100, 200, 200).contains(pt)) {
@@ -972,13 +972,13 @@ void ScalpelEngine::eraseMirror12() {
void ScalpelEngine::doMirror12() {
People &people = *_people;
- Person &player = people._player;
+ Person &player = people[PLAYER];
- Common::Point pt((*_people)[AL]._position.x / FIXED_INT_MULTIPLIER, (*_people)[AL]._position.y / FIXED_INT_MULTIPLIER);
+ Common::Point pt((*_people)[PLAYER]._position.x / FIXED_INT_MULTIPLIER, (*_people)[PLAYER]._position.y / FIXED_INT_MULTIPLIER);
int frameNum = player._walkSequences[player._sequenceNumber][player._frameNumber] +
player._walkSequences[player._sequenceNumber][0] - 2;
- switch ((*_people)[AL]._sequenceNumber) {
+ switch ((*_people)[PLAYER]._sequenceNumber) {
case WALK_DOWN:
frameNum -= 7;
break;
@@ -1021,12 +1021,12 @@ void ScalpelEngine::doMirror12() {
if (Common::Rect(80, 100, 145, 138).contains(pt)) {
// Get the frame of Sherlock to draw
- ImageFrame &imageFrame = (*people[AL]._images)[frameNum];
+ ImageFrame &imageFrame = (*people[PLAYER]._images)[frameNum];
// Draw the mirror image of Holmes
- bool flipped = people[AL]._sequenceNumber == WALK_LEFT || people[AL]._sequenceNumber == STOP_LEFT
- || people[AL]._sequenceNumber == WALK_UPRIGHT || people[AL]._sequenceNumber == STOP_UPRIGHT
- || people[AL]._sequenceNumber == WALK_DOWNLEFT || people[AL]._sequenceNumber == STOP_DOWNLEFT;
+ bool flipped = people[PLAYER]._sequenceNumber == WALK_LEFT || people[PLAYER]._sequenceNumber == STOP_LEFT
+ || people[PLAYER]._sequenceNumber == WALK_UPRIGHT || people[PLAYER]._sequenceNumber == STOP_UPRIGHT
+ || people[PLAYER]._sequenceNumber == WALK_DOWNLEFT || people[PLAYER]._sequenceNumber == STOP_DOWNLEFT;
_screen->_backBuffer1.transBlitFrom(imageFrame, pt + Common::Point(38, -imageFrame._frame.h - 25), flipped);
// Redraw the mirror borders to prevent the drawn image of Holmes from appearing outside of the mirror
@@ -1046,7 +1046,7 @@ void ScalpelEngine::doMirror12() {
}
void ScalpelEngine::flushMirror12() {
- Common::Point pt((*_people)[AL]._position.x / FIXED_INT_MULTIPLIER, (*_people)[AL]._position.y / FIXED_INT_MULTIPLIER);
+ Common::Point pt((*_people)[PLAYER]._position.x / FIXED_INT_MULTIPLIER, (*_people)[PLAYER]._position.y / FIXED_INT_MULTIPLIER);
// If player is in range of the mirror, then draw the entire mirror area to the screen
if (Common::Rect(70, 100, 200, 200).contains(pt))
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp
index bcb41abe73..3957f27457 100644
--- a/engines/sherlock/scalpel/scalpel_map.cpp
+++ b/engines/sherlock/scalpel/scalpel_map.cpp
@@ -155,7 +155,7 @@ int ScalpelMap::show() {
_drawMap = true;
_charPoint = -1;
_point = -1;
- people[AL]._position = _lDrawnPos = _overPos;
+ people[PLAYER]._position = _lDrawnPos = _overPos;
// Show place icons
showPlaces();
@@ -233,7 +233,7 @@ int ScalpelMap::show() {
}
if ((events._released || events._rightReleased) && _point != -1) {
- if (people[AL]._walkCount == 0) {
+ if (people[PLAYER]._walkCount == 0) {
people._walkDest = _points[_point] + Common::Point(4, 9);
_charPoint = _point;
@@ -247,7 +247,7 @@ int ScalpelMap::show() {
}
// Check if a scene has beeen selected and we've finished "moving" to it
- if (people[AL]._walkCount == 0) {
+ if (people[PLAYER]._walkCount == 0) {
if (_charPoint >= 1 && _charPoint < (int)_points.size())
exitFlag = true;
}
@@ -266,7 +266,7 @@ int ScalpelMap::show() {
}
freeSprites();
- _overPos = people[AL]._position;
+ _overPos = people[PLAYER]._position;
// Reset font
screen.setFont(oldFont);
@@ -288,7 +288,7 @@ void ScalpelMap::setupSprites() {
_shapes = new ImageFile("mapicon.vgs");
_iconShapes = new ImageFile("overicon.vgs");
_iconSave.create((*_shapes)[4]._width, (*_shapes)[4]._height, _vm->getPlatform());
- Person &p = people[AL];
+ Person &p = people[PLAYER];
p._description = " ";
p._type = CHARACTER;
p._position = Common::Point(12400, 5000);
@@ -353,11 +353,11 @@ void ScalpelMap::showPlaceName(int idx, bool highlighted) {
int width = screen.stringWidth(name);
if (!_cursorIndex) {
- saveIcon(people[AL]._imageFrame, _lDrawnPos);
+ saveIcon(people[PLAYER]._imageFrame, _lDrawnPos);
- bool flipped = people[AL]._sequenceNumber == MAP_DOWNLEFT || people[AL]._sequenceNumber == MAP_LEFT
- || people[AL]._sequenceNumber == MAP_UPLEFT;
- screen._backBuffer1.transBlitFrom(*people[AL]._imageFrame, _lDrawnPos, flipped);
+ bool flipped = people[PLAYER]._sequenceNumber == MAP_DOWNLEFT || people[PLAYER]._sequenceNumber == MAP_LEFT
+ || people[PLAYER]._sequenceNumber == MAP_UPLEFT;
+ screen._backBuffer1.transBlitFrom(*people[PLAYER]._imageFrame, _lDrawnPos, flipped);
}
if (highlighted) {
@@ -390,26 +390,26 @@ void ScalpelMap::updateMap(bool flushScreen) {
else
_savedPos.x = -1;
- people[AL].adjustSprite();
+ people[PLAYER].adjustSprite();
- _lDrawnPos.x = hPos.x = people[AL]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x;
- _lDrawnPos.y = hPos.y = people[AL]._position.y / FIXED_INT_MULTIPLIER - people[AL].frameHeight() - _bigPos.y;
+ _lDrawnPos.x = hPos.x = people[PLAYER]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x;
+ _lDrawnPos.y = hPos.y = people[PLAYER]._position.y / FIXED_INT_MULTIPLIER - people[PLAYER].frameHeight() - _bigPos.y;
// Draw the person icon
- saveIcon(people[AL]._imageFrame, hPos);
- if (people[AL]._sequenceNumber == MAP_DOWNLEFT || people[AL]._sequenceNumber == MAP_LEFT
- || people[AL]._sequenceNumber == MAP_UPLEFT)
- screen._backBuffer1.transBlitFrom(*people[AL]._imageFrame, hPos, true);
+ saveIcon(people[PLAYER]._imageFrame, hPos);
+ if (people[PLAYER]._sequenceNumber == MAP_DOWNLEFT || people[PLAYER]._sequenceNumber == MAP_LEFT
+ || people[PLAYER]._sequenceNumber == MAP_UPLEFT)
+ screen._backBuffer1.transBlitFrom(*people[PLAYER]._imageFrame, hPos, true);
else
- screen._backBuffer1.transBlitFrom(*people[AL]._imageFrame, hPos, false);
+ screen._backBuffer1.transBlitFrom(*people[PLAYER]._imageFrame, hPos, false);
if (flushScreen) {
screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT);
} else if (!_drawMap) {
if (hPos.x > 0 && hPos.y >= 0 && hPos.x < SHERLOCK_SCREEN_WIDTH && hPos.y < SHERLOCK_SCREEN_HEIGHT)
- screen.flushImage(people[AL]._imageFrame, Common::Point(people[AL]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x,
- people[AL]._position.y / FIXED_INT_MULTIPLIER - people[AL].frameHeight() - _bigPos.y),
- &people[AL]._oldPosition.x, &people[AL]._oldPosition.y, &people[AL]._oldSize.x, &people[AL]._oldSize.y);
+ screen.flushImage(people[PLAYER]._imageFrame, Common::Point(people[PLAYER]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x,
+ people[PLAYER]._position.y / FIXED_INT_MULTIPLIER - people[PLAYER].frameHeight() - _bigPos.y),
+ &people[PLAYER]._oldPosition.x, &people[PLAYER]._oldPosition.y, &people[PLAYER]._oldSize.x, &people[PLAYER]._oldSize.y);
if (osPos.x != -1)
screen.slamArea(osPos.x, osPos.y, osSize.x, osSize.y);
@@ -433,7 +433,7 @@ void ScalpelMap::walkTheStreets() {
// Check for any intermediate points between the two locations
if (path[0] || _charPoint > 50 || _oldCharPoint > 50) {
- people[AL]._sequenceNumber = -1;
+ people[PLAYER]._sequenceNumber = -1;
if (_charPoint == 51 || _oldCharPoint == 51) {
people.setWalking();
@@ -467,7 +467,7 @@ void ScalpelMap::walkTheStreets() {
people.setWalking();
}
} else {
- people[AL]._walkCount = 0;
+ people[PLAYER]._walkCount = 0;
}
// Store the final destination icon position
diff --git a/engines/sherlock/scalpel/scalpel_people.cpp b/engines/sherlock/scalpel/scalpel_people.cpp
index 80e6061e8b..e0abd72842 100644
--- a/engines/sherlock/scalpel/scalpel_people.cpp
+++ b/engines/sherlock/scalpel/scalpel_people.cpp
@@ -28,6 +28,113 @@ namespace Sherlock {
namespace Scalpel {
+void ScalpelPerson::adjustSprite() {
+ Map &map = *_vm->_map;
+ People &people = *_vm->_people;
+ Scene &scene = *_vm->_scene;
+ Talk &talk = *_vm->_talk;
+
+ if (_type == INVALID || (_type == CHARACTER && scene._animating))
+ return;
+
+ if (!talk._talkCounter && _type == CHARACTER && _walkCount) {
+ // Handle active movement for the sprite
+ _position += _delta;
+ --_walkCount;
+
+ if (!_walkCount) {
+ // If there any points left for the character to walk to along the
+ // route to a destination, then move to the next point
+ if (!people._walkTo.empty()) {
+ people._walkDest = people._walkTo.pop();
+ people.setWalking();
+ } else {
+ people.gotoStand(*this);
+ }
+ }
+ }
+
+ if (_type == CHARACTER && !map._active) {
+ if ((_position.y / FIXED_INT_MULTIPLIER) > LOWER_LIMIT) {
+ _position.y = LOWER_LIMIT * FIXED_INT_MULTIPLIER;
+ people.gotoStand(*this);
+ }
+
+ if ((_position.y / FIXED_INT_MULTIPLIER) < UPPER_LIMIT) {
+ _position.y = UPPER_LIMIT * FIXED_INT_MULTIPLIER;
+ people.gotoStand(*this);
+ }
+
+ if ((_position.x / FIXED_INT_MULTIPLIER) < LEFT_LIMIT) {
+ _position.x = LEFT_LIMIT * FIXED_INT_MULTIPLIER;
+ people.gotoStand(*this);
+ }
+
+ if ((_position.x / FIXED_INT_MULTIPLIER) > RIGHT_LIMIT) {
+ _position.x = RIGHT_LIMIT * FIXED_INT_MULTIPLIER;
+ people.gotoStand(*this);
+ }
+ } else if (!map._active) {
+ _position.y = CLIP((int)_position.y, (int)UPPER_LIMIT, (int)LOWER_LIMIT);
+ _position.x = CLIP((int)_position.x, (int)LEFT_LIMIT, (int)RIGHT_LIMIT);
+ }
+
+ if (!map._active || (map._frameChangeFlag = !map._frameChangeFlag))
+ ++_frameNumber;
+
+ if (_frameNumber >= (int)_walkSequences[_sequenceNumber]._sequences.size() ||
+ _walkSequences[_sequenceNumber][_frameNumber] == 0) {
+ switch (_sequenceNumber) {
+ case Scalpel::STOP_UP:
+ case Scalpel::STOP_DOWN:
+ case Scalpel::STOP_LEFT:
+ case Scalpel::STOP_RIGHT:
+ case Scalpel::STOP_UPRIGHT:
+ case Scalpel::STOP_UPLEFT:
+ case Scalpel::STOP_DOWNRIGHT:
+ case Scalpel::STOP_DOWNLEFT:
+ // We're in a stop sequence, so reset back to the last frame, so
+ // the character is shown as standing still
+ --_frameNumber;
+ break;
+
+ default:
+ // Move 1 past the first frame - we need to compensate, since we
+ // already passed the frame increment
+ _frameNumber = 1;
+ break;
+ }
+ }
+
+ // Update the _imageFrame to point to the new frame's image
+ setImageFrame();
+
+ // Check to see if character has entered an exit zone
+ if (!_walkCount && scene._walkedInScene && scene._goToScene == -1) {
+ Common::Rect charRect(_position.x / FIXED_INT_MULTIPLIER - 5, _position.y / FIXED_INT_MULTIPLIER - 2,
+ _position.x / FIXED_INT_MULTIPLIER + 5, _position.y / FIXED_INT_MULTIPLIER + 2);
+ Exit *exit = scene.checkForExit(charRect);
+
+ if (exit) {
+ scene._goToScene = exit->_scene;
+
+ if (exit->_people.x != 0) {
+ people._hSavedPos = exit->_people;
+ people._hSavedFacing = exit->_peopleDir;
+
+ if (people._hSavedFacing > 100 && people._hSavedPos.x < 1)
+ people._hSavedPos.x = 100;
+ }
+ }
+ }
+}
+
+/*----------------------------------------------------------------*/
+
+ScalpelPeople::ScalpelPeople(SherlockEngine *vm) : People(vm) {
+ _data.push_back(new ScalpelPerson());
+}
+
void ScalpelPeople::setTalking(int speaker) {
Resources &res = *_vm->_res;
@@ -89,14 +196,14 @@ void ScalpelPeople::setTalking(int speaker) {
void ScalpelPeople::synchronize(Serializer &s) {
s.syncAsByte(_holmesOn);
- s.syncAsSint32LE(_player._position.x);
- s.syncAsSint32LE(_player._position.y);
- s.syncAsSint16LE(_player._sequenceNumber);
+ s.syncAsSint32LE(_data[PLAYER]->_position.x);
+ s.syncAsSint32LE(_data[PLAYER]->_position.y);
+ s.syncAsSint16LE(_data[PLAYER]->_sequenceNumber);
s.syncAsSint16LE(_holmesQuotient);
if (s.isLoading()) {
- _hSavedPos = _player._position;
- _hSavedFacing = _player._sequenceNumber;
+ _hSavedPos = _data[PLAYER]->_position;
+ _hSavedFacing = _data[PLAYER]->_sequenceNumber;
}
}
@@ -172,8 +279,8 @@ void ScalpelPeople::gotoStand(Sprite &sprite) {
if (map._active) {
sprite._sequenceNumber = 0;
- _player._position.x = (map[map._charPoint].x - 6) * FIXED_INT_MULTIPLIER;
- _player._position.y = (map[map._charPoint].y + 10) * FIXED_INT_MULTIPLIER;
+ _data[PLAYER]->_position.x = (map[map._charPoint].x - 6) * FIXED_INT_MULTIPLIER;
+ _data[PLAYER]->_position.y = (map[map._charPoint].y + 10) * FIXED_INT_MULTIPLIER;
}
_oldWalkSequence = -1;
diff --git a/engines/sherlock/scalpel/scalpel_people.h b/engines/sherlock/scalpel/scalpel_people.h
index 1f14ceee0e..dac685b26c 100644
--- a/engines/sherlock/scalpel/scalpel_people.h
+++ b/engines/sherlock/scalpel/scalpel_people.h
@@ -41,9 +41,20 @@ enum ScalpelSequences {
STOP_DOWNLEFT = 15, TALK_RIGHT = 6, TALK_LEFT = 4
};
+class ScalpelPerson : public Person {
+public:
+ ScalpelPerson() : Person() {}
+ virtual ~ScalpelPerson() {}
+
+ /**
+ * This adjusts the sprites position, as well as it's animation sequence:
+ */
+ virtual void adjustSprite();
+};
+
class ScalpelPeople : public People {
public:
- ScalpelPeople(SherlockEngine *vm) : People(vm) {}
+ ScalpelPeople(SherlockEngine *vm);
virtual ~ScalpelPeople() {}
/**
diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp
index 95a58be99d..e3bc6483eb 100644
--- a/engines/sherlock/scalpel/scalpel_scene.cpp
+++ b/engines/sherlock/scalpel/scalpel_scene.cpp
@@ -138,7 +138,7 @@ void ScalpelScene::drawAllShapes() {
void ScalpelScene::checkBgShapes() {
People &people = *_vm->_people;
- Person &holmes = people._player;
+ Person &holmes = people[PLAYER];
Common::Point pt(holmes._position.x / FIXED_INT_MULTIPLIER, holmes._position.y / FIXED_INT_MULTIPLIER);
// Call the base scene method to handle bg shapes
@@ -229,14 +229,14 @@ void ScalpelScene::doBgAnim() {
vm.eraseMirror12();
// Restore the back buffer from the back buffer 2 in the changed area
- Common::Rect bounds(people[AL]._oldPosition.x, people[AL]._oldPosition.y,
- people[AL]._oldPosition.x + people[AL]._oldSize.x,
- people[AL]._oldPosition.y + people[AL]._oldSize.y);
+ Common::Rect bounds(people[PLAYER]._oldPosition.x, people[PLAYER]._oldPosition.y,
+ people[PLAYER]._oldPosition.x + people[PLAYER]._oldSize.x,
+ people[PLAYER]._oldPosition.y + people[PLAYER]._oldSize.y);
Common::Point pt(bounds.left, bounds.top);
- if (people[AL]._type == CHARACTER)
+ if (people[PLAYER]._type == CHARACTER)
screen.restoreBackground(bounds);
- else if (people[AL]._type == REMOVE)
+ else if (people[PLAYER]._type == REMOVE)
screen._backBuffer->blitFrom(screen._backBuffer2, pt, bounds);
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
@@ -291,8 +291,8 @@ void ScalpelScene::doBgAnim() {
_canimShapes[idx].adjustObject();
}
- if (people[AL]._type == CHARACTER && people._holmesOn)
- people[AL].adjustSprite();
+ if (people[PLAYER]._type == CHARACTER && people._holmesOn)
+ people[PLAYER].adjustSprite();
// Flag the bg shapes which need to be redrawn
checkBgShapes();
@@ -331,16 +331,16 @@ void ScalpelScene::doBgAnim() {
}
// Draw the person if not animating
- if (people[AL]._type == CHARACTER && people[AL]._walkLoaded) {
+ if (people[PLAYER]._type == CHARACTER && people[PLAYER]._walkLoaded) {
// If Holmes is too far to the right, move him back so he's on-screen
- int xRight = SHERLOCK_SCREEN_WIDTH - 2 - people[AL]._imageFrame->_frame.w;
- int tempX = MIN(people[AL]._position.x / FIXED_INT_MULTIPLIER, xRight);
+ int xRight = SHERLOCK_SCREEN_WIDTH - 2 - people[PLAYER]._imageFrame->_frame.w;
+ int tempX = MIN(people[PLAYER]._position.x / FIXED_INT_MULTIPLIER, xRight);
- bool flipped = people[AL]._sequenceNumber == WALK_LEFT || people[AL]._sequenceNumber == STOP_LEFT ||
- people[AL]._sequenceNumber == WALK_UPLEFT || people[AL]._sequenceNumber == STOP_UPLEFT ||
- people[AL]._sequenceNumber == WALK_DOWNRIGHT || people[AL]._sequenceNumber == STOP_DOWNRIGHT;
- screen._backBuffer->transBlitFrom(*people[AL]._imageFrame,
- Common::Point(tempX, people[AL]._position.y / FIXED_INT_MULTIPLIER - people[AL]._imageFrame->_frame.h), flipped);
+ bool flipped = people[PLAYER]._sequenceNumber == WALK_LEFT || people[PLAYER]._sequenceNumber == STOP_LEFT ||
+ people[PLAYER]._sequenceNumber == WALK_UPLEFT || people[PLAYER]._sequenceNumber == STOP_UPLEFT ||
+ people[PLAYER]._sequenceNumber == WALK_DOWNRIGHT || people[PLAYER]._sequenceNumber == STOP_DOWNRIGHT;
+ screen._backBuffer->transBlitFrom(*people[PLAYER]._imageFrame,
+ Common::Point(tempX, people[PLAYER]._position.y / FIXED_INT_MULTIPLIER - people[PLAYER]._imageFrame->_frame.h), flipped);
}
// Draw all static and active shapes are NORMAL and are in front of the person
@@ -390,20 +390,20 @@ void ScalpelScene::doBgAnim() {
_animating = 0;
screen.slamRect(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
} else {
- if (people[AL]._type != INVALID && ((_goToScene == -1 || _canimShapes.empty()))) {
- if (people[AL]._type == REMOVE) {
+ if (people[PLAYER]._type != INVALID && ((_goToScene == -1 || _canimShapes.empty()))) {
+ if (people[PLAYER]._type == REMOVE) {
screen.slamRect(Common::Rect(
- people[AL]._oldPosition.x, people[AL]._oldPosition.y,
- people[AL]._oldPosition.x + people[AL]._oldSize.x,
- people[AL]._oldPosition.y + people[AL]._oldSize.y
+ people[PLAYER]._oldPosition.x, people[PLAYER]._oldPosition.y,
+ people[PLAYER]._oldPosition.x + people[PLAYER]._oldSize.x,
+ people[PLAYER]._oldPosition.y + people[PLAYER]._oldSize.y
));
- people[AL]._type = INVALID;
+ people[PLAYER]._type = INVALID;
} else {
- screen.flushImage(people[AL]._imageFrame,
- Common::Point(people[AL]._position.x / FIXED_INT_MULTIPLIER,
- people[AL]._position.y / FIXED_INT_MULTIPLIER - people[AL].frameHeight()),
- &people[AL]._oldPosition.x, &people[AL]._oldPosition.y,
- &people[AL]._oldSize.x, &people[AL]._oldSize.y);
+ screen.flushImage(people[PLAYER]._imageFrame,
+ Common::Point(people[PLAYER]._position.x / FIXED_INT_MULTIPLIER,
+ people[PLAYER]._position.y / FIXED_INT_MULTIPLIER - people[PLAYER].frameHeight()),
+ &people[PLAYER]._oldPosition.x, &people[PLAYER]._oldPosition.y,
+ &people[PLAYER]._oldSize.x, &people[PLAYER]._oldSize.y);
}
}
@@ -525,7 +525,7 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
if (walkPos.x != -1) {
// Holmes must walk to the walk point before the cAnimation is started
- if (people[AL]._position != walkPos)
+ if (people[PLAYER]._position != walkPos)
people.walkToCoords(walkPos, walkDir);
}
@@ -563,7 +563,7 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
if (cAnim._name.size() > 0 && cAnim._type != NO_SHAPE) {
if (tpPos.x != -1)
- people[AL]._type = REMOVE;
+ people[PLAYER]._type = REMOVE;
Common::String fname = cAnim._name + ".vgs";
if (!res.isInCache(fname)) {
@@ -653,14 +653,14 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
cObj._frameNumber += dir;
}
- people[AL]._type = CHARACTER;
+ people[PLAYER]._type = CHARACTER;
}
// Teleport to ending coordinates if necessary
if (tpPos.x != -1) {
- people[AL]._position = tpPos; // Place the player
- people[AL]._sequenceNumber = tpDir;
- people.gotoStand(people[AL]);
+ people[PLAYER]._position = tpPos; // Place the player
+ people[PLAYER]._sequenceNumber = tpDir;
+ people.gotoStand(people[PLAYER]);
}
if (playRate < 0)
@@ -686,10 +686,10 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
if (tpPos.x != -1 && !talk._talkToAbort) {
// Teleport to ending coordinates
- people[AL]._position = tpPos;
- people[AL]._sequenceNumber = tpDir;
+ people[PLAYER]._position = tpPos;
+ people[PLAYER]._sequenceNumber = tpDir;
- people.gotoStand(people[AL]);
+ people.gotoStand(people[PLAYER]);
}
events.setCursor(oldCursor);
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index a89ebb61fc..31399b0ad9 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -2230,9 +2230,9 @@ void ScalpelUserInterface::checkAction(ActionType &action, const char *const mes
if (!talk._talkToAbort) {
// Ensure Holmes is on the exact intended location
- people[AL]._position = pt;
- people[AL]._sequenceNumber = dir;
- people.gotoStand(people[AL]);
+ people[PLAYER]._position = pt;
+ people[PLAYER]._sequenceNumber = dir;
+ people.gotoStand(people[PLAYER]);
talk.talkTo(action._names[nameIdx].c_str() + 2);
if (ch == 'T')