[Scummvm-cvs-logs] CVS: scummvm newgui.h,1.3,1.4
Max Horn
fingolfin at users.sourceforge.net
Sun Jul 7 14:59:01 CEST 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.4,1.5 widget.cpp,1.4,1.5 widget.h,1.2,1.3
- Next message: [Scummvm-cvs-logs] CVS: scummvm newgui.cpp,1.4,1.5 newgui.h,1.4,1.5 guimaps.h,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv2322
Modified Files:
newgui.h
Log Message:
got rid of std::stack again
Index: newgui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/newgui.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- newgui.h 7 Jul 2002 21:46:53 -0000 1.3
+++ newgui.h 7 Jul 2002 21:58:12 -0000 1.4
@@ -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 @@
protected:
Scumm *_s;
bool _need_redraw;
-// Dialog *_activeDialog;
DialogStack _dialogStack;
Dialog *_pauseDialog;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.4,1.5 widget.cpp,1.4,1.5 widget.h,1.2,1.3
- Next message: [Scummvm-cvs-logs] CVS: scummvm newgui.cpp,1.4,1.5 newgui.h,1.4,1.5 guimaps.h,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list