From 1238d7422705e88097d21a3d0e34683262be4331 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 13 Jul 2002 18:32:09 +0000 Subject: took painelf's change, modified it a lot, and now here's the result :-) svn-id: r4540 --- newgui.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'newgui.h') diff --git a/newgui.h b/newgui.h index 2f0fa53b10..7bbc6bb462 100644 --- a/newgui.h +++ b/newgui.h @@ -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(); -- cgit v1.2.3