[Scummvm-cvs-logs] SF.net SVN: scummvm:[55332] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Wed Jan 19 19:02:53 CET 2011
Revision: 55332
http://scummvm.svn.sourceforge.net/scummvm/?rev=55332&view=rev
Author: strangerke
Date: 2011-01-19 18:02:53 +0000 (Wed, 19 Jan 2011)
Log Message:
-----------
HUGO: Move mouseHander() out of runMachine()
Modified Paths:
--------------
scummvm/trunk/engines/hugo/hugo.cpp
scummvm/trunk/engines/hugo/inventory.cpp
scummvm/trunk/engines/hugo/mouse.cpp
Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2011-01-19 16:55:47 UTC (rev 55331)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2011-01-19 18:02:53 UTC (rev 55332)
@@ -313,6 +313,9 @@
break;
}
}
+ _mouse->mouseHandler(); // Mouse activity - adds to display list
+ _screen->displayList(D_DISPLAY); // Blit the display list to screen
+
_status.doQuitFl |= shouldQuit(); // update game quit flag
}
return Common::kNoError;
@@ -374,7 +377,6 @@
_scheduler->runScheduler(); // Process any actions
_screen->displayList(D_RESTORE); // Restore previous background
_object->updateImages(); // Draw into _frontBuffer, compile display list
- _mouse->mouseHandler(); // Mouse activity - adds to display list
_screen->drawStatusText();
_screen->displayList(D_DISPLAY); // Blit the display list to screen
_sound->checkMusic();
Modified: scummvm/trunk/engines/hugo/inventory.cpp
===================================================================
--- scummvm/trunk/engines/hugo/inventory.cpp 2011-01-19 16:55:47 UTC (rev 55331)
+++ scummvm/trunk/engines/hugo/inventory.cpp 2011-01-19 18:02:53 UTC (rev 55332)
@@ -229,7 +229,6 @@
case I_ACTIVE: // Inventory active
_vm->_parser->charHandler(); // Still allow commands
_vm->_screen->displayList(D_RESTORE); // Restore previous background
- _vm->_mouse->mouseHandler(); // Mouse activity - adds to display list
_vm->_screen->displayList(D_DISPLAY); // Blit the display list to screen
break;
}
Modified: scummvm/trunk/engines/hugo/mouse.cpp
===================================================================
--- scummvm/trunk/engines/hugo/mouse.cpp 2011-01-19 16:55:47 UTC (rev 55331)
+++ scummvm/trunk/engines/hugo/mouse.cpp 2011-01-19 18:02:53 UTC (rev 55332)
@@ -242,11 +242,14 @@
void MouseHandler::mouseHandler() {
debugC(2, kDebugMouse, "mouseHandler");
+ status_t &gameStatus = _vm->getGameStatus();
+
+ if ((gameStatus.viewState != V_PLAY) && (gameStatus.inventoryState != I_ACTIVE))
+ return;
+
int16 cx = _vm->getMouseX();
int16 cy = _vm->getMouseY();
- status_t &gameStatus = _vm->getGameStatus();
-
gameStatus.cx = cx; // Save cursor coords
gameStatus.cy = cy;
@@ -264,29 +267,30 @@
}
}
- if (objId == -1) // No match, check rest of view
- objId = _vm->_object->findObject(cx, cy);
- if (objId >= 0) { // Got a match
- // Display object name next to cursor (unless CURSOR_NOCHAR)
- // Note test for swapped hero name
- char *name = _vm->_arrayNouns[_vm->_object->_objects[(objId == HERO) ? _vm->_heroImage : objId].nounIndex][CURSOR_NAME];
- if (name[0] != CURSOR_NOCHAR)
- cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);
+ if (!gameStatus.gameOverFl) {
+ if (objId == -1) // No match, check rest of view
+ objId = _vm->_object->findObject(cx, cy);
+ if (objId >= 0) { // Got a match
+ // Display object name next to cursor (unless CURSOR_NOCHAR)
+ // Note test for swapped hero name
+ char *name = _vm->_arrayNouns[_vm->_object->_objects[(objId == HERO) ? _vm->_heroImage : objId].nounIndex][CURSOR_NAME];
+ if (name[0] != CURSOR_NOCHAR)
+ cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);
- // Process right click over object in view or iconbar
- if (gameStatus.rightButtonFl)
- processRightClick(objId, cx, cy);
- }
+ // Process right click over object in view or iconbar
+ if (gameStatus.rightButtonFl)
+ processRightClick(objId, cx, cy);
+ }
- // Process cursor over an exit hotspot
- if (objId == -1) {
- int i = findExit(cx, cy);
- if (i != -1 && _vm->_hotspots[i].viewx >= 0) {
- objId = EXIT_HOTSPOT;
- cursorText(_vm->_textMouse[kMsExit], cx, cy, U_FONT8, _TBRIGHTWHITE);
+ // Process cursor over an exit hotspot
+ if (objId == -1) {
+ int i = findExit(cx, cy);
+ if (i != -1 && _vm->_hotspots[i].viewx >= 0) {
+ objId = EXIT_HOTSPOT;
+ cursorText(_vm->_textMouse[kMsExit], cx, cy, U_FONT8, _TBRIGHTWHITE);
+ }
}
}
-
// Left click over icon, object or to move somewhere
if (gameStatus.leftButtonFl)
processLeftClick(objId, cx, cy);
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