aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-16 16:04:09 -0400
committerPaul Gilbert2014-08-16 16:04:09 -0400
commitbca9f14719dda5185c443cae6c16b6a374f50ab2 (patch)
treef0cfc5e7a8be9e72aa0d449d7430e6f7998cb383
parentfa099b848094388225b4f7e84ad4a15d7c42ce34 (diff)
downloadscummvm-rg350-bca9f14719dda5185c443cae6c16b6a374f50ab2.tar.gz
scummvm-rg350-bca9f14719dda5185c443cae6c16b6a374f50ab2.tar.bz2
scummvm-rg350-bca9f14719dda5185c443cae6c16b6a374f50ab2.zip
ACCESS: Fix display of mouse cursor
-rw-r--r--engines/access/access.cpp2
-rw-r--r--engines/access/amazon/amazon_game.cpp2
-rw-r--r--engines/access/events.cpp7
-rw-r--r--engines/access/events.h6
-rw-r--r--engines/access/room.cpp28
5 files changed, 28 insertions, 17 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 1503e380c2..fde5ab8754 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -170,7 +170,7 @@ void AccessEngine::dummyLoop() {
if (_events->_leftButton) {
CursorType cursorId = _events->getCursor();
- _events->setCursor((cursorId == CURSOR_HELP) ? CURSOR_0 : (CursorType)(cursorId + 1));
+ _events->setCursor((cursorId == CURSOR_HELP) ? CURSOR_ARROW : (CursorType)(cursorId + 1));
}
}
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 1b824ac730..042fd415da 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -80,7 +80,7 @@ void AmazonEngine::playGame() {
void AmazonEngine::doIntroduction() {
_screen->setInitialPalettte();
- _events->setCursor(CURSOR_0);
+ _events->setCursor(CURSOR_ARROW);
_events->showCursor();
_screen->setPanel(0);
diff --git a/engines/access/events.cpp b/engines/access/events.cpp
index 8f02d41547..9c6b45737d 100644
--- a/engines/access/events.cpp
+++ b/engines/access/events.cpp
@@ -36,12 +36,12 @@ namespace Access {
EventsManager::EventsManager(AccessEngine *vm): _vm(vm) {
_cursorId = CURSOR_NONE;
+ _normalMouse = CURSOR_CROSSHAIRS;
_frameCounter = 10;
_priorFrameTime = 0;
_leftButton = _rightButton = false;
_mouseMove = false;
_mouseCol = _mouseRow = 0;
- _normalMouse = 0;
_mouseMode = 0;
_cursorExitFlag = false;
}
@@ -54,6 +54,11 @@ void EventsManager::setCursor(CursorType cursorId) {
return;
_cursorId = cursorId;
+ if (_mouseMode == 1 && cursorId == CURSOR_ARROW)
+ _mouseMode = 2;
+ else if (_mouseMode == 2 && cursorId != CURSOR_ARROW)
+ _mouseMode = 1;
+
// Get a pointer to the mouse data to use, and get the cursor hotspot
const byte *srcP = Amazon::CURSORS[cursorId];
int hotspotX = (int16)READ_LE_UINT16(srcP);
diff --git a/engines/access/events.h b/engines/access/events.h
index 5ca08068f1..c76f62b265 100644
--- a/engines/access/events.h
+++ b/engines/access/events.h
@@ -31,8 +31,8 @@ namespace Access {
enum CursorType {
CURSOR_NONE = -1,
- CURSOR_0 = 0, CURSOR_1, CURSOR_2, CURSOR_3, CURSOR_EYE, CURSOR_HAND,
- CURSOR_GET, CURSOR_CLIMB, CURSOR_TALK, CURSOR_HELP
+ CURSOR_ARROW = 0, CURSOR_CROSSHAIRS, CURSOR_2, CURSOR_3, CURSOR_EYE,
+ CURSOR_HAND, CURSOR_GET, CURSOR_CLIMB, CURSOR_TALK, CURSOR_HELP
};
#define GAME_FRAME_RATE 50
@@ -51,11 +51,11 @@ private:
void nextFrame();
public:
CursorType _cursorId;
+ CursorType _normalMouse;
bool _leftButton, _rightButton;
Common::Point _mousePos;
int _mouseCol, _mouseRow;
bool _mouseMove;
- int _normalMouse;
int _mouseMode;
bool _cursorExitFlag;
Common::FixedStack<Common::KeyState> _keypresses;
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index ccd19b0ed9..dd6f21877c 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -131,6 +131,12 @@ void Room::doRoom() {
break;
} else {
_vm->plotList();
+
+ if (_vm->_events->_mousePos.y < 177) {
+ _vm->_events->setCursor(_vm->_events->_normalMouse);
+ } else {
+ _vm->_events->setCursor(CURSOR_ARROW);
+ }
_vm->copyBlocks();
}
}
@@ -454,20 +460,20 @@ void Room::executeCommand(int commandId) {
switch (commandId) {
case 0:
- _vm->_events->_normalMouse = 4;
+ _vm->_events->_normalMouse = CURSOR_EYE;
_vm->_events->_mouseMode = 0;
break;
case 2:
- _vm->_events->_normalMouse = 5;
+ _vm->_events->_normalMouse = CURSOR_HAND;
_vm->_events->_mouseMode = 0;
break;
case 3:
- _vm->_events->_normalMouse = 6;
+ _vm->_events->_normalMouse = CURSOR_GET;
_vm->_events->_mouseMode = 0;
break;
case 4:
- _vm->_events->_normalMouse = 1;
- _vm->_events->setCursor(CURSOR_0);
+ _vm->_events->_normalMouse = CURSOR_CROSSHAIRS;
+ _vm->_events->setCursor(CURSOR_ARROW);
if (_vm->_inventory->newDisplayInv() == 2) {
commandOff();
return;
@@ -476,20 +482,20 @@ void Room::executeCommand(int commandId) {
}
break;
case 5:
- _vm->_events->_normalMouse = 7;
+ _vm->_events->_normalMouse = CURSOR_CLIMB;
_vm->_events->_mouseMode = 0;
break;
case 6:
- _vm->_events->_normalMouse = 8;
+ _vm->_events->_normalMouse = CURSOR_TALK;
_vm->_events->_mouseMode = 0;
break;
case 7:
- _vm->_events->_normalMouse = 1;
+ _vm->_events->_normalMouse = CURSOR_CROSSHAIRS;
_vm->_scripts->_sequence = 5000;
_vm->_scripts->searchForSequence();
roomMenu();
_selectCommand = -1;
- _vm->_events->_normalMouse = 1;
+ _vm->_events->_normalMouse = CURSOR_CROSSHAIRS;
_vm->_events->_mouseMode = 0;
_conFlag = true;
@@ -500,7 +506,7 @@ void Room::executeCommand(int commandId) {
_vm->_boxSelect = true;
break;
case 8:
- _vm->_events->_normalMouse = 9;
+ _vm->_events->_normalMouse = CURSOR_HELP;
_vm->_events->_mouseMode = 0;
break;
default:
@@ -525,7 +531,7 @@ void Room::executeCommand(int commandId) {
void Room::commandOff() {
_selectCommand = -1;
- _vm->_events->_normalMouse = 1;
+ _vm->_events->_normalMouse = CURSOR_CROSSHAIRS;
_vm->_events->_mouseMode = 4;
roomMenu();
}