aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/draw_v2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/draw_v2.cpp')
-rw-r--r--engines/gob/draw_v2.cpp42
1 files changed, 10 insertions, 32 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index 2843456f42..e09c565b79 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -34,6 +34,7 @@
#include "gob/game.h"
#include "gob/script.h"
#include "gob/resources.h"
+#include "gob/hotspots.h"
#include "gob/scenery.h"
#include "gob/inter.h"
#include "gob/video.h"
@@ -82,7 +83,6 @@ void Draw_v2::blitCursor() {
}
void Draw_v2::animateCursor(int16 cursor) {
- Game::Collision *ptr;
int16 cursorIndex = cursor;
int16 newX = 0, newY = 0;
uint16 hotspotX = 0, hotspotY = 0;
@@ -91,32 +91,10 @@ void Draw_v2::animateCursor(int16 cursor) {
// .-- _draw_animateCursorSUB1 ---
if (cursorIndex == -1) {
- cursorIndex = 0;
- for (ptr = _vm->_game->_collisionAreas; ptr->left != 0xFFFF; ptr++) {
- if ((ptr->flags & 0xF00) || (ptr->id & 0x4000))
- continue;
-
- if (ptr->left > _vm->_global->_inter_mouseX)
- continue;
-
- if (ptr->right < _vm->_global->_inter_mouseX)
- continue;
-
- if (ptr->top > _vm->_global->_inter_mouseY)
- continue;
-
- if (ptr->bottom < _vm->_global->_inter_mouseY)
- continue;
-
- if ((ptr->flags & 0xF000) == 0) {
- if ((ptr->flags & 0xF) >= 3) {
- cursorIndex = 3;
- break;
- } else if (((ptr->flags & 0xF0) != 0x10) && (cursorIndex == 0))
- cursorIndex = 1;
- } else if (cursorIndex == 0)
- cursorIndex = (ptr->flags >> 12) & 0xF;
- }
+ cursorIndex =
+ _vm->_game->_hotspots->findCursor(_vm->_global->_inter_mouseX,
+ _vm->_global->_inter_mouseY);
+
if (_cursorAnimLow[cursorIndex] == -1)
cursorIndex = 1;
}
@@ -407,8 +385,8 @@ void Draw_v2::printTotText(int16 id) {
adjustCoords(2, &rectRight, &rectBottom);
if (colId != -1)
- _vm->_game->addNewCollision(colId + 0xD000, rectLeft, rectTop,
- rectRight, rectBottom, 2, 0, 0, 0);
+ _vm->_game->_hotspots->add(colId + 0xD000, rectLeft, rectTop,
+ rectRight, rectBottom, (uint16) Hotspots::kTypeClick, 0, 0, 0, 0);
if (_needAdjust != 2)
printTextCentered(colCmd & 0x0F, rectLeft + 4, rectTop + 4,
@@ -501,8 +479,8 @@ void Draw_v2::printTotText(int16 id) {
rectBottom = destY + (int16)READ_LE_UINT16(ptr + 6);
adjustCoords(2, &rectLeft, &rectTop);
adjustCoords(2, &rectRight, &rectBottom);
- _vm->_game->addNewCollision(colId + 0x0D000, rectLeft, rectTop,
- rectRight, rectBottom, 2, 0, 0, 0);
+ _vm->_game->_hotspots->add(colId + 0x0D000, rectLeft, rectTop,
+ rectRight, rectBottom, (uint16) Hotspots::kTypeClick, 0, 0, 0, 0);
ptr += 8;
}
break;
@@ -604,7 +582,7 @@ void Draw_v2::printTotText(int16 id) {
if (!(_renderFlags & RENDERFLAG_COLLISIONS))
return;
- _vm->_game->checkCollisions(0, 0, 0, 0);
+ _vm->_game->_hotspots->check(0, 0);
if (*_vm->_scenery->_pCaptureCounter != 0) {
(*_vm->_scenery->_pCaptureCounter)--;