[Scummvm-cvs-logs] SF.net SVN: scummvm: [26224] scummvm/trunk/engines/queen

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Mar 18 19:55:12 CET 2007


Revision: 26224
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26224&view=rev
Author:   fingolfin
Date:     2007-03-18 11:55:11 -0700 (Sun, 18 Mar 2007)

Log Message:
-----------
QUEEN: Make use of EventManager::getMousePos

Modified Paths:
--------------
    scummvm/trunk/engines/queen/command.cpp
    scummvm/trunk/engines/queen/input.cpp
    scummvm/trunk/engines/queen/input.h
    scummvm/trunk/engines/queen/logic.cpp
    scummvm/trunk/engines/queen/talk.cpp

Modified: scummvm/trunk/engines/queen/command.cpp
===================================================================
--- scummvm/trunk/engines/queen/command.cpp	2007-03-18 18:45:36 UTC (rev 26223)
+++ scummvm/trunk/engines/queen/command.cpp	2007-03-18 18:55:11 UTC (rev 26224)
@@ -21,6 +21,8 @@
  */
 
 #include "common/stdafx.h"
+#include "common/events.h"
+#include "common/system.h"
 #include "queen/command.h"
 
 #include "queen/display.h"
@@ -269,10 +271,9 @@
 
 void Command::updatePlayer() {
 	if (_vm->logic()->joeWalk() != JWM_MOVE) {
-		int16 cx = _vm->input()->mousePosX();
-		int16 cy = _vm->input()->mousePosY();
-		lookForCurrentObject(cx, cy);
-		lookForCurrentIcon(cx, cy);
+		Common::Point mouse = g_system->getEventManager()->getMousePos();
+		lookForCurrentObject(mouse.x, mouse.y);
+		lookForCurrentIcon(mouse.x, mouse.y);
 	}
 
 	if (_vm->input()->keyVerb() != VERB_NONE) {
@@ -530,8 +531,9 @@
 }
 
 void Command::grabCurrentSelection() {
-	_selPosX = _vm->input()->mousePosX();
-	_selPosY = _vm->input()->mousePosY();
+	Common::Point mouse = g_system->getEventManager()->getMousePos();
+	_selPosX = mouse.x;
+	_selPosY = mouse.y;
 
 	uint16 zone = _vm->grid()->findObjectUnderCursor(_selPosX, _selPosY);
 	_state.noun = _vm->grid()->findObjectNumber(zone);

Modified: scummvm/trunk/engines/queen/input.cpp
===================================================================
--- scummvm/trunk/engines/queen/input.cpp	2007-03-18 18:45:36 UTC (rev 26223)
+++ scummvm/trunk/engines/queen/input.cpp	2007-03-18 18:55:11 UTC (rev 26224)
@@ -52,8 +52,8 @@
 	_system(system), _fastMode(false), _keyVerb(VERB_NONE),
 	_cutawayRunning(false), _canQuit(false), _cutawayQuit(false),
 	_dialogueRunning(false), _talkQuit(false), _quickSave(false),
-	_quickLoad(false), _debugger(false), _inKey(0), _mouse_x(0),
-	_mouse_y(0), _mouseButton(0), _idleTime(0) {
+	_quickLoad(false), _debugger(false), _inKey(0),
+	_mouseButton(0), _idleTime(0) {
 
 	switch (language) {
 	case Common::EN_ANY:
@@ -108,21 +108,12 @@
 				}
 				break;
 
-			case Common::EVENT_MOUSEMOVE:
-				_mouse_x = event.mouse.x;
-				_mouse_y = event.mouse.y;
-				break;
-
 			case Common::EVENT_LBUTTONDOWN:
 				_mouseButton |= MOUSE_LBUTTON;
-				_mouse_x = event.mouse.x;
-				_mouse_y = event.mouse.y;
 				break;
 
 			case Common::EVENT_RBUTTONDOWN:
 				_mouseButton |= MOUSE_RBUTTON;
-				_mouse_x = event.mouse.x;
-				_mouse_y = event.mouse.y;
 				break;
 
 			case Common::EVENT_QUIT:

Modified: scummvm/trunk/engines/queen/input.h
===================================================================
--- scummvm/trunk/engines/queen/input.h	2007-03-18 18:45:36 UTC (rev 26223)
+++ scummvm/trunk/engines/queen/input.h	2007-03-18 18:55:11 UTC (rev 26224)
@@ -83,9 +83,6 @@
 
 	Verb keyVerb() const { return _keyVerb; }
 
-	int mousePosX() const { return _mouse_x; }
-	int mousePosY() const { return _mouse_y; }
-
 	int mouseButton() const { return _mouseButton; }
 	void clearMouseButton() { _mouseButton = 0; }
 
@@ -151,9 +148,6 @@
 	int _inKey;
 
 	//! set by delay();
-	int _mouse_x, _mouse_y;
-
-	//! set by delay();
 	int _mouseButton;
 
 	//! user idle time

Modified: scummvm/trunk/engines/queen/logic.cpp
===================================================================
--- scummvm/trunk/engines/queen/logic.cpp	2007-03-18 18:45:36 UTC (rev 26223)
+++ scummvm/trunk/engines/queen/logic.cpp	2007-03-18 18:55:11 UTC (rev 26224)
@@ -21,9 +21,12 @@
  */
 
 #include "common/stdafx.h"
+#include "common/config-manager.h"
+#include "common/events.h"
+#include "common/system.h"
+
 #include "queen/logic.h"
 
-#include "common/config-manager.h"
 #include "queen/bankman.h"
 #include "queen/command.h"
 #include "queen/credits.h"
@@ -1174,10 +1177,11 @@
 	BobSlot *piton = _vm->graphics()->bob(7);
 
 	// set scrolling value to mouse position to avoid glitch
-	_vm->display()->horizontalScroll(_vm->input()->mousePosX());
+	Common::Point mouse = g_system->getEventManager()->getMousePos();
+	_vm->display()->horizontalScroll(mouse.x);
 
-	joe->x = piton->x = 3 * _vm->input()->mousePosX() / 4 + 200;
-	joe->frameNum = _vm->input()->mousePosX() / 36 + 45;
+	joe->x = piton->x = 3 * mouse.x / 4 + 200;
+	joe->frameNum = mouse.x / 36 + 45;
 
 	// bobs have been unpacked from animating objects, we don't need them
 	// to animate anymore ; so turn animation off
@@ -1193,19 +1197,18 @@
 	while (_vm->input()->mouseButton() == 0 || _entryObj == 0) {
 
 		_vm->update();
-		int mx = _vm->input()->mousePosX();
-		int my = _vm->input()->mousePosY();
+		mouse = g_system->getEventManager()->getMousePos();
 
 		// update screen scrolling
-		_vm->display()->horizontalScroll(mx);
+		_vm->display()->horizontalScroll(mouse.x);
 
 		// update bobs position / frame
-		joe->x = piton->x = 3 * mx / 4 + 200;
-		joe->frameNum = mx / 36 + 45;
+		joe->x = piton->x = 3 * mouse.x / 4 + 200;
+		joe->frameNum = mouse.x / 36 + 45;
 
 		_vm->display()->clearTexts(5, 5);
 
-		uint16 curObj = _vm->grid()->findObjectUnderCursor(mx, my);
+		uint16 curObj = _vm->grid()->findObjectUnderCursor(mouse.x, mouse.y);
 		if (curObj != 0 && curObj != prevObj) {
 			_entryObj = 0;
 			curObj += currentRoomData(); // global object number

Modified: scummvm/trunk/engines/queen/talk.cpp
===================================================================
--- scummvm/trunk/engines/queen/talk.cpp	2007-03-18 18:45:36 UTC (rev 26223)
+++ scummvm/trunk/engines/queen/talk.cpp	2007-03-18 18:55:11 UTC (rev 26224)
@@ -21,7 +21,10 @@
  */
 
 #include "common/stdafx.h"
+#include "common/events.h"
+#include "common/system.h"
 #include "common/rect.h"
+
 #include "queen/talk.h"
 
 #include "queen/bankman.h"
@@ -1268,7 +1271,8 @@
 
 				_vm->update();
 
-				zone = _vm->grid()->findZoneForPos(GS_PANEL, _vm->input()->mousePosX(), _vm->input()->mousePosY());
+				Common::Point mouse = g_system->getEventManager()->getMousePos();
+				zone = _vm->grid()->findZoneForPos(GS_PANEL, mouse.x, mouse.y);
 
 				int mouseButton = _vm->input()->mouseButton();
 				_vm->input()->clearMouseButton();
@@ -1326,8 +1330,7 @@
 					}
 
 					_vm->input()->clearKeyVerb();
-				}
-				else if (mouseButton) {
+				} else if (mouseButton) {
 					selectedSentence = zone;
 				}
 


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