aboutsummaryrefslogtreecommitdiff
path: root/engines/queen
diff options
context:
space:
mode:
authorMax Horn2007-03-18 18:55:11 +0000
committerMax Horn2007-03-18 18:55:11 +0000
commitb44d93d068e3309dd5c994c64fd06c4d25aa24f1 (patch)
tree5f8886d036ecc75652df28cc38605d5525df04d7 /engines/queen
parent94739cdbca5d0fe6b600ec014df7f8a71b94a5f4 (diff)
downloadscummvm-rg350-b44d93d068e3309dd5c994c64fd06c4d25aa24f1.tar.gz
scummvm-rg350-b44d93d068e3309dd5c994c64fd06c4d25aa24f1.tar.bz2
scummvm-rg350-b44d93d068e3309dd5c994c64fd06c4d25aa24f1.zip
QUEEN: Make use of EventManager::getMousePos
svn-id: r26224
Diffstat (limited to 'engines/queen')
-rw-r--r--engines/queen/command.cpp14
-rw-r--r--engines/queen/input.cpp13
-rw-r--r--engines/queen/input.h6
-rw-r--r--engines/queen/logic.cpp23
-rw-r--r--engines/queen/talk.cpp9
5 files changed, 29 insertions, 36 deletions
diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp
index 42e8634270..9a4896c68b 100644
--- a/engines/queen/command.cpp
+++ b/engines/queen/command.cpp
@@ -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::executeCurrentAction() {
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 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa
}
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);
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 2d67e17385..02573d4d3e 100644
--- a/engines/queen/input.cpp
+++ b/engines/queen/input.cpp
@@ -52,8 +52,8 @@ Input::Input(Common::Language language, OSystem *system) :
_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 @@ void Input::delay(uint amount) {
}
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:
diff --git a/engines/queen/input.h b/engines/queen/input.h
index c83cc5da34..e1d3086b65 100644
--- a/engines/queen/input.h
+++ b/engines/queen/input.h
@@ -83,9 +83,6 @@ public:
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 @@ private:
int _inKey;
//! set by delay();
- int _mouse_x, _mouse_y;
-
- //! set by delay();
int _mouseButton;
//! user idle time
diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp
index 071f1778ba..eb63957aba 100644
--- a/engines/queen/logic.cpp
+++ b/engines/queen/logic.cpp
@@ -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 @@ void Logic::handlePinnacleRoom() {
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 @@ void Logic::handlePinnacleRoom() {
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
diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp
index f93674e2ff..fd8d6e1ec7 100644
--- a/engines/queen/talk.cpp
+++ b/engines/queen/talk.cpp
@@ -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 @@ int16 Talk::selectSentence() {
_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 @@ int16 Talk::selectSentence() {
}
_vm->input()->clearKeyVerb();
- }
- else if (mouseButton) {
+ } else if (mouseButton) {
selectedSentence = zone;
}