diff options
author | Max Horn | 2002-07-13 18:32:09 +0000 |
---|---|---|
committer | Max Horn | 2002-07-13 18:32:09 +0000 |
commit | 1238d7422705e88097d21a3d0e34683262be4331 (patch) | |
tree | 1c91aec348222a0955b638e9308ab7a85f5965ec /newgui.h | |
parent | 101613f6fd6226bd0d205efe395de4e2b1009731 (diff) | |
download | scummvm-rg350-1238d7422705e88097d21a3d0e34683262be4331.tar.gz scummvm-rg350-1238d7422705e88097d21a3d0e34683262be4331.tar.bz2 scummvm-rg350-1238d7422705e88097d21a3d0e34683262be4331.zip |
took painelf's change, modified it a lot, and now here's the result :-)
svn-id: r4540
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(); |