aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Hamm2007-10-28 13:37:06 +0000
committerVincent Hamm2007-10-28 13:37:06 +0000
commit4556690cc0d6cc4beb57ba7e323bfe6665ad6950 (patch)
treea190977a53af80fc6877d73ba0c833ae44520f93
parentfefc228cd27096889fad1839f978f35d50ab3b45 (diff)
downloadscummvm-rg350-4556690cc0d6cc4beb57ba7e323bfe6665ad6950.tar.gz
scummvm-rg350-4556690cc0d6cc4beb57ba7e323bfe6665ad6950.tar.bz2
scummvm-rg350-4556690cc0d6cc4beb57ba7e323bfe6665ad6950.zip
Implement cursor by object
Fix walk cursor svn-id: r29288
-rw-r--r--engines/cruise/cruise_main.cpp83
-rw-r--r--engines/cruise/mouse.cpp2
2 files changed, 48 insertions, 37 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 2b1e74a369..6fce363c32 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1350,9 +1350,6 @@ void mainLoop(void) {
//int32 q=0; /* Dummy */
int enableUser = 0;
- //int16 mouseX;
- //int16 mouseY;
- //int16 mouseButton;
scriptNameBuffer[0] = 0;
systemStrings.bootScriptName[0] = 0;
@@ -1410,7 +1407,8 @@ void mainLoop(void) {
initVar4 = 0; */
}
- if (affichePasMenuJoueur) {
+ if (affichePasMenuJoueur)
+ {
if (main5)
fadeVar = 0;
@@ -1422,38 +1420,51 @@ void mainLoop(void) {
mainDraw(0);
flipScreen();
- /* if (userEnabled && !main7 && !main15 && currentActiveMenu == -1)
- * {
- * getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
- *
- * if (mouseX != oldMouseX && mouseY != oldMouseY)
- * {
- * int cursorType;
- * int newCursor1;
- * int newCursor2;
- *
- * oldMouseX = mouseX;
- * oldMouseY = mouseY;
- *
- * cursorType = getCursorFromObject(mouseX, mouseY, &newCursor1, &newCursor2);
- *
- * if (cursorType == 9)
- * {
- * changeCursor(5);
- * }
- * else
- * if (cursorType == -1)
- * {
- * changeCursor(6);
- * }
- * else
- * {
- * changeCursor(4);
- * }
- *
- * }
- * }
- * else */
+ if (userEnabled && !main7 && !main15)
+ {
+ if(currentActiveMenu == -1)
+ {
+ int16 mouseX;
+ int16 mouseY;
+ int16 mouseButton;
+
+ static int16 oldMouseX = -1;
+ static int16 oldMouseY = -1;
+
+ getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
+
+ if (mouseX != oldMouseX && mouseY != oldMouseY)
+ {
+ int cursorType;
+ int newCursor1;
+ int newCursor2;
+
+ oldMouseX = mouseX;
+ oldMouseY = mouseY;
+
+ cursorType = getCursorFromObject(mouseX, mouseY, &newCursor1, &newCursor2);
+
+ if (cursorType == 9)
+ {
+ changeCursor(CURSOR_EXIT);
+ }
+ else
+ if (cursorType != -1)
+ {
+ changeCursor(CURSOR_MAGNIFYING_GLASS);
+ }
+ else
+ {
+ changeCursor(CURSOR_WALK);
+ }
+ }
+ }
+ else
+ {
+ changeCursor(CURSOR_NORMAL);
+ }
+ }
+ else
{
changeCursor(CURSOR_NORMAL);
}
diff --git a/engines/cruise/mouse.cpp b/engines/cruise/mouse.cpp
index 19d771229e..c60d9b459c 100644
--- a/engines/cruise/mouse.cpp
+++ b/engines/cruise/mouse.cpp
@@ -80,7 +80,7 @@ int16 main10;
static const byte mouseCursorWalk[] = {
0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x01, 0xE0,
- 0x3F, 0xF0, 0x03, 0x38, 0x1B, 0xDC, 0x1B, 0xCC,
+ 0x03, 0xF0, 0x03, 0x38, 0x1B, 0xDC, 0x1B, 0xCC,
0x03, 0xCC, 0x03, 0x80, 0x07, 0x00, 0x0E, 0xC0,
0x1C, 0xE0, 0x18, 0x70, 0x18, 0x38, 0x18, 0x18,