mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-27 12:16:59 +00:00
got rid of std::stack again
svn-id: r4484
This commit is contained in:
parent
2b50e2a7c0
commit
c90ade1f10
18
newgui.h
18
newgui.h
@ -21,15 +21,26 @@
|
|||||||
#ifndef NEWGUI_H
|
#ifndef NEWGUI_H
|
||||||
#define NEWGUI_H
|
#define NEWGUI_H
|
||||||
|
|
||||||
#include <stack>
|
|
||||||
|
|
||||||
#include "scummsys.h"
|
#include "scummsys.h"
|
||||||
|
|
||||||
class Scumm;
|
class Scumm;
|
||||||
class Dialog;
|
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 {
|
class NewGui {
|
||||||
friend class Dialog;
|
friend class Dialog;
|
||||||
public:
|
public:
|
||||||
@ -50,7 +61,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
Scumm *_s;
|
Scumm *_s;
|
||||||
bool _need_redraw;
|
bool _need_redraw;
|
||||||
// Dialog *_activeDialog;
|
|
||||||
DialogStack _dialogStack;
|
DialogStack _dialogStack;
|
||||||
|
|
||||||
Dialog *_pauseDialog;
|
Dialog *_pauseDialog;
|
||||||
|
Loading…
Reference in New Issue
Block a user