aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2007-03-17 19:02:05 +0000
committerMax Horn2007-03-17 19:02:05 +0000
commited54ea9155961d8ca5d5fb3c7777fc57a29f2751 (patch)
tree467b926af11cd4129ba003d04ba01de044c7a6df /engines
parentf272d1957084098c5b53975ad3501074f6971af8 (diff)
downloadscummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.tar.gz
scummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.tar.bz2
scummvm-rg350-ed54ea9155961d8ca5d5fb3c7777fc57a29f2751.zip
Moved Event/EventType/keyboard enum from common/system.h (part of class OSystem) to common/events.h (part of namespace Common). Porters may have to make minor changes to their backends to get them to compile again
svn-id: r26180
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi.cpp28
-rw-r--r--engines/agos/animation.cpp14
-rw-r--r--engines/agos/event.cpp24
-rw-r--r--engines/cine/main_loop.cpp12
-rw-r--r--engines/gob/util.cpp18
-rw-r--r--engines/kyra/gui.cpp24
-rw-r--r--engines/kyra/kyra.cpp28
-rw-r--r--engines/kyra/sequences_v1.cpp6
-rw-r--r--engines/kyra/text.cpp8
-rw-r--r--engines/kyra/vqa.cpp6
-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
-rw-r--r--engines/parallaction/dialogue.cpp6
-rw-r--r--engines/parallaction/parallaction.cpp22
-rw-r--r--engines/queen/input.cpp14
-rw-r--r--engines/queen/journal.cpp12
-rw-r--r--engines/saga/input.cpp22
-rw-r--r--engines/scumm/input.cpp42
-rw-r--r--engines/scumm/scumm.cpp4
-rw-r--r--engines/sky/control.cpp18
-rw-r--r--engines/sky/intro.cpp6
-rw-r--r--engines/sky/mouse.cpp4
-rw-r--r--engines/sky/screen.cpp4
-rw-r--r--engines/sky/sky.cpp16
-rw-r--r--engines/sword1/animation.cpp8
-rw-r--r--engines/sword1/control.cpp16
-rw-r--r--engines/sword1/credits.cpp4
-rw-r--r--engines/sword1/sword1.cpp16
-rw-r--r--engines/sword2/animation.cpp8
-rw-r--r--engines/sword2/sword2.cpp26
-rw-r--r--engines/touche/touche.cpp18
-rw-r--r--engines/touche/ui.cpp18
38 files changed, 265 insertions, 264 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 5064b437ab..fc57a7f41f 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -58,60 +58,60 @@ void AgiEngine::allowSynthetic(bool allow) {
}
void AgiEngine::processEvents() {
- OSystem::Event event;
+ Common::Event event;
int key = 0;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_gfx->deinitVideo();
_gfx->deinitMachine();
_system->quit();
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
key = BUTTON_LEFT;
g_mouse.button = 1;
keyEnqueue(key);
g_mouse.x = event.mouse.x;
g_mouse.y = event.mouse.y;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
key = BUTTON_RIGHT;
g_mouse.button = 2;
keyEnqueue(key);
g_mouse.x = event.mouse.x;
g_mouse.y = event.mouse.y;
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
key = WHEEL_UP;
keyEnqueue(key);
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
key = WHEEL_DOWN;
keyEnqueue(key);
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
g_mouse.x = event.mouse.x;
g_mouse.y = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONUP:
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
g_mouse.button = 0;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
_keyControl = 0;
_keyAlt = 0;
- if (event.kbd.flags == OSystem::KBD_CTRL && event.kbd.keycode == 'd') {
+ if (event.kbd.flags == Common::KBD_CTRL && event.kbd.keycode == 'd') {
_console->attach();
break;
}
- if (event.kbd.flags & OSystem::KBD_CTRL)
+ if (event.kbd.flags & Common::KBD_CTRL)
_keyControl = 1;
- if (event.kbd.flags & OSystem::KBD_ALT)
+ if (event.kbd.flags & Common::KBD_ALT)
_keyAlt = 1;
switch (key = event.kbd.keycode) {
@@ -221,7 +221,7 @@ void AgiEngine::processEvents() {
key = (key & ~0x20) - 0x40;
else if (_keyAlt)
key = scancodeTable[(key & ~0x20) - 0x41] << 8;
- else if (event.kbd.flags & OSystem::KBD_SHIFT)
+ else if (event.kbd.flags & Common::KBD_SHIFT)
key = event.kbd.ascii;
break;
}
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 3d37972e46..3d8ec156ce 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -233,29 +233,29 @@ void MoviePlayer::handleNextFrame() {
_vm->_system->updateScreen();
_frameNum++;
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _vm->_system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.ascii == 27) {
_leftButtonDown = true;
_rightButtonDown = true;
}
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_leftButtonDown = true;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_rightButtonDown = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_leftButtonDown = false;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_rightButtonDown = false;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_vm->_system->quit();
break;
default:
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 4d8f8189ed..1987f4d080 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -299,7 +299,7 @@ void AGOSEngine::scrollEvent() {
}
void AGOSEngine::delay(uint amount) {
- OSystem::Event event;
+ Common::Event event;
uint32 start = _system->getMillis();
uint32 cur = start;
@@ -335,10 +335,10 @@ void AGOSEngine::delay(uint amount) {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode >= '0' && event.kbd.keycode <='9'
- && (event.kbd.flags == OSystem::KBD_ALT ||
- event.kbd.flags == OSystem::KBD_CTRL)) {
+ && (event.kbd.flags == Common::KBD_ALT ||
+ event.kbd.flags == Common::KBD_CTRL)) {
_saveLoadSlot = event.kbd.keycode - '0';
// There is no save slot 0
@@ -346,13 +346,13 @@ void AGOSEngine::delay(uint amount) {
_saveLoadSlot = 10;
sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot);
- _saveLoadType = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2;
+ _saveLoadType = (event.kbd.flags == Common::KBD_ALT) ? 1 : 2;
// We should only allow a load or save when it was possible in original
// This stops load/save during copy protection, conversations and cut scenes
if (!_mouseHideCount && !_showPreposition)
quickLoadOrSave();
- } else if (event.kbd.flags == OSystem::KBD_CTRL) {
+ } else if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'a') {
GUI::Dialog *_aboutDialog;
_aboutDialog = new GUI::AboutDialog();
@@ -364,7 +364,7 @@ void AGOSEngine::delay(uint amount) {
}
if (getGameType() == GType_PP) {
- if (event.kbd.flags == OSystem::KBD_SHIFT)
+ if (event.kbd.flags == Common::KBD_SHIFT)
_variableArray[41] = 0;
else
_variableArray[41] = 1;
@@ -376,11 +376,11 @@ void AGOSEngine::delay(uint amount) {
else
_keyPressed = (byte)event.kbd.ascii;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_sdlMouseX = event.mouse.x;
_sdlMouseY = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
if (getGameType() == GType_FF)
setBitFlag(89, true);
_leftButtonDown++;
@@ -391,19 +391,19 @@ void AGOSEngine::delay(uint amount) {
_sdlMouseY = event.mouse.y;
#endif
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
if (getGameType() == GType_FF)
setBitFlag(89, false);
_leftButton = 0;
_leftButtonCount = 0;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
if (getGameType() == GType_FF)
setBitFlag(92, false);
_rightButtonDown++;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
shutdown();
return;
default:
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index aeb7dede17..b1816eae9c 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -46,25 +46,25 @@ uint16 mouseUpdateStatus;
uint16 dummyU16;
void manageEvents(int count) {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = g_system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
mouseLeft = 1;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
mouseRight = 1;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
mouseData.X = event.mouse.x;
mouseData.Y = event.mouse.y;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
g_system->quit();
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {
case '\n':
case '\r':
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 5eec30e617..007ec7af22 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -140,32 +140,32 @@ int16 Util::getRandom(int16 max) {
}
void Util::processInput() {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = g_system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseButtons |= 1;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_mouseButtons |= 2;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mouseButtons &= ~1;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_mouseButtons &= ~2;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
addKeyToBuffer(event.kbd.keycode);
break;
- case OSystem::EVENT_KEYUP:
+ case Common::EVENT_KEYUP:
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_vm->_quitRequested = true;
break;
default:
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index f68b38eec1..fedd21704f 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -800,7 +800,7 @@ void KyraEngine::calcCoords(Menu &menu) {
}
void KyraEngine::gui_getInput() {
- OSystem::Event event;
+ Common::Event event;
static uint32 lastScreenUpdate = 0;
uint32 now = _system->getMillis();
@@ -808,16 +808,16 @@ void KyraEngine::gui_getInput() {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mousePressFlag = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mousePressFlag = false;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
if (_flags.useHiResOverlay) {
@@ -827,13 +827,13 @@ void KyraEngine::gui_getInput() {
_system->updateScreen();
lastScreenUpdate = now;
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
_mouseWheel = -1;
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
_mouseWheel = 1;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
_keyPressed = event.kbd.ascii;
break;
default:
@@ -1471,15 +1471,15 @@ void KyraEngine::gui_updateMainMenuAnimation() {
}
bool KyraEngine::gui_mainMenuGetInput() {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
if (_flags.useHiResOverlay) {
@@ -1487,7 +1487,7 @@ bool KyraEngine::gui_mainMenuGetInput() {
_mouseY >>= 1;
}
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
return true;
default:
break;
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 887daa7d92..de953faffd 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -603,7 +603,7 @@ void KyraEngine::delayUntil(uint32 timestamp, bool updateTimers, bool update, bo
}
void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
- OSystem::Event event;
+ Common::Event event;
char saveLoadSlot[20];
char savegameName[14];
@@ -612,17 +612,17 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
- (event.kbd.flags == OSystem::KBD_CTRL || event.kbd.flags == OSystem::KBD_ALT) && isMainLoop) {
+ (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && isMainLoop) {
sprintf(saveLoadSlot, "%s.00%d", _targetName.c_str(), event.kbd.keycode - '0');
- if (event.kbd.flags == OSystem::KBD_CTRL)
+ if (event.kbd.flags == Common::KBD_CTRL)
loadGame(saveLoadSlot);
else {
sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
saveGame(saveLoadSlot, savegameName);
}
- } else if (event.kbd.flags == OSystem::KBD_CTRL) {
+ } else if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'd')
_debugger->attach();
else if (event.kbd.keycode == 'q')
@@ -635,7 +635,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
}
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
if (_flags.useHiResOverlay) {
@@ -644,13 +644,13 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
}
_animator->_updateScreen = true;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mousePressFlag = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mousePressFlag = false;
_mouseX = event.mouse.x;
@@ -705,22 +705,22 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
void KyraEngine::waitForEvent() {
bool finished = false;
- OSystem::Event event;
+ Common::Event event;
while (!finished && !_quitFlag) {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
finished = true;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
finished = true;
_skipFlag = true;
break;
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index 955ca3dd98..7503462dd2 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -1148,7 +1148,7 @@ void KyraEngine::seq_playCredits() {
_screen->copyRegion(8, 32, 8, 32, 312, 128, 4, 0, Screen::CR_NO_P_CHECK);
_screen->fadePalette(_screen->_currentPalette, 0x5A);
- OSystem::Event event;
+ Common::Event event;
bool finished = false;
int bottom = 201;
while (!finished) {
@@ -1174,10 +1174,10 @@ void KyraEngine::seq_playCredits() {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
finished = true;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
finished = true;
break;
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 4b2caa39d3..4bc9bfc629 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -40,7 +40,7 @@ void KyraEngine::waitForChatToFinish(int vocFile, int16 chatDuration, const char
bool runLoop = true;
bool drawText = textEnabled();
uint8 currPage;
- OSystem::Event event;
+ Common::Event event;
//while (towns_isEscKeyPressed() )
//towns_getKey();
@@ -121,15 +121,15 @@ void KyraEngine::waitForChatToFinish(int vocFile, int16 chatDuration, const char
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == '.')
_skipFlag = true;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitGame();
runLoop = false;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
runLoop = false;
break;
default:
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp
index ddeaa4beb1..f60a7296c8 100644
--- a/engines/kyra/vqa.cpp
+++ b/engines/kyra/vqa.cpp
@@ -661,16 +661,16 @@ void VQAMovie::play() {
if (elapsedTime >= (i * 1000) / _header.frameRate)
break;
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.ascii == 27)
return;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_vm->quitGame();
return;
default:
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)) ||
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index f60dd6a809..1d2e3f8c7d 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -430,14 +430,14 @@ void runDialogue(SpeakData *data) {
0
);
- OSystem::Event e;
+ Common::Event e;
while (e.kbd.ascii != 0xD && passwordLen < MAX_PASSWORD_LENGTH) {
// FIXME: see comment for updateInput()
if (!g_system->getEventManager()->pollEvent(e)) continue;
- if (e.type != OSystem::EVENT_KEYDOWN) continue;
- if (e.type != OSystem::EVENT_QUIT) g_system->quit();
+ if (e.type != Common::EVENT_KEYDOWN) continue;
+ if (e.type != Common::EVENT_QUIT) g_system->quit();
if (!isdigit(e.kbd.ascii)) continue;
password[passwordLen] = e.kbd.ascii;
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index fa0bc345e6..52987850da 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -283,7 +283,7 @@ void Parallaction::initGlobals() {
//
uint16 Parallaction::updateInput() {
- OSystem::Event e;
+ Common::Event e;
uint16 KeyDown = 0;
_mouseButtons = kMouseNone;
@@ -292,33 +292,33 @@ uint16 Parallaction::updateInput() {
while (eventMan->pollEvent(e)) {
switch (e.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (e.kbd.ascii == 'l') KeyDown = kEvLoadGame;
if (e.kbd.ascii == 's') KeyDown = kEvSaveGame;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseButtons = kMouseLeftDown;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mouseButtons = kMouseLeftUp;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_mouseButtons = kMouseRightDown;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_mouseButtons = kMouseRightUp;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mousePos._x = e.mouse.x;
_mousePos._y = e.mouse.y;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_system->quit();
break;
@@ -336,16 +336,16 @@ uint16 Parallaction::updateInput() {
// FIXME: see comment for updateInput()
void waitUntilLeftClick() {
- OSystem::Event e;
+ Common::Event e;
Common::EventManager *eventMan = g_system->getEventManager();
for (;;) {
eventMan->pollEvent(e);
- if (e.type == OSystem::EVENT_LBUTTONUP)
+ if (e.type == Common::EVENT_LBUTTONUP)
break;
- if (e.type == OSystem::EVENT_QUIT) {
+ if (e.type == Common::EVENT_QUIT) {
g_system->quit();
break;
}
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 578aa56e03..2d67e17385 100644
--- a/engines/queen/input.cpp
+++ b/engines/queen/input.cpp
@@ -91,13 +91,13 @@ void Input::delay(uint amount) {
}
uint32 end = _system->getMillis() + amount;
do {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
_idleTime = 0;
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
- if (event.kbd.flags == OSystem::KBD_CTRL) {
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'd') {
_debugger = true;
} else if (event.kbd.keycode == 'f') {
@@ -108,24 +108,24 @@ void Input::delay(uint amount) {
}
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouse_x = event.mouse.x;
_mouse_y = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseButton |= MOUSE_LBUTTON;
_mouse_x = event.mouse.x;
_mouse_y = event.mouse.y;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_mouseButton |= MOUSE_RBUTTON;
_mouse_x = event.mouse.x;
_mouse_y = event.mouse.y;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_system->quit();
break;
diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp
index be4b3a45a1..aaaa0cdb42 100644
--- a/engines/queen/journal.cpp
+++ b/engines/queen/journal.cpp
@@ -65,23 +65,23 @@ void Journal::use() {
_quitMode = QM_LOOP;
while (_quitMode == QM_LOOP) {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
handleKeyDown(event.kbd.ascii, event.kbd.keycode);
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
handleMouseDown(event.mouse.x, event.mouse.y);
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
handleMouseWheel(-1);
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
handleMouseWheel(1);
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_system->quit();
break;
default:
diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp
index fdac5c2fc0..bfe445ced1 100644
--- a/engines/saga/input.cpp
+++ b/engines/saga/input.cpp
@@ -38,15 +38,15 @@
namespace Saga {
int SagaEngine::processInput() {
- OSystem::Event event;
+ Common::Event event;
// Point imousePt;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
- if (event.kbd.flags == OSystem::KBD_CTRL) {
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'd')
_console->attach();
}
@@ -121,32 +121,32 @@ int SagaEngine::processInput() {
break;
}
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_leftMouseButtonPressed = false;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_rightMouseButtonPressed = false;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_leftMouseButtonPressed = true;
_mousePos = event.mouse;
_interface->update(_mousePos, UPDATE_LEFTBUTTONCLICK);
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_rightMouseButtonPressed = true;
_mousePos = event.mouse;
_interface->update(_mousePos, UPDATE_RIGHTBUTTONCLICK);
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
_interface->update(_mousePos, UPDATE_WHEELUP);
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
_interface->update(_mousePos, UPDATE_WHEELDOWN);
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mousePos = event.mouse;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
shutDown();
break;
default:
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 48b3738209..4b317098f4 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -55,16 +55,16 @@ enum MouseButtonStatus {
};
void ScummEngine::parseEvents() {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode >= '0' && event.kbd.keycode <= '9'
- && (event.kbd.flags == OSystem::KBD_ALT ||
- event.kbd.flags == OSystem::KBD_CTRL)) {
+ && (event.kbd.flags == Common::KBD_ALT ||
+ event.kbd.flags == Common::KBD_CTRL)) {
_saveLoadSlot = event.kbd.keycode - '0';
// don't overwrite autosave (slot 0)
@@ -72,9 +72,9 @@ void ScummEngine::parseEvents() {
_saveLoadSlot = 10;
sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot);
- _saveLoadFlag = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2;
+ _saveLoadFlag = (event.kbd.flags == Common::KBD_ALT) ? 1 : 2;
_saveTemporaryState = false;
- } else if (event.kbd.flags == OSystem::KBD_CTRL) {
+ } else if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'f')
_fastMode ^= 1;
else if (event.kbd.keycode == 'g')
@@ -85,7 +85,7 @@ void ScummEngine::parseEvents() {
_res->resourceStats();
else
_keyPressed = event.kbd.ascii; // Normal key press, pass on to the game.
- } else if (event.kbd.flags & OSystem::KBD_ALT) {
+ } else if (event.kbd.flags & Common::KBD_ALT) {
// The result must be 273 for Alt-W
// because that's what MI2 looks for in
// its "instant win" cheat.
@@ -126,10 +126,10 @@ void ScummEngine::parseEvents() {
if (event.kbd.ascii == 274) // Down
_keyState |= 8;
- if (event.kbd.flags == OSystem::KBD_SHIFT)
+ if (event.kbd.flags == Common::KBD_SHIFT)
_keyState |= 16;
- if (event.kbd.flags == OSystem::KBD_CTRL)
+ if (event.kbd.flags == Common::KBD_CTRL)
_keyState |= 32;
VAR(VAR_KEY_STATE) = _keyState;
@@ -141,8 +141,8 @@ void ScummEngine::parseEvents() {
_keyDownMap[_keyPressed] = true;
break;
- case OSystem::EVENT_KEYUP:
- // FIXME: for some reason OSystem::KBD_ALT is set sometimes
+ case Common::EVENT_KEYUP:
+ // FIXME: for some reason Common::KBD_ALT is set sometimes
// possible to a bug in sdl-common.cpp
if (event.kbd.ascii >= 512)
debugC(DEBUG_GENERAL, "keyPressed > 512 (%d)", event.kbd.ascii);
@@ -153,12 +153,12 @@ void ScummEngine::parseEvents() {
// We update the mouse position whenever the mouse moves or a click occurs.
// The latter is done to accomodate systems with a touchpad / pen controller.
- case OSystem::EVENT_LBUTTONDOWN:
- case OSystem::EVENT_RBUTTONDOWN:
- case OSystem::EVENT_MOUSEMOVE:
- if (event.type == OSystem::EVENT_LBUTTONDOWN)
+ case Common::EVENT_LBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
+ case Common::EVENT_MOUSEMOVE:
+ if (event.type == Common::EVENT_LBUTTONDOWN)
_leftBtnPressed |= msClicked|msDown;
- else if (event.type == OSystem::EVENT_RBUTTONDOWN)
+ else if (event.type == Common::EVENT_RBUTTONDOWN)
_rightBtnPressed |= msClicked|msDown;
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
@@ -169,11 +169,11 @@ void ScummEngine::parseEvents() {
_mouse.y = _mouse.y * 4 / 7;
}
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_leftBtnPressed &= ~msDown;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_rightBtnPressed &= ~msDown;
break;
@@ -182,15 +182,15 @@ void ScummEngine::parseEvents() {
// as nothing else uses the wheel don't bother
// checking the gameid. Values are taken from script-14.
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
_keyPressed = 55;
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
_keyPressed = 54;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
if (ConfMan.getBool("confirm_exit"))
confirmExitDialog();
else
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 74ebd47d26..2fc0eda925 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -849,12 +849,12 @@ int ScummEngine_vCUPhe::go() {
}
void ScummEngine_vCUPhe::parseEvents() {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_quit = true;
break;
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index 09e7b5a805..3d34ed9e36 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -1547,7 +1547,7 @@ void Control::restartGame(void) {
void Control::delay(unsigned int amount) {
- OSystem::Event event;
+ Common::Event event;
uint32 start = _system->getMillis();
uint32 cur = start;
@@ -1557,32 +1557,32 @@ void Control::delay(unsigned int amount) {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
// Make sure backspace works right (this fixes a small issue on OS X)
if (event.kbd.keycode == 8)
_keyPressed = 8;
else
_keyPressed = (byte)event.kbd.ascii;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
if (!(SkyEngine::_systemVars.systemFlags & SF_MOUSE_LOCKED))
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseClicked = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mouseClicked = false;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
_mouseWheel = -1;
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
_mouseWheel = 1;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
SkyEngine::_systemVars.quitGame = true;
break;
default:
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
index 9528be1905..14613d0ff5 100644
--- a/engines/sky/intro.cpp
+++ b/engines/sky/intro.cpp
@@ -900,7 +900,7 @@ void Intro::restoreScreen(void) {
bool Intro::escDelay(uint32 msecs) {
Common::EventManager *eventMan = _system->getEventManager();
- OSystem::Event event;
+ Common::Event event;
if (_relDelay == 0) // first call, init with system time
_relDelay = (int32)_system->getMillis();
@@ -909,10 +909,10 @@ bool Intro::escDelay(uint32 msecs) {
int32 nDelay = 0;
do {
while (eventMan->pollEvent(event)) {
- if (event.type == OSystem::EVENT_KEYDOWN) {
+ if (event.type == Common::EVENT_KEYDOWN) {
if (event.kbd.keycode == 27)
return false;
- } else if (event.type == OSystem::EVENT_QUIT) {
+ } else if (event.type == Common::EVENT_QUIT) {
_quitProg = true;
return false;
}
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index 5a2006b8c9..bb31c6b542 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -172,7 +172,7 @@ void Mouse::waitMouseNotPressed(int minDelay) {
bool mousePressed = true;
uint32 now = _system->getMillis();
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (mousePressed || _system->getMillis() < now + minDelay) {
@@ -187,7 +187,7 @@ void Mouse::waitMouseNotPressed(int minDelay) {
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.ascii == 27) {
minDelay = 0;
mousePressed = false;
diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp
index c3495ee067..071dab2585 100644
--- a/engines/sky/screen.cpp
+++ b/engines/sky/screen.cpp
@@ -394,7 +394,7 @@ void Screen::waitForTimer(void) {
Common::EventManager *eventMan = _system->getEventManager();
_gotTick = false;
while (!_gotTick) {
- OSystem::Event event;
+ Common::Event event;
_system->delayMillis(10);
while (eventMan->pollEvent(event));
@@ -404,7 +404,7 @@ void Screen::waitForTimer(void) {
void Screen::waitForSequence(void) {
Common::EventManager *eventMan = _system->getEventManager();
while (_seqInfo.running) {
- OSystem::Event event;
+ Common::Event event;
_system->delayMillis(20);
while (eventMan->pollEvent(event));
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 8b12043f76..7cf1566f35 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -222,7 +222,7 @@ void SkyEngine::handleKey(void) {
return;
}
- if (_keyFlags == OSystem::KBD_CTRL) {
+ if (_keyFlags == Common::KBD_CTRL) {
if (_keyPressed == 'f')
_fastMode ^= 1;
else if (_keyPressed == 'g')
@@ -512,7 +512,7 @@ void SkyEngine::gotTimerTick(void) {
void SkyEngine::delay(int32 amount) {
Common::EventManager *eventMan = _system->getEventManager();
- OSystem::Event event;
+ Common::Event event;
uint32 start = _system->getMillis();
_keyFlags = _keyPressed = 0; //reset
@@ -523,28 +523,28 @@ void SkyEngine::delay(int32 amount) {
do {
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
_keyFlags = event.kbd.flags;
- if (_keyFlags == OSystem::KBD_CTRL)
+ if (_keyFlags == Common::KBD_CTRL)
_keyPressed = event.kbd.keycode;
else
_keyPressed = (byte)event.kbd.ascii;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED))
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED))
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
_skyMouse->buttonPressed(2);
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED))
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
_skyMouse->buttonPressed(1);
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_systemVars.quitGame = true;
break;
default:
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index f8ed59a7a6..e816651e48 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -200,19 +200,19 @@ void MoviePlayer::play(void) {
syncFrame();
updateScreen();
_currentFrame++;
- OSystem::Event event;
+ Common::Event event;
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_SCREEN_CHANGED:
+ case Common::EVENT_SCREEN_CHANGED:
handleScreenChanged();
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == 27) {
_snd->stopHandle(_bgSoundHandle);
terminated = true;
}
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_sys->quit();
break;
default:
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index ec612ce1fc..aeb9da700b 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -1028,7 +1028,7 @@ void Control::doRestore(void) {
}
void Control::delay(uint32 msecs) {
- OSystem::Event event;
+ Common::Event event;
uint32 now = _system->getMillis();
uint32 endTime = now + msecs;
@@ -1039,7 +1039,7 @@ void Control::delay(uint32 msecs) {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
// Make sure backspace works right (this fixes a small issue on OS X)
if (event.kbd.keycode == 8)
@@ -1049,11 +1049,11 @@ void Control::delay(uint32 msecs) {
// we skip the rest of the delay and return immediately
// to handle keyboard input
return;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseDown = true;
_mouseState |= BS1L_BUTTON_DOWN;
#if defined(_WIN32_WCE) || defined(PALMOS_MODE)
@@ -1061,19 +1061,19 @@ void Control::delay(uint32 msecs) {
_mouseY = event.mouse.y;
#endif
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mouseDown = false;
_mouseState |= BS1L_BUTTON_UP;
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
_mouseDown = false;
_mouseState |= BS1_WHEEL_UP;
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
_mouseDown = false;
_mouseState |= BS1_WHEEL_DOWN;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
SwordEngine::_systemVars.engineQuit = true;
break;
default:
diff --git a/engines/sword1/credits.cpp b/engines/sword1/credits.cpp
index 06539f986f..aa520367d7 100644
--- a/engines/sword1/credits.cpp
+++ b/engines/sword1/credits.cpp
@@ -272,13 +272,13 @@ uint8 CreditsPlayer::getPalIdx(uint8 r, uint8 g, uint8 b) {
void CreditsPlayer::delay(int msecs) {
- OSystem::Event event;
+ Common::Event event;
uint32 start = _system->getMillis();
do {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
SwordEngine::_systemVars.engineQuit = true;
break;
default:
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index d9c689a769..7a783c63b3 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -702,45 +702,45 @@ uint8 SwordEngine::mainLoop(void) {
void SwordEngine::delay(int32 amount) { //copied and mutilated from sky.cpp
- OSystem::Event event;
+ Common::Event event;
uint32 start = _system->getMillis();
do {
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
// Make sure backspace works right (this fixes a small issue on OS X)
if (event.kbd.keycode == 8)
_keyPressed = 8;
else
_keyPressed = (uint8)event.kbd.ascii;
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_mouseState |= BS1L_BUTTON_DOWN;
#if defined(_WIN32_WCE) || defined(PALMOS_MODE)
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
#endif
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_mouseState |= BS1R_BUTTON_DOWN;
#if defined(_WIN32_WCE) || defined(PALMOS_MODE)
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
#endif
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_mouseState |= BS1L_BUTTON_UP;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_mouseState |= BS1R_BUTTON_UP;
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_systemVars.engineQuit = true;
break;
default:
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index b56d122509..3afd8b8748 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -407,19 +407,19 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn
drawFrame();
updateScreen();
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_SCREEN_CHANGED:
+ case Common::EVENT_SCREEN_CHANGED:
handleScreenChanged();
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_vm->closeGame();
terminate = true;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == 27)
terminate = true;
break;
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 3e313fcdcc..e399307f72 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -375,9 +375,9 @@ int Sword2Engine::go() {
KeyboardEvent *ke = keyboardEvent();
if (ke) {
- if ((ke->modifiers == OSystem::KBD_CTRL && ke->keycode == 'd') || ke->ascii == '#' || ke->ascii == '~') {
+ if ((ke->modifiers == Common::KBD_CTRL && ke->keycode == 'd') || ke->ascii == '#' || ke->ascii == '~') {
_debugger->attach();
- } else if (ke->modifiers == 0 || ke->modifiers == OSystem::KBD_SHIFT) {
+ } else if (ke->modifiers == 0 || ke->modifiers == Common::KBD_SHIFT) {
switch (ke->keycode) {
case 'p':
if (_gamePaused)
@@ -532,13 +532,13 @@ uint32 Sword2Engine::setInputEventFilter(uint32 filter) {
*/
void Sword2Engine::parseInputEvents() {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_KEYDOWN:
- if (event.kbd.flags == OSystem::KBD_CTRL) {
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'f') {
if (_gameSpeed == 1)
_gameSpeed = 2;
@@ -553,48 +553,48 @@ void Sword2Engine::parseInputEvents() {
_keyboardEvent.modifiers = event.kbd.flags;
}
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
if (!(_inputEventFilter & RD_KEYDOWN)) {
_mouse->setPos(event.mouse.x, event.mouse.y - MENUDEEP);
}
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
if (!(_inputEventFilter & RD_LEFTBUTTONDOWN)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_LEFTBUTTONDOWN;
}
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
if (!(_inputEventFilter & RD_RIGHTBUTTONDOWN)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_RIGHTBUTTONDOWN;
}
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
if (!(_inputEventFilter & RD_LEFTBUTTONUP)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_LEFTBUTTONUP;
}
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
if (!(_inputEventFilter & RD_RIGHTBUTTONUP)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_RIGHTBUTTONUP;
}
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
if (!(_inputEventFilter & RD_WHEELUP)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_WHEELUP;
}
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
if (!(_inputEventFilter & RD_WHEELDOWN)) {
_mouseEvent.pending = true;
_mouseEvent.buttons = RD_WHEELDOWN;
}
break;
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
closeGame();
break;
default:
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index 650fc8f9f2..e248579814 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -275,14 +275,14 @@ void ToucheEngine::mainLoop() {
}
void ToucheEngine::processEvents(bool handleKeyEvents) {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
_flagsTable[611] = 1;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (!handleKeyEvents) {
break;
}
@@ -300,7 +300,7 @@ void ToucheEngine::processEvents(bool handleKeyEvents) {
} else if (event.kbd.keycode == 291) { // F10
_fastWalkMode = false;
}
- if (event.kbd.flags == OSystem::KBD_CTRL) {
+ if (event.kbd.flags == Common::KBD_CTRL) {
if (event.kbd.keycode == 'd') {
// enable debugging stuff ?
_flagsTable[777] = 1;
@@ -319,25 +319,25 @@ void ToucheEngine::processEvents(bool handleKeyEvents) {
}
}
break;
- case OSystem::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
_inp_mousePos.x = event.mouse.x;
_inp_mousePos.y = event.mouse.y;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
_inp_mousePos.x = event.mouse.x;
_inp_mousePos.y = event.mouse.y;
_inp_leftMouseButtonPressed = true;
break;
- case OSystem::EVENT_LBUTTONUP:
+ case Common::EVENT_LBUTTONUP:
_inp_mousePos.x = event.mouse.x;
_inp_mousePos.y = event.mouse.y;
break;
- case OSystem::EVENT_RBUTTONDOWN:
+ case Common::EVENT_RBUTTONDOWN:
_inp_mousePos.x = event.mouse.x;
_inp_mousePos.y = event.mouse.y;
_inp_rightMouseButtonPressed = true;
break;
- case OSystem::EVENT_RBUTTONUP:
+ case Common::EVENT_RBUTTONUP:
_inp_mousePos.x = event.mouse.x;
_inp_mousePos.y = event.mouse.y;
_inp_rightMouseButtonPressed = false;
diff --git a/engines/touche/ui.cpp b/engines/touche/ui.cpp
index 2113640b4b..a679b83ac7 100644
--- a/engines/touche/ui.cpp
+++ b/engines/touche/ui.cpp
@@ -377,23 +377,23 @@ void ToucheEngine::handleOptions(int forceDisplay) {
}
}
redrawMenu(&menuData);
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
const Button *button = 0;
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
menuData.quit = true;
menuData.exit = true;
_flagsTable[611] = 1;
break;
- case OSystem::EVENT_LBUTTONDOWN:
+ case Common::EVENT_LBUTTONDOWN:
button = menuData.findButtonUnderCursor(event.mouse.x, event.mouse.y);
if (button) {
handleMenuAction(&menuData, button->action);
}
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
if (menuData.mode == kMenuSaveStateMode) {
if (event.kbd.keycode == 8) {
menuData.removeLastCharFromDescription(_saveLoadCurrentSlot);
@@ -402,10 +402,10 @@ void ToucheEngine::handleOptions(int forceDisplay) {
}
}
break;
- case OSystem::EVENT_WHEELUP:
+ case Common::EVENT_WHEELUP:
handleMenuAction(&menuData, kActionScrollUpSaves);
break;
- case OSystem::EVENT_WHEELDOWN:
+ case Common::EVENT_WHEELDOWN:
handleMenuAction(&menuData, kActionScrollDownSaves);
break;
default:
@@ -536,15 +536,15 @@ int ToucheEngine::displayQuitDialog() {
int ret = 0;
bool quitLoop = false;
while (!quitLoop) {
- OSystem::Event event;
+ Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
while (eventMan->pollEvent(event)) {
switch (event.type) {
- case OSystem::EVENT_QUIT:
+ case Common::EVENT_QUIT:
quitLoop = true;
ret = 1;
break;
- case OSystem::EVENT_KEYDOWN:
+ case Common::EVENT_KEYDOWN:
quitLoop = true;
switch (_language) {
case Common::FR_FRA: