diff options
Diffstat (limited to 'newgui.h')
-rw-r--r-- | newgui.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -22,6 +22,8 @@ #define NEWGUI_H #include "scummsys.h" +#include "system.h" // For events +#include "scumm.h" // For events class Dialog; class Scumm; @@ -43,6 +45,27 @@ public: void pop() { if (_size > 0) _stack[--_size] = 0; } }; + +class EventList { +protected: + OSystem::Event _stack[100]; + int _size; +public: + EventList() : _size(0) {} + + void addEvent(const OSystem::Event &d) { + if (_size<(100-1)) + _stack[_size++] = d; + else + error("EventList overflow."); + } + + const OSystem::Event &getEvent(int i) const { return _stack[i]; } + int size() const { return _size; } + void clear() { _size = 0; } +}; + + // This class hopefully will replace the old Gui class completly one day class NewGui { friend class Dialog; @@ -64,6 +87,8 @@ public: NewGui(Scumm *s); + void handleEvent(const OSystem::Event &event) { _eventList.addEvent(event); } + protected: Scumm *_s; bool _use_alpha_blending; @@ -88,6 +113,9 @@ protected: struct { int16 x,y; } _old_mouse; + + // List of events to be handled + EventList _eventList; void saveState(); void restoreState(); |