diff options
author | Christopher Page | 2008-07-07 22:34:45 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-07 22:34:45 +0000 |
commit | a4f56de13ac2a7daaf5654c75f07ad6331f375e6 (patch) | |
tree | 8a000a805fef0d628eaeb9d662daf0649a785ffe /common | |
parent | b50df858eb52520b529597d98fcd0d9b29619930 (diff) | |
download | scummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.tar.gz scummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.tar.bz2 scummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.zip |
Implemented Common::EventManager::pushEvent() to insert fake events into the event queue. Quit and RTL events have been added, and are now tracked by the DefaultEventManager using shouldQuit() and shouldRTL(). AGOS is working with this new implementation, other engines to follow.
svn-id: r32952
Diffstat (limited to 'common')
-rw-r--r-- | common/events.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/common/events.h b/common/events.h index bfda389bbe..10ddb7cc62 100644 --- a/common/events.h +++ b/common/events.h @@ -27,6 +27,7 @@ #define COMMON_EVENTS_H #include "common/keyboard.h" +#include "common/queue.h" #include "common/rect.h" #include "common/system.h" #include "common/noncopyable.h" @@ -59,6 +60,7 @@ enum EventType { EVENT_MBUTTONUP = 14, EVENT_MAINMENU = 15, + EVENT_RTL = 16, EVENT_QUIT = 10, EVENT_SCREEN_CHANGED = 11, @@ -144,6 +146,11 @@ public: */ virtual bool pollEvent(Common::Event &event) = 0; + /** + * Pushes a "fake" event of the specified type into the event queue + */ + virtual void pushEvent(Common::EventType eventType) = 0; + /** Register random source so it can be serialized in game test purposes **/ virtual void registerRandomSource(Common::RandomSource &rnd, const char *name) = 0; @@ -173,18 +180,14 @@ public: */ virtual int shouldRTL() const = 0; - /** - * Sets the quit variable to true - */ - virtual void setQuit() = 0; - /** - * Set the RTL flag, we should return to the launcher + * We have returned to the launcher, and _shouldQuit should be reset to false */ - virtual void setRTL() = 0; + + virtual void resetQuit() = 0; /** - * We have returned to the launcher, and the RTL should be reset to false + * We have returned to the launcher, and the _shouldRTL should be reset to false */ virtual void resetRTL() = 0; @@ -195,6 +198,9 @@ public: // TODO: Consider removing OSystem::getScreenChangeID and // replacing it by a generic getScreenChangeID method here +protected: + + Common::Queue<Common::EventType> artificialEventQueue; }; } // End of namespace Common |