aboutsummaryrefslogtreecommitdiff
path: root/engines/queen
diff options
context:
space:
mode:
authorGregory Montoir2007-04-02 19:12:17 +0000
committerGregory Montoir2007-04-02 19:12:17 +0000
commit38eab5c5dff62ffcd7eb51e165c2a18d65737a0a (patch)
treec7d0b06319f66f27b87e46e1c963d575363d5dc2 /engines/queen
parent20ec8d2d343bbeea79b939c185fc2ed0772500bb (diff)
downloadscummvm-rg350-38eab5c5dff62ffcd7eb51e165c2a18d65737a0a.tar.gz
scummvm-rg350-38eab5c5dff62ffcd7eb51e165c2a18d65737a0a.tar.bz2
scummvm-rg350-38eab5c5dff62ffcd7eb51e165c2a18d65737a0a.zip
Re-introduced Input::getMousePos and removed g_system-
svn-id: r26372
Diffstat (limited to 'engines/queen')
-rw-r--r--engines/queen/command.cpp4
-rw-r--r--engines/queen/input.cpp16
-rw-r--r--engines/queen/input.h11
-rw-r--r--engines/queen/logic.cpp4
-rw-r--r--engines/queen/talk.cpp2
5 files changed, 24 insertions, 13 deletions
diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp
index 9a4896c68b..be6e1638bb 100644
--- a/engines/queen/command.cpp
+++ b/engines/queen/command.cpp
@@ -271,7 +271,7 @@ void Command::executeCurrentAction() {
void Command::updatePlayer() {
if (_vm->logic()->joeWalk() != JWM_MOVE) {
- Common::Point mouse = g_system->getEventManager()->getMousePos();
+ Common::Point mouse = _vm->input()->getMousePos();
lookForCurrentObject(mouse.x, mouse.y);
lookForCurrentIcon(mouse.x, mouse.y);
}
@@ -531,7 +531,7 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa
}
void Command::grabCurrentSelection() {
- Common::Point mouse = g_system->getEventManager()->getMousePos();
+ Common::Point mouse = _vm->input()->getMousePos();
_selPosX = mouse.x;
_selPosY = mouse.y;
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 0b58c46036..7f74a66734 100644
--- a/engines/queen/input.cpp
+++ b/engines/queen/input.cpp
@@ -49,10 +49,10 @@ const Verb Input::_verbKeys[] = {
};
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),
+ _system(system), _eventMan(system->getEventManager()), _fastMode(false),
+ _keyVerb(VERB_NONE), _cutawayRunning(false), _canQuit(false),
+ _cutawayQuit(false), _dialogueRunning(false), _talkQuit(false),
+ _quickSave(false), _quickLoad(false), _debugger(false), _inKey(0),
_mouseButton(0), _idleTime(0) {
switch (language) {
@@ -91,8 +91,7 @@ void Input::delay(uint amount) {
uint32 end = _system->getMillis() + amount;
do {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
_idleTime = 0;
switch (event.type) {
case Common::EVENT_KEYDOWN:
@@ -160,7 +159,7 @@ int Input::checkKeys() {
case KEY_DIGIT_4:
_keyVerb = VERB_DIGIT_4;
break;
- case KEY_ESCAPE: // slip cutaway / dialogue
+ case KEY_ESCAPE: // skip cutaway / dialogue
if (_canQuit) {
if (_cutawayRunning) {
debug(6, "[Input::checkKeys] Setting _cutawayQuit to true");
@@ -204,5 +203,8 @@ int Input::checkKeys() {
return inKey;
}
+Common::Point Input::getMousePos() const {
+ return _eventMan->getMousePos();
+}
} // End of namespace Queen
diff --git a/engines/queen/input.h b/engines/queen/input.h
index 169652bb0d..8f5e58302d 100644
--- a/engines/queen/input.h
+++ b/engines/queen/input.h
@@ -24,10 +24,15 @@
#define QUEEN_INPUT_H
#include "common/util.h"
+#include "common/rect.h"
#include "queen/defs.h"
class OSystem;
+namespace Common {
+ class EventManager;
+}
+
namespace Queen {
class Input {
@@ -36,7 +41,7 @@ public:
//! Adjust here to change delays!
enum {
DELAY_SHORT = 10,
- DELAY_NORMAL = 100,
+ DELAY_NORMAL = 100, // 5 * 20ms
DELAY_SCREEN_BLANKER = 5 * 60 * 1000
};
enum {
@@ -79,6 +84,8 @@ public:
Verb keyVerb() const { return _keyVerb; }
+ Common::Point getMousePos() const;
+
int mouseButton() const { return _mouseButton; }
void clearMouseButton() { _mouseButton = 0; }
@@ -110,6 +117,8 @@ private:
//! used to get keyboard and mouse events
OSystem *_system;
+ Common::EventManager *_eventMan;
+
//! some cutaways require update() run faster
bool _fastMode;
diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp
index eb63957aba..ebd31abd83 100644
--- a/engines/queen/logic.cpp
+++ b/engines/queen/logic.cpp
@@ -1177,7 +1177,7 @@ void Logic::handlePinnacleRoom() {
BobSlot *piton = _vm->graphics()->bob(7);
// set scrolling value to mouse position to avoid glitch
- Common::Point mouse = g_system->getEventManager()->getMousePos();
+ Common::Point mouse = _vm->input()->getMousePos();
_vm->display()->horizontalScroll(mouse.x);
joe->x = piton->x = 3 * mouse.x / 4 + 200;
@@ -1197,7 +1197,7 @@ void Logic::handlePinnacleRoom() {
while (_vm->input()->mouseButton() == 0 || _entryObj == 0) {
_vm->update();
- mouse = g_system->getEventManager()->getMousePos();
+ mouse = _vm->input()->getMousePos();
// update screen scrolling
_vm->display()->horizontalScroll(mouse.x);
diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp
index fd8d6e1ec7..2bb45a243a 100644
--- a/engines/queen/talk.cpp
+++ b/engines/queen/talk.cpp
@@ -1271,7 +1271,7 @@ int16 Talk::selectSentence() {
_vm->update();
- Common::Point mouse = g_system->getEventManager()->getMousePos();
+ Common::Point mouse = _vm->input()->getMousePos();
zone = _vm->grid()->findZoneForPos(GS_PANEL, mouse.x, mouse.y);
int mouseButton = _vm->input()->mouseButton();