[Scummvm-cvs-logs] CVS: scummvm/gui newgui.h,1.42,1.43

Max Horn fingolfin at users.sourceforge.net
Mon Mar 29 14:42:00 CEST 2004


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8016/gui

Modified Files:
	newgui.h 
Log Message:
Make use of Stack template

Index: newgui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- newgui.h	22 Mar 2004 22:01:10 -0000	1.42
+++ newgui.h	29 Mar 2004 22:29:30 -0000	1.43
@@ -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::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.





More information about the Scummvm-git-logs mailing list