aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel/scalpel_map.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-12 23:23:16 -0400
committerPaul Gilbert2015-06-12 23:23:16 -0400
commit803c06beb919b35d29bb65ec2e7e48caca69c730 (patch)
treedcce1cc2ed3ff46c7238e3d801a4567b90f71d8c /engines/sherlock/scalpel/scalpel_map.cpp
parent6221c1de82bae650158b54a4b04f8f319416ac63 (diff)
downloadscummvm-rg350-803c06beb919b35d29bb65ec2e7e48caca69c730.tar.gz
scummvm-rg350-803c06beb919b35d29bb65ec2e7e48caca69c730.tar.bz2
scummvm-rg350-803c06beb919b35d29bb65ec2e7e48caca69c730.zip
SHERLOCK: RT: Implement startCAnim
Diffstat (limited to 'engines/sherlock/scalpel/scalpel_map.cpp')
-rw-r--r--engines/sherlock/scalpel/scalpel_map.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp
index a9e566f73c..63cb4a342c 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[PLAYER]._position = _lDrawnPos = _overPos;
+ people[HOLMES]._position = _lDrawnPos = _overPos;
// Show place icons
showPlaces();
@@ -233,7 +233,7 @@ int ScalpelMap::show() {
}
if ((events._released || events._rightReleased) && _point != -1) {
- if (people[PLAYER]._walkCount == 0) {
+ if (people[HOLMES]._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[PLAYER]._walkCount == 0) {
+ if (people[HOLMES]._walkCount == 0) {
if (_charPoint >= 1 && _charPoint < (int)_points.size())
exitFlag = true;
}
@@ -266,7 +266,7 @@ int ScalpelMap::show() {
}
freeSprites();
- _overPos = people[PLAYER]._position;
+ _overPos = people[HOLMES]._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[PLAYER];
+ Person &p = people[HOLMES];
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[PLAYER]._imageFrame, _lDrawnPos);
+ saveIcon(people[HOLMES]._imageFrame, _lDrawnPos);
- 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);
+ bool flipped = people[HOLMES]._sequenceNumber == MAP_DOWNLEFT || people[HOLMES]._sequenceNumber == MAP_LEFT
+ || people[HOLMES]._sequenceNumber == MAP_UPLEFT;
+ screen._backBuffer1.transBlitFrom(*people[HOLMES]._imageFrame, _lDrawnPos, flipped);
}
if (highlighted) {
@@ -390,26 +390,26 @@ void ScalpelMap::updateMap(bool flushScreen) {
else
_savedPos.x = -1;
- people[PLAYER].adjustSprite();
+ people[HOLMES].adjustSprite();
- _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;
+ _lDrawnPos.x = hPos.x = people[HOLMES]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x;
+ _lDrawnPos.y = hPos.y = people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES].frameHeight() - _bigPos.y;
// Draw the person icon
- 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);
+ saveIcon(people[HOLMES]._imageFrame, hPos);
+ if (people[HOLMES]._sequenceNumber == MAP_DOWNLEFT || people[HOLMES]._sequenceNumber == MAP_LEFT
+ || people[HOLMES]._sequenceNumber == MAP_UPLEFT)
+ screen._backBuffer1.transBlitFrom(*people[HOLMES]._imageFrame, hPos, true);
else
- screen._backBuffer1.transBlitFrom(*people[PLAYER]._imageFrame, hPos, false);
+ screen._backBuffer1.transBlitFrom(*people[HOLMES]._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[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);
+ screen.flushImage(people[HOLMES]._imageFrame, Common::Point(people[HOLMES]._position.x / FIXED_INT_MULTIPLIER - _bigPos.x,
+ people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES].frameHeight() - _bigPos.y),
+ &people[HOLMES]._oldPosition.x, &people[HOLMES]._oldPosition.y, &people[HOLMES]._oldSize.x, &people[HOLMES]._oldSize.y);
if (osPos.x != -1)
screen.slamArea(osPos.x, osPos.y, osSize.x, osSize.y);
@@ -428,15 +428,15 @@ void ScalpelMap::walkTheStreets() {
const byte *path = _paths.getPath(start, dest);
// Add in destination position
- people[PLAYER]._walkTo.clear();
+ people[HOLMES]._walkTo.clear();
Common::Point destPos = people._walkDest;
// Check for any intermediate points between the two locations
if (path[0] || _charPoint > 50 || _oldCharPoint > 50) {
- people[PLAYER]._sequenceNumber = -1;
+ people[HOLMES]._sequenceNumber = -1;
if (_charPoint == 51 || _oldCharPoint == 51) {
- people[PLAYER].setWalking();
+ people[HOLMES].setWalking();
} else {
bool reversePath = false;
@@ -453,25 +453,25 @@ void ScalpelMap::walkTheStreets() {
} while (*path != 254);
// Load up the path to use
- people[PLAYER]._walkTo.clear();
+ people[HOLMES]._walkTo.clear();
if (reversePath) {
for (int idx = (int)tempPath.size() - 1; idx >= 0; --idx)
- people[PLAYER]._walkTo.push(tempPath[idx]);
+ people[HOLMES]._walkTo.push(tempPath[idx]);
} else {
for (int idx = 0; idx < (int)tempPath.size(); ++idx)
- people[PLAYER]._walkTo.push(tempPath[idx]);
+ people[HOLMES]._walkTo.push(tempPath[idx]);
}
- people._walkDest = people[PLAYER]._walkTo.pop() + Common::Point(12, 6);
- people[PLAYER].setWalking();
+ people._walkDest = people[HOLMES]._walkTo.pop() + Common::Point(12, 6);
+ people[HOLMES].setWalking();
}
} else {
- people[PLAYER]._walkCount = 0;
+ people[HOLMES]._walkCount = 0;
}
// Store the final destination icon position
- people[PLAYER]._walkTo.push(destPos);
+ people[HOLMES]._walkTo.push(destPos);
}
void ScalpelMap::saveIcon(ImageFrame *src, const Common::Point &pt) {