diff options
Diffstat (limited to 'engines/gargoyle/events.cpp')
-rw-r--r-- | engines/gargoyle/events.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp index 23a8baf813..ef4c59df30 100644 --- a/engines/gargoyle/events.cpp +++ b/engines/gargoyle/events.cpp @@ -23,10 +23,28 @@ #include "gargoyle/events.h" #include "gargoyle/clipboard.h" #include "gargoyle/gargoyle.h" +#include "gargoyle/screen.h" #include "gargoyle/windows.h" namespace Gargoyle { +Events::Events() : _forceClick(false), _currentEvent(nullptr), _timeouts(false), + _priorFrameTime(0), _frameCounter(0) { +} + +bool Events::checkForNextFrameCounter() { + // Check for next game frame + uint32 milli = g_system->getMillis(); + if ((milli - _priorFrameTime) >= GAME_FRAME_TIME) { + ++_frameCounter; + _priorFrameTime = milli; + + return true; + } + + return false; +} + void Events::getEvent(event_t *event, bool polled) { _currentEvent = event; event->clear(); @@ -89,6 +107,11 @@ void Events::dispatchEvent(Event &ev, bool polled) { void Events::pollEvents() { Common::Event event; + if (checkForNextFrameCounter()) { + // Update the screen + g_vm->_screen->update(); + } + do { g_system->getEventManager()->pollEvent(event); |