diff options
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_map.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_people.cpp | 23 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 2 |
3 files changed, 15 insertions, 16 deletions
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp index 7356deb9a3..08013df900 100644 --- a/engines/sherlock/scalpel/scalpel_map.cpp +++ b/engines/sherlock/scalpel/scalpel_map.cpp @@ -250,7 +250,7 @@ int ScalpelMap::show() { if ((events._released || events._rightReleased) && _point != -1) { if (people[HOLMES]._walkCount == 0) { - people._walkDest = _points[_point] + Common::Point(4, 9); + people[HOLMES]._walkDest = _points[_point] + Common::Point(4, 9); _charPoint = _point; // Start walking to selected location @@ -454,7 +454,7 @@ void ScalpelMap::walkTheStreets() { // Add in destination position people[HOLMES]._walkTo.clear(); - Common::Point destPos = people._walkDest; + Common::Point destPos = people[HOLMES]._walkDest; // Check for any intermediate points between the two locations if (path[0] || _charPoint > 50 || _oldCharPoint > 50) { @@ -488,7 +488,7 @@ void ScalpelMap::walkTheStreets() { people[HOLMES]._walkTo.push(tempPath[idx]); } - people._walkDest = people[HOLMES]._walkTo.pop() + Common::Point(12, 6); + people[HOLMES]._walkDest = people[HOLMES]._walkTo.pop() + Common::Point(12, 6); people[HOLMES].setWalking(); } } else { diff --git a/engines/sherlock/scalpel/scalpel_people.cpp b/engines/sherlock/scalpel/scalpel_people.cpp index 72d8d32812..3c02eb4d83 100644 --- a/engines/sherlock/scalpel/scalpel_people.cpp +++ b/engines/sherlock/scalpel/scalpel_people.cpp @@ -53,7 +53,7 @@ void ScalpelPerson::adjustSprite() { // 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[HOLMES]._walkTo.empty()) { - people._walkDest = people[HOLMES]._walkTo.pop(); + _walkDest = people[HOLMES]._walkTo.pop(); setWalking(); } else { gotoStand(); @@ -189,7 +189,6 @@ void ScalpelPerson::gotoStand() { void ScalpelPerson::setWalking() { Map &map = *_vm->_map; - People &people = *_vm->_people; Scene &scene = *_vm->_scene; int oldDirection, oldFrame; Common::Point speed, delta; @@ -217,12 +216,12 @@ void ScalpelPerson::setWalking() { // clicked, but characters draw positions start at their left, move // the destination half the character width to draw him centered int temp; - if (people._walkDest.x >= (temp = _imageFrame->_frame.w / 2)) - people._walkDest.x -= temp; + if (_walkDest.x >= (temp = _imageFrame->_frame.w / 2)) + _walkDest.x -= temp; delta = Common::Point( - ABS(_position.x / FIXED_INT_MULTIPLIER - people._walkDest.x), - ABS(_position.y / FIXED_INT_MULTIPLIER - people._walkDest.y) + ABS(_position.x / FIXED_INT_MULTIPLIER - _walkDest.x), + ABS(_position.y / FIXED_INT_MULTIPLIER - _walkDest.y) ); // If we're ready to move a sufficient distance, that's it. Otherwise, @@ -231,7 +230,7 @@ void ScalpelPerson::setWalking() { break; // Pop next walk segment off the walk route stack - people._walkDest = _walkTo.pop(); + _walkDest = _walkTo.pop(); } // If a sufficient move is being done, then start the move @@ -240,7 +239,7 @@ void ScalpelPerson::setWalking() { if (delta.x >= delta.y) { // Set the initial frame sequence for the left and right, as well // as setting the delta x depending on direction - if (people._walkDest.x < (_position.x / FIXED_INT_MULTIPLIER)) { + if (_walkDest.x < (_position.x / FIXED_INT_MULTIPLIER)) { _sequenceNumber = (map._active ? (int)MAP_LEFT : (int)WALK_LEFT); _delta.x = speed.x * -FIXED_INT_MULTIPLIER; } else { @@ -253,7 +252,7 @@ void ScalpelPerson::setWalking() { if (delta.x >= speed.x) { // Det the delta y _delta.y = (delta.y * FIXED_INT_MULTIPLIER) / (delta.x / speed.x); - if (people._walkDest.y < (_position.y / FIXED_INT_MULTIPLIER)) + if (_walkDest.y < (_position.y / FIXED_INT_MULTIPLIER)) _delta.y = -_delta.y; // Set how many times we should add the delta to the player's position @@ -262,7 +261,7 @@ void ScalpelPerson::setWalking() { // The delta x was less than the speed (ie. we're really close to // the destination). So set delta to 0 so the player won't move _delta = Point32(0, 0); - _position = Point32(people._walkDest.x * FIXED_INT_MULTIPLIER, people._walkDest.y * FIXED_INT_MULTIPLIER); + _position = Point32(_walkDest.x * FIXED_INT_MULTIPLIER, _walkDest.y * FIXED_INT_MULTIPLIER); _walkCount = 1; } @@ -294,7 +293,7 @@ void ScalpelPerson::setWalking() { } else { // Major movement is vertical, so set the sequence for up and down, // and set the delta Y depending on the direction - if (people._walkDest.y < (_position.y / FIXED_INT_MULTIPLIER)) { + if (_walkDest.y < (_position.y / FIXED_INT_MULTIPLIER)) { _sequenceNumber = WALK_UP; _delta.y = speed.y * -FIXED_INT_MULTIPLIER; } else { @@ -309,7 +308,7 @@ void ScalpelPerson::setWalking() { // Set the delta x _delta.x = (delta.x * FIXED_INT_MULTIPLIER) / (delta.y / speed.y); - if (people._walkDest.x < (_position.x / FIXED_INT_MULTIPLIER)) + if (_walkDest.x < (_position.x / FIXED_INT_MULTIPLIER)) _delta.x = -_delta.x; _walkCount = delta.y / speed.y; diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index 72f40a7d26..fb8ebe18a1 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -305,8 +305,8 @@ void ScalpelUserInterface::handleInput() { // Mouse clicked in script zone events._pressed = events._released = false; } else { - people._walkDest = pt; people._allowWalkAbort = false; + people[HOLMES]._walkDest = pt; people[HOLMES].goAllTheWay(); } |