aboutsummaryrefslogtreecommitdiff
path: root/backends/events
diff options
context:
space:
mode:
authorChristopher Page2008-07-09 02:27:05 +0000
committerChristopher Page2008-07-09 02:27:05 +0000
commite808cdf7a08d641389ecc81063b3b1016c7bc8cf (patch)
treedd21fa0f4b624d426675820b318aa3e41707c3ca /backends/events
parentb8fe71e7a12e60f0c19fa86da83f270dc09e14fd (diff)
downloadscummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.gz
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.bz2
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.zip
Reimplemented pushEvent() and artificialEventQueue to work with Events instead of EventTypes. Reimplemented Queue as a List instead of Array. Updated AGOS, AGI, CINE, GOB, and KYRA to work with the current implementation of the GMM
svn-id: r32971
Diffstat (limited to 'backends/events')
-rw-r--r--backends/events/default/default-events.cpp13
-rw-r--r--backends/events/default/default-events.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index 71e19329bf..c56ceb0204 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -354,7 +354,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
bool result;
if (!artificialEventQueue.empty()) {
- event.type = artificialEventQueue.pop();
+ event = artificialEventQueue.pop();
result = true;
} else
result = _boss->pollEvent(event);
@@ -393,8 +393,11 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
#endif
// Global Main Menu
if (event.kbd.keycode == Common::KEYCODE_F11)
- if (g_engine && !g_engine->isPaused())
- pushEvent(Common::EVENT_MAINMENU);
+ if (g_engine && !g_engine->isPaused()) {
+ Common::Event menuEvent;
+ menuEvent.type = Common::EVENT_MAINMENU;
+ pushEvent(menuEvent);
+ }
break;
case Common::EVENT_KEYUP:
@@ -472,8 +475,8 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
return result;
}
-void DefaultEventManager::pushEvent(Common::EventType eventType) {
- artificialEventQueue.push(eventType);
+void DefaultEventManager::pushEvent(Common::Event event) {
+ artificialEventQueue.push(event);
}
#endif // !defined(DISABLE_DEFAULT_EVENTMANAGER)
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 88e3fd6afe..2195437f3e 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -108,7 +108,7 @@ public:
~DefaultEventManager();
virtual bool pollEvent(Common::Event &event);
- virtual void pushEvent(Common::EventType eventType);
+ virtual void pushEvent(Common::Event event);
virtual void registerRandomSource(Common::RandomSource &rnd, const char *name);
virtual void processMillis(uint32 &millis);