diff options
author | Max Horn | 2007-03-17 19:02:05 +0000 |
---|---|---|
committer | Max Horn | 2007-03-17 19:02:05 +0000 |
commit | ed54ea9155961d8ca5d5fb3c7777fc57a29f2751 (patch) | |
tree | 467b926af11cd4129ba003d04ba01de044c7a6df /backends/platform/ds/arm9/source | |
parent | f272d1957084098c5b53975ad3501074f6971af8 (diff) | |
download | scummvm-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 'backends/platform/ds/arm9/source')
-rw-r--r-- | backends/platform/ds/arm9/source/dsmain.cpp | 54 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/dsoptions.cpp | 12 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 12 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.h | 6 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/touchkeyboard.cpp | 6 |
5 files changed, 45 insertions, 45 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index e73c18badf..24063d81ce 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -851,9 +851,9 @@ void memoryReport() { void addIndyFightingKeys() { OSystem_DS* system = OSystem_DS::instance(); - OSystem::Event event; + Common::Event event; - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.flags = 0; if ((getKeysDown() & KEY_L)) { @@ -995,7 +995,7 @@ void addEventsToQueue() { consolePrintf("addEventsToQueue\n"); #endif OSystem_DS* system = OSystem_DS::instance(); - OSystem::Event event; + Common::Event event; @@ -1028,7 +1028,7 @@ void addEventsToQueue() { if ((getKeysDown() & KEY_B) && (!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) { // consolePrintf("Pressing Esc"); - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = 27; event.kbd.ascii = 27; event.kbd.flags = 0; @@ -1065,13 +1065,13 @@ void addEventsToQueue() { } else { // If we're playing sam and max, click and release the right mouse // button to change verb - OSystem::Event event; + Common::Event event; - event.type = OSystem::EVENT_RBUTTONDOWN; + event.type = Common::EVENT_RBUTTONDOWN; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); - event.type = OSystem::EVENT_RBUTTONUP; + event.type = Common::EVENT_RBUTTONUP; system->addEvent(event); } } @@ -1099,10 +1099,10 @@ void addEventsToQueue() { updateStatus(); - OSystem::Event event; + Common::Event event; if ((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) { - event.type = OSystem::EVENT_MOUSEMOVE; + event.type = Common::EVENT_MOUSEMOVE; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); //consolePrintf("x=%d y=%d \n", getPenX(), getPenY()); @@ -1111,13 +1111,13 @@ void addEventsToQueue() { if (!keyboardEnable) { if ((mouseMode != MOUSE_HOVER) || (!displayModeIs8Bit)) { if (getPenDown() && (!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) { - event.type = ((mouseMode == MOUSE_LEFT) || (!displayModeIs8Bit))? OSystem::EVENT_LBUTTONDOWN: OSystem::EVENT_RBUTTONDOWN; + event.type = ((mouseMode == MOUSE_LEFT) || (!displayModeIs8Bit))? Common::EVENT_LBUTTONDOWN: OSystem::EVENT_RBUTTONDOWN; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); } if (getPenReleased()) { - event.type = mouseMode == MOUSE_LEFT? OSystem::EVENT_LBUTTONUP: OSystem::EVENT_RBUTTONUP; + event.type = mouseMode == MOUSE_LEFT? Common::EVENT_LBUTTONUP: OSystem::EVENT_RBUTTONUP; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); } @@ -1126,23 +1126,23 @@ void addEventsToQueue() { if (getPenHeld()) { if (getKeysDown() & KEY_LEFT) { - event.type = OSystem::EVENT_LBUTTONDOWN; + event.type = Common::EVENT_LBUTTONDOWN; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); } /* if (getKeysReleased() & KEY_LEFT) { - event.type = OSystem::EVENT_LBUTTONUP; + event.type = Common::EVENT_LBUTTONUP; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); }*/ if (getKeysDown() & KEY_RIGHT) { - event.type = OSystem::EVENT_RBUTTONDOWN; + event.type = Common::EVENT_RBUTTONDOWN; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); } /*if (getKeysReleased() & KEY_RIGHT) { - event.type = OSystem::EVENT_RBUTTONUP; + event.type = Common::EVENT_RBUTTONUP; event.mouse = Common::Point(getPenX(), getPenY()); system->addEvent(event); }*/ @@ -1164,9 +1164,9 @@ void addEventsToQueue() { if (currentGame->control == CONT_SIMON) { // Extra controls for Simon the Sorcerer if ((getKeysDown() & KEY_DOWN)) { - OSystem::Event event; + Common::Event event; - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = '#'; // F10 or # - show hotspots event.kbd.ascii = '#'; event.kbd.flags = 0; @@ -1178,9 +1178,9 @@ void addEventsToQueue() { if (currentGame->control == CONT_SCUMM_ORIGINAL) { // Extra controls for Scumm v1-5 games if ((getKeysDown() & KEY_DOWN)) { - OSystem::Event event; + Common::Event event; - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = '.'; // Full stop - skips current dialogue line event.kbd.ascii = '.'; event.kbd.flags = 0; @@ -1200,35 +1200,35 @@ void addEventsToQueue() { // Front end controls if (leftHandedSwap(getKeysDown()) & KEY_UP) { - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = SDLK_UP; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; system->addEvent(event); } if (leftHandedSwap(getKeysDown()) & KEY_DOWN) { - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = SDLK_DOWN; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; system->addEvent(event); } if (leftHandedSwap(getKeysDown()) & KEY_A) { - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = SDLK_RETURN; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; system->addEvent(event); } @@ -1236,13 +1236,13 @@ void addEventsToQueue() { if ((getKeysDown() & KEY_START)) { - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = 319; // F5 event.kbd.ascii = 319; event.kbd.flags = 0; system->addEvent(event); /* - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; event.kbd.keycode = 319; // F5 event.kbd.ascii = 319; system->addEvent(event);*/ diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index 272685a462..b05f50783e 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -154,13 +154,13 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint _delDialog->setList(Scumm::generateSavegameList(Scumm::g_scumm, false)); _delDialog->handleCommand(NULL, GUI::kListSelectionChangedCmd, 0); - OSystem::Event event; - event.type = OSystem::EVENT_KEYDOWN; + Common::Event event; + event.type = Common::EVENT_KEYDOWN; event.kbd.ascii = SDLK_DOWN; event.kbd.keycode = SDLK_DOWN; OSystem_DS::instance()->addEvent(event); - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; OSystem_DS::instance()->addEvent(event); int idx = _delDialog->runModal(); @@ -182,8 +182,8 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint void showOptionsDialog() { OSystem_DS* system = OSystem_DS::instance(); - OSystem::Event event; - event.type = OSystem::EVENT_KEYDOWN; + Common::Event event; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = 'P'; // F5 event.kbd.ascii = 'P'; event.kbd.flags = 0; @@ -199,7 +199,7 @@ void showOptionsDialog() { DS::displayMode8Bit(); - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = 'P'; // F5 event.kbd.ascii = 'P'; event.kbd.flags = 0; diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 70299ae5b2..dff6acad96 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -302,11 +302,11 @@ void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, i DS::setCursorIcon(buf, w, h, keycolor); } -void OSystem_DS::addEvent(Event& e) { +void OSystem_DS::addEvent(Common::Event& e) { eventQueue[queuePos++] = e; } -bool OSystem_DS::pollEvent(Event &event) +bool OSystem_DS::pollEvent(Common::Event &event) { if (lastPenFrame != DS::getMillis()) { @@ -316,7 +316,7 @@ bool OSystem_DS::pollEvent(Event &event) queuePos = 0; // Bodge - this last event seems to be processed sometimes and not others. // So we make it something harmless which won't cause any adverse effects. - event.type = EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; event.kbd.ascii = 0; event.kbd.keycode = 0; event.kbd.flags = 0; @@ -331,7 +331,7 @@ bool OSystem_DS::pollEvent(Event &event) /* if (lastPenFrame != DS::getMillis()) { if ((eventNum == 0)) { - event.type = EVENT_MOUSEMOVE; + event.type = Common::EVENT_MOUSEMOVE; event.mouse = Common::Point(DS::getPenX(), DS::getPenY()); eventNum = 1; return true; @@ -340,12 +340,12 @@ bool OSystem_DS::pollEvent(Event &event) eventNum = 0; lastPenFrame = DS::getMillis(); if (DS::getPenDown()) { - event.type = EVENT_LBUTTONDOWN; + event.type = Common::EVENT_LBUTTONDOWN; event.mouse = Common::Point(DS::getPenX(), DS::getPenY()); consolePrintf("Down %d, %d ", event.mouse.x, event.mouse.y); return true; } else if (DS::getPenReleased()) { - event.type = EVENT_LBUTTONUP; + event.type = Common::EVENT_LBUTTONUP; event.mouse = Common::Point(DS::getPenX(), DS::getPenY()); consolePrintf("Up %d, %d ", event.mouse.x, event.mouse.y); return true; diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index dfff30bf4a..3f4e56e000 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -42,7 +42,7 @@ public: int eventNum; int lastPenFrame; - Event eventQueue[64]; + Common::Event eventQueue[64]; int queuePos; DSSaveFileManager saveManager; @@ -94,7 +94,7 @@ public: virtual void warpMouse(int x, int y); virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetCursorScale = 1); - virtual bool pollEvent(Event &event); + virtual bool pollEvent(Common::Event &event); virtual uint32 getMillis(); virtual void delayMillis(uint msecs); @@ -121,7 +121,7 @@ public: virtual Common::SaveFileManager *getSavefileManager(); - void addEvent(Event& e); + void addEvent(Common::Event& e); bool isEventQueueEmpty() { return queuePos == 0; } virtual bool grabRawScreen(Graphics::Surface* surf); diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp index 3e33786e3e..82271b0d82 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.cpp +++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp @@ -232,7 +232,7 @@ void addKeyboardEvents() { if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) && (ty >= keys[r].y) && (ty <= keys[r].y + 1)) { OSystem_DS* system = OSystem_DS::instance(); - OSystem::Event event; + Common::Event event; // consolePrintf("Key: %d\n", r); if ((keys[r].character == SDLK_UNKNOWN)) { @@ -260,11 +260,11 @@ void addKeyboardEvents() { //event.kbd.keycode = keys[r].character; //event.kbd.ascii = keys[r].character; - event.type = OSystem::EVENT_KEYDOWN; + event.type = Common::EVENT_KEYDOWN; event.kbd.flags = 0; system->addEvent(event); - event.type = OSystem::EVENT_KEYUP; + event.type = Common::EVENT_KEYUP; system->addEvent(event); switch (keys[r].character) { |