aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2002-09-24 23:45:25 +0000
committerMax Horn2002-09-24 23:45:25 +0000
commit1bfaa3c02f0a3fb56c581fc204b644d457d45ae0 (patch)
tree609f369bda19b6c5a6753dade1e87baf34854327 /gui
parent77d62a61d7d9a4256a24cc37057f515d123ecfeb (diff)
downloadscummvm-rg350-1bfaa3c02f0a3fb56c581fc204b644d457d45ae0.tar.gz
scummvm-rg350-1bfaa3c02f0a3fb56c581fc204b644d457d45ae0.tar.bz2
scummvm-rg350-1bfaa3c02f0a3fb56c581fc204b644d457d45ae0.zip
removed even the last traces of Scumm dependencies from NewGUI. Yes, you heard right NewGUI is now 100% Scumm free and we can go for the launcher/message dialogs!
svn-id: r5016
Diffstat (limited to 'gui')
-rw-r--r--gui/newgui.cpp26
-rw-r--r--gui/newgui.h7
2 files changed, 11 insertions, 22 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 1867ddd6bd..7adfa1aaea 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -20,11 +20,8 @@
#include "stdafx.h"
#include "util.h"
-#include "scumm/scumm.h"
-#include "scumm/sound.h"
#include "newgui.h"
#include "dialog.h"
-#include "scumm/dialogs.h"
#ifdef _MSC_VER
@@ -78,7 +75,7 @@ static byte guifont[] = {
};
// Constructor
-NewGui::NewGui(Scumm *s) : _s(s), _system(s->_system), _screen(0),
+NewGui::NewGui(OSystem *system) : _system(system), _screen(0),
_use_alpha_blending(true), _need_redraw(false),
_currentKeyDown(0), _cursorAnimateCounter(0), _cursorAnimateTimer(0)
{
@@ -200,29 +197,26 @@ void NewGui::runLoop()
void NewGui::saveState()
{
- // Pause sound put
- _old_soundsPaused = _s->_sound->_soundsPaused;
- _s->_sound->pauseSounds(true);
-
// Backup old cursor
_oldCursorMode = _system->show_mouse(true);
- // TODO - add getHeight & getWidth methods to OSystem
_system->show_overlay();
- _screen = new int16[_s->_realWidth * _s->_realHeight];
- _screen_pitch = _s->_realWidth;
+ // TODO - add getHeight & getWidth methods to OSystem.
+ // Note that this alone is not a sufficient solution, as in the future the screen size
+ // might change. E.g. we start up in 320x200 mode but then go on playing Zak256
+ // which makes us switch to 320x240, or even CMI which uses 640x480...
+ // FIXME - for now just use a dirty HACK
+ _screen = new int16[320 * 240];
+ _screen_pitch = 320;
+// _screen = new int16[_s->_realWidth * _s->_realHeight];
+// _screen_pitch = _s->_realWidth;
_system->grab_overlay(_screen, _screen_pitch);
}
void NewGui::restoreState()
{
- // Restore old cursor
- _s->updateCursor();
_system->show_mouse(_oldCursorMode);
- // Resume sound output
- _s->_sound->pauseSounds(_old_soundsPaused);
-
_system->hide_overlay();
if (_screen) {
delete _screen;
diff --git a/gui/newgui.h b/gui/newgui.h
index ba96a8590b..b1ce4daeea 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -25,7 +25,6 @@
#include "system.h" // For events
class Dialog;
-class Scumm;
#define hline(x, y, x2, color) line(x, y, x2, y, color);
#define vline(x, y, y2, color) line(x, y, x, y2, color);
@@ -68,10 +67,9 @@ public:
bool isActive() { return ! _dialogStack.empty(); }
- NewGui(Scumm *s);
+ NewGui(OSystem *system);
protected:
- Scumm *_s;
OSystem *_system;
int16 *_screen;
int _screen_pitch;
@@ -84,9 +82,6 @@ protected:
int _currentKeyDown, _currentKeyDownFlags;
int _keyRepeatLoopCount;
int _keyRepeatEvenCount;
-
- // sound state
- bool _old_soundsPaused;
// position and time of last mouse click (used to detect double clicks)
struct {