aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/animseq.cpp6
-rw-r--r--engines/lure/debug-input.cpp2
-rw-r--r--engines/lure/events.cpp34
-rw-r--r--engines/lure/events.h9
-rw-r--r--engines/lure/game.cpp10
-rw-r--r--engines/lure/intro.cpp4
-rw-r--r--engines/lure/menu.cpp6
-rw-r--r--engines/lure/surface.cpp6
8 files changed, 39 insertions, 38 deletions
diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp
index 5b13ae21d4..dfcdefc374 100644
--- a/engines/lure/animseq.cpp
+++ b/engines/lure/animseq.cpp
@@ -38,12 +38,12 @@ AnimAbortType AnimationSequence::delay(uint32 milliseconds) {
while (_system.getMillis() < delayCtr) {
while (events.pollEvent()) {
- if (events.type() == OSystem::EVENT_KEYDOWN) {
+ if (events.type() == Common::EVENT_KEYDOWN) {
if (events.event().kbd.keycode == 27) return ABORT_END_INTRO;
else return ABORT_NEXT_SCENE;
- } else if (events.type() == OSystem::EVENT_LBUTTONDOWN)
+ } else if (events.type() == Common::EVENT_LBUTTONDOWN)
return ABORT_NEXT_SCENE;
- else if (events.type() == OSystem::EVENT_QUIT)
+ else if (events.type() == Common::EVENT_QUIT)
return ABORT_END_INTRO;
}
diff --git a/engines/lure/debug-input.cpp b/engines/lure/debug-input.cpp
index 9c6d7bf707..7a061aea03 100644
--- a/engines/lure/debug-input.cpp
+++ b/engines/lure/debug-input.cpp
@@ -53,7 +53,7 @@ bool get_string(char *buffer, uint32 maxSize, bool isNumeric, uint16 x, uint16 y
}
if (e.pollEvent()) {
- if (e.type() == OSystem::EVENT_KEYDOWN) {
+ if (e.type() == Common::EVENT_KEYDOWN) {
char ch = e.event().kbd.ascii;
uint16 keycode = e.event().kbd.keycode;
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 3bc81583d7..707263ccbc 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -50,21 +50,21 @@ Mouse::Mouse() {
Mouse::~Mouse() {
}
-void Mouse::handleEvent(OSystem::Event event) {
+void Mouse::handleEvent(Common::Event event) {
_x = (int16) event.mouse.x;
_y = (int16) event.mouse.y;
switch (event.type) {
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_lButton = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_lButton = false;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_rButton = true;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_rButton = false;
break;
default:
@@ -153,17 +153,17 @@ bool Events::pollEvent() {
// Handle keypress
switch (_event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitFlag = true;
break;
- case OSystem::EVENT_LBUTTONDOWN:
- case OSystem::EVENT_LBUTTONUP:
- case OSystem::EVENT_RBUTTONDOWN:
- case OSystem::EVENT_RBUTTONUP:
- case OSystem::EVENT_MOUSEMOVE:
- case OSystem::EVENT_WHEELUP:
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONUP:
+ case Common::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONUP:
+ case Common::EVENT_MOUSEMOVE:
+ case Common::EVENT_WHEELUP:
+ case Common::EVENT_WHEELDOWN:
Mouse::getReference().handleEvent(_event);
break;
@@ -178,10 +178,10 @@ void Events::waitForPress() {
bool keyButton = false;
while (!keyButton) {
if (pollEvent()) {
- if (_event.type == OSystem::EVENT_QUIT) return;
- else if (_event.type == OSystem::EVENT_KEYDOWN) keyButton = true;
- else if ((_event.type == OSystem::EVENT_LBUTTONDOWN) ||
- (_event.type == OSystem::EVENT_RBUTTONDOWN)) {
+ if (_event.type == Common::EVENT_QUIT) return;
+ else if (_event.type == Common::EVENT_KEYDOWN) keyButton = true;
+ else if ((_event.type == Common::EVENT_LBUTTONDOWN) ||
+ (_event.type == Common::EVENT_RBUTTONDOWN)) {
keyButton = true;
Mouse::getReference().waitForRelease();
}
diff --git a/engines/lure/events.h b/engines/lure/events.h
index 435edc0a15..45a664d572 100644
--- a/engines/lure/events.h
+++ b/engines/lure/events.h
@@ -24,6 +24,7 @@
#define LURE_EVENTS_H
#include "common/stdafx.h"
+#include "common/events.h"
#include "common/str.h"
#include "lure/luredefs.h"
#include "lure/disk.h"
@@ -39,7 +40,7 @@ public:
Mouse();
~Mouse();
static Mouse &getReference();
- void handleEvent(OSystem::Event event);
+ void handleEvent(Common::Event event);
void cursorOn();
void cursorOff();
@@ -59,7 +60,7 @@ public:
class Events {
private:
- OSystem::Event _event;
+ Common::Event _event;
public:
bool quitFlag;
@@ -68,8 +69,8 @@ public:
bool pollEvent();
void waitForPress();
- OSystem::Event event() { return _event; }
- OSystem::EventType type() { return _event.type; }
+ Common::Event event() { return _event; }
+ Common::EventType type() { return _event.type; }
};
} // End of namespace Lure
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index 600173af20..6a2ebedcf2 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -124,10 +124,10 @@ void Game::execute() {
res.delayList().tick();
while (events.pollEvent()) {
- if (events.type() == OSystem::EVENT_KEYDOWN) {
+ if (events.type() == Common::EVENT_KEYDOWN) {
uint16 roomNum = room.roomNumber();
- if ((events.event().kbd.flags == OSystem::KBD_CTRL) &&
+ if ((events.event().kbd.flags == Common::KBD_CTRL) &&
(events.event().kbd.keycode == 'd')) {
// Activate the debugger
_debugger->attach();
@@ -171,8 +171,8 @@ void Game::execute() {
}
}
- if ((events.type() == OSystem::EVENT_LBUTTONDOWN) ||
- (events.type() == OSystem::EVENT_RBUTTONDOWN))
+ if ((events.type() == Common::EVENT_LBUTTONDOWN) ||
+ (events.type() == Common::EVENT_RBUTTONDOWN))
handleClick();
}
@@ -778,7 +778,7 @@ void Game::doQuit() {
char key = '\0';
do {
if (events.pollEvent()) {
- if (events.event().type == OSystem::EVENT_KEYDOWN) {
+ if (events.event().type == Common::EVENT_KEYDOWN) {
key = events.event().kbd.ascii;
if ((key >= 'A') && (key <= 'Z')) key += 'a' - 'A';
}
diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp
index 58bca80239..c50c5bd8ef 100644
--- a/engines/lure/intro.cpp
+++ b/engines/lure/intro.cpp
@@ -68,9 +68,9 @@ bool Introduction::delay(uint32 milliseconds) {
if (events.quitFlag) return true;
if (events.pollEvent()) {
- if (events.type() == OSystem::EVENT_KEYDOWN)
+ if (events.type() == Common::EVENT_KEYDOWN)
return events.event().kbd.keycode == 27;
- else if (events.type() == OSystem::EVENT_LBUTTONDOWN)
+ else if (events.type() == Common::EVENT_LBUTTONDOWN)
return false;
}
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 21f9f78bb5..84f07a7b31 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -474,7 +474,7 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
goto bail_out;
}
- else if (e.type() == OSystem::EVENT_KEYDOWN) {
+ else if (e.type() == Common::EVENT_KEYDOWN) {
byte ch = e.event().kbd.ascii;
uint16 keycode = e.event().kbd.keycode;
@@ -492,11 +492,11 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
goto bail_out;
}
- } else if (e.type() == OSystem::EVENT_LBUTTONDOWN) {
+ } else if (e.type() == Common::EVENT_LBUTTONDOWN) {
//mouse.waitForRelease();
goto bail_out;
- } else if (e.type() == OSystem::EVENT_RBUTTONDOWN) {
+ } else if (e.type() == Common::EVENT_RBUTTONDOWN) {
mouse.waitForRelease();
selectedIndex = 0xffff;
goto bail_out;
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index bd8a5e4359..b05fd0596c 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -415,7 +415,7 @@ bool Surface::getString(Common::String &line, uint32 maxSize, bool isNumeric, bo
if (abortFlag) break;
if (events.pollEvent()) {
- if (events.type() == OSystem::EVENT_KEYDOWN) {
+ if (events.type() == Common::EVENT_KEYDOWN) {
char ch = events.event().kbd.ascii;
uint16 keycode = events.event().kbd.keycode;
@@ -684,12 +684,12 @@ bool SaveRestoreDialog::show(bool saveDialog) {
if (abortFlag) break;
if (events.pollEvent()) {
- if ((events.type() == OSystem::EVENT_KEYDOWN) &&
+ if ((events.type() == Common::EVENT_KEYDOWN) &&
(events.event().kbd.ascii == 27)) {
abortFlag = true;
break;
}
- if (events.type() == OSystem::EVENT_MOUSEMOVE) {
+ if (events.type() == Common::EVENT_MOUSEMOVE) {
// Mouse movement
int lineNum;
if ((mouse.x() < (SAVE_DIALOG_X + DIALOG_EDGE_SIZE)) ||