[Scummvm-cvs-logs] SF.net SVN: scummvm: [28849] scummvm/trunk/engines/agi/preagi_mickey.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Sep 4 08:54:40 CEST 2007


Revision: 28849
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28849&view=rev
Author:   thebluegr
Date:     2007-09-03 23:54:40 -0700 (Mon, 03 Sep 2007)

Log Message:
-----------
The mouse cursor is now visible in Mickey. Also, the enter key on the keypad works now. Some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi_mickey.cpp

Modified: scummvm/trunk/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-03 15:03:50 UTC (rev 28848)
+++ scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-04 06:54:40 UTC (rev 28849)
@@ -27,6 +27,8 @@
 #include "common/events.h"
 #include "common/savefile.h"
 
+#include "graphics/cursorman.h"
+
 #include "agi/preagi_mickey.h"
 #include "agi/graphics.h"
 
@@ -322,18 +324,15 @@
 				if (iRow < 2) {
 					x = event.mouse.x / 8;
 					y = event.mouse.y / 8;
-					getMouseMenuSelRow(menu, sel0, sel1, iRow, x, y);
-					drawMenu(menu, *sel0, *sel1);
+					// If the mouse hovers over the menu, refresh the menu
+					if ((iRow == 0 && y == IDI_MSA_ROW_MENU_0) || (iRow == 1 && y == IDI_MSA_ROW_MENU_1)) {
+						getMouseMenuSelRow(menu, sel0, sel1, iRow, x, y);
+						drawMenu(menu, *sel0, *sel1);
+					}
 				}
 				break;
 			case Common::EVENT_LBUTTONUP:
 				return true;
-			//FIXME: ScummVM does not support middle button
-			/*case Common::EVENT_MBUTTONUP:
-				inventory();
-				drawRoom();
-				*sel0 = 0; *sel1 = -1;
-				return false;*/
 			case Common::EVENT_RBUTTONUP:
 				*sel0 = 0; *sel1 = -1; 
 				return false;
@@ -394,8 +393,7 @@
 					}
 					break;
 				case Common::KEYCODE_RETURN:
-				//FIXME:
-				//case SDLK_KP_ENTER:
+				case Common::KEYCODE_KP_ENTER:
 					return true;
 				default:
 					break;
@@ -420,6 +418,9 @@
 	*sel0 = 0;
 	*sel1 = -1;
 
+	// Show the mouse cursor for the menu
+	CursorMan.showMouse(true);
+
 	for (;;) {
 		for (;;) {
 			if (getMenuSelRow(menu, sel0, sel1, 0)) {
@@ -433,6 +434,9 @@
 			break;
 		}
 	}
+
+	// Menu selection made, hide the mouse cursor
+	CursorMan.showMouse(false);
 }
 
 void Mickey::centerMenu(MSA_MENU *menu) {
@@ -1094,6 +1098,8 @@
 
 	sprintf(szCrystals, IDS_MSA_CRYSTALS, IDS_MSA_CRYSTAL_NO[game.nXtals]);
 
+	CursorMan.showMouse(false);
+
 	_vm->clearScreen(IDA_DEFAULT);
 	_vm->drawStr(IDI_MSA_ROW_INV_TITLE, IDI_MSA_COL_INV_TITLE, IDA_DEFAULT, IDS_MSA_INVENTORY);
 	_vm->drawStr(IDI_MSA_ROW_INV_CRYSTALS, IDI_MSA_COL_INV_ITEMS, IDA_DEFAULT, szCrystals);
@@ -1109,6 +1115,8 @@
 	_vm->waitAnyKey();
 
 	_vm->clearScreen(IDA_DEFAULT);
+
+	CursorMan.showMouse(true);
 }
 
 void Mickey::randomize() {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list