aboutsummaryrefslogtreecommitdiff
path: root/newgui.h
diff options
context:
space:
mode:
authorMax Horn2002-07-07 21:58:12 +0000
committerMax Horn2002-07-07 21:58:12 +0000
commitc90ade1f10d3ff0c2f7e429ec5d688b7db8637c9 (patch)
tree4eb4b2fd5518091c8c226a4399c332de6bc1d834 /newgui.h
parent2b50e2a7c0d6ed250a4b58fa0fa1bf18c458d091 (diff)
downloadscummvm-rg350-c90ade1f10d3ff0c2f7e429ec5d688b7db8637c9.tar.gz
scummvm-rg350-c90ade1f10d3ff0c2f7e429ec5d688b7db8637c9.tar.bz2
scummvm-rg350-c90ade1f10d3ff0c2f7e429ec5d688b7db8637c9.zip
got rid of std::stack again
svn-id: r4484
Diffstat (limited to 'newgui.h')
-rw-r--r--newgui.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/newgui.h b/newgui.h
index 8b52e15fcd..7145699ed9 100644
--- a/newgui.h
+++ b/newgui.h
@@ -21,15 +21,26 @@
#ifndef NEWGUI_H
#define NEWGUI_H
-#include <stack>
-
#include "scummsys.h"
class Scumm;
class Dialog;
-typedef std::stack<Dialog *> DialogStack;
+// Extremly simple stack class, doesn't even do any error checking (for now)
+class DialogStack {
+protected:
+ Dialog *_stack[10]; // Anybody nesting dialogs deeper than 4 is mad anyway
+ int _size;
+public:
+ DialogStack() : _size(0) {}
+
+ bool empty() const { return _size <= 0; }
+ void push(Dialog *d) { _stack[_size++] = d; }
+ Dialog *top() const { return _stack[_size-1]; }
+ void pop() { if (_size > 0) _stack[--_size] = 0; }
+};
+// This class hopefully will replace the old Gui class completly one day
class NewGui {
friend class Dialog;
public:
@@ -50,7 +61,6 @@ public:
protected:
Scumm *_s;
bool _need_redraw;
-// Dialog *_activeDialog;
DialogStack _dialogStack;
Dialog *_pauseDialog;