diff options
Diffstat (limited to 'engines/drascula/drascula.cpp')
-rw-r--r-- | engines/drascula/drascula.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 1f3f0c654d..3f840b0901 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -94,10 +94,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam _talkSequencesSize = 0; _numLangs = 0; feetHeight = 0; - floorX1 = 0; - floorY1 = 0; - floorX2 = 0; - floorY2 = 0; lowerLimit = 0; upperLimit = 0; trackFinal = 0; @@ -444,7 +440,7 @@ bool DrasculaEngine::runCurrentChapter() { enterRoom(62); curX = -20; curY = 56; - gotoObject(65, 145); + walkToPoint(Common::Point(65, 145)); } // REMINDER: This is a good place to debug animations @@ -550,14 +546,14 @@ bool DrasculaEngine::runCurrentChapter() { // made the character start walking off screen, as his actual position was // different than the displayed one if (_roomNumber == 3 && (curX == 279) && (curY + curHeight == 101)) { - gotoObject(178, 121); - gotoObject(169, 135); + walkToPoint(Common::Point(178, 121)); + walkToPoint(Common::Point(169, 135)); } else if (_roomNumber == 14 && (curX == 214) && (curY + curHeight == 121)) { _walkToObject = true; - gotoObject(190, 130); + walkToPoint(Common::Point(190, 130)); } else if (_roomNumber == 14 && (curX == 246) && (curY + curHeight == 112)) { _walkToObject = true; - gotoObject(190, 130); + walkToPoint(Common::Point(190, 130)); } } @@ -744,8 +740,7 @@ bool DrasculaEngine::verify1() { removeObject(); else { for (l = 0; l < numRoomObjs; l++) { - if (_mouseX >= _objectX1[l] && _mouseY >= _objectY1[l] - && _mouseX <= _objectX2[l] && _mouseY <= _objectY2[l] && doBreak == 0) { + if (_objectRect[l].contains(Common::Point(_mouseX, _mouseY)) && doBreak == 0) { if (exitRoom(l)) return true; if (doBreak == 1) @@ -758,10 +753,9 @@ bool DrasculaEngine::verify1() { doBreak = 1; for (l = 0; l < numRoomObjs; l++) { - if (_mouseX > _objectX1[l] && _mouseY > _objectY1[l] - && _mouseX < _objectX2[l] && _mouseY < _objectY2[l] && doBreak == 0) { - roomX = roomObjX[l]; - roomY = roomObjY[l]; + if (_objectRect[l].contains(Common::Point(_mouseX, _mouseY)) && doBreak == 0) { + roomX = _roomObject[l].x; + roomY = _roomObject[l].y; trackFinal = trackObj[l]; doBreak = 1; _walkToObject = true; @@ -770,8 +764,8 @@ bool DrasculaEngine::verify1() { } if (doBreak == 0) { - roomX = CLIP(_mouseX, floorX1, floorX2); - roomY = CLIP(_mouseY, floorY1 + feetHeight, floorY2); + roomX = CLIP<int16>(_mouseX, _walkRect.left, _walkRect.right); + roomY = CLIP<int16>(_mouseY, _walkRect.top + feetHeight, _walkRect.bottom); startWalking(); } doBreak = 0; @@ -792,11 +786,10 @@ bool DrasculaEngine::verify2() { return true; } else { for (l = 0; l < numRoomObjs; l++) { - if (_mouseX > _objectX1[l] && _mouseY > _objectY1[l] - && _mouseX < _objectX2[l] && _mouseY < _objectY2[l] && visible[l] == 1) { + if (_objectRect[l].contains(Common::Point(_mouseX, _mouseY)) && visible[l] == 1) { trackFinal = trackObj[l]; _walkToObject = true; - gotoObject(roomObjX[l], roomObjY[l]); + walkToPoint(_roomObject[l]); if (checkAction(objectNum[l])) return true; if (currentChapter == 4) |