[Scummvm-cvs-logs] CVS: scummvm/gui newgui.cpp,1.14,1.15 newgui.h,1.9,1.10

Max Horn fingolfin at users.sourceforge.net
Tue Sep 24 16:46:04 CEST 2002


Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv28204/gui

Modified Files:
	newgui.cpp newgui.h 
Log Message:
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!

Index: newgui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- newgui.cpp	22 Sep 2002 04:03:45 -0000	1.14
+++ newgui.cpp	24 Sep 2002 23:45:25 -0000	1.15
@@ -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 @@
 };
 
 // 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,28 +197,25 @@
 
 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) {

Index: newgui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- newgui.h	22 Sep 2002 04:03:45 -0000	1.9
+++ newgui.h	24 Sep 2002 23:45:25 -0000	1.10
@@ -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 @@
 
 	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 @@
 	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 {





More information about the Scummvm-git-logs mailing list