diff options
author | Max Horn | 2004-03-29 22:29:30 +0000 |
---|---|---|
committer | Max Horn | 2004-03-29 22:29:30 +0000 |
commit | 178bf539b4fa9954ae367c79ddc939acbb5422c0 (patch) | |
tree | b16ad96b3f03599801e5cd3f0be3e2cf7bc3405c | |
parent | e8adb5e62830292eb0a3111ae985d2777ef9f492 (diff) | |
download | scummvm-rg350-178bf539b4fa9954ae367c79ddc939acbb5422c0.tar.gz scummvm-rg350-178bf539b4fa9954ae367c79ddc939acbb5422c0.tar.bz2 scummvm-rg350-178bf539b4fa9954ae367c79ddc939acbb5422c0.zip |
Make use of Stack template
svn-id: r13430
-rw-r--r-- | gui/newgui.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/gui/newgui.h b/gui/newgui.h index 843f84eac1..7a08e7dbfa 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -23,6 +23,7 @@ #include "common/scummsys.h" #include "common/singleton.h" +#include "common/stack.h" #include "common/str.h" #include "common/system.h" // For events #include "graphics/font.h" @@ -53,21 +54,10 @@ using Graphics::kTextAlignLeft; using Graphics::kTextAlignRight; -// 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; } - int size() const { return _size; } - Dialog *operator [](int i) { return _stack[i]; } -}; +// Simple dialog stack class +// Anybody nesting dialogs deeper than 4 is mad anyway +typedef Common::Stack<Dialog *> DialogStack; + /** * GUI manager singleton. |