From 1bfaa3c02f0a3fb56c581fc204b644d457d45ae0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 24 Sep 2002 23:45:25 +0000 Subject: 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 --- gui/newgui.cpp | 26 ++++++++++---------------- gui/newgui.h | 7 +------ 2 files changed, 11 insertions(+), 22 deletions(-) (limited to 'gui') 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 { -- cgit v1.2.3