[Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.68,1.69 controls.cpp,1.85,1.86 controls.h,1.17,1.18 defs.h,1.14,1.15 function.cpp,1.77,1.78 mouse.cpp,1.66,1.67 mouse.h,1.16,1.17 save_rest.cpp,1.66,1.67 speech.cpp,1.71,1.72 sword2.cpp,1.134,1.135 sword2.h,1.76,1.77

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Feb 20 07:39:21 CET 2005


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

Modified Files:
	anims.cpp controls.cpp controls.h defs.h function.cpp 
	mouse.cpp mouse.h save_rest.cpp speech.cpp sword2.cpp sword2.h 
Log Message:
More BS2 restructuring.

The various game settings are no longer stored in the Gui class. They are
stored in the class that use them.

Code that doesn't belong in the Gui class, e.g. the "restart" code, has
been moved out of it.

Afterwards, the Gui class had been reduced to nothing more than a handful
of trivial methods for invoking the in-game dialogs. So the entire Gui
class has been removed.


Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/anims.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- anims.cpp	19 Feb 2005 14:02:09 -0000	1.68
+++ anims.cpp	20 Feb 2005 15:38:47 -0000	1.69
@@ -30,7 +30,6 @@
 #include "sword2/sword2.h"
 #include "sword2/defs.h"
 #include "sword2/build_display.h"
-#include "sword2/controls.h"
 #include "sword2/interpreter.h"
 #include "sword2/logic.h"
 #include "sword2/maketext.h"
@@ -246,7 +245,7 @@
 
 		// if we want subtitles, or speech failed to load
 
-		if (_vm->_gui->_subtitles || !speechRunning) {
+		if (_vm->getSubtitles() || !speechRunning) {
 			// open text resource & get the line
 			text = _vm->fetchTextLine(_vm->_resman->openResource(text_res), local_text);
 			// make the sprite

Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/controls.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- controls.cpp	19 Feb 2005 14:02:10 -0000	1.85
+++ controls.cpp	20 Feb 2005 15:38:47 -0000	1.86
@@ -24,52 +24,23 @@
 #include "common/system.h"
 
 #include "sword2/sword2.h"
-#include "sword2/controls.h"
 #include "sword2/defs.h"
-#include "sword2/logic.h"
+#include "sword2/controls.h"
 #include "sword2/mouse.h"
 #include "sword2/resman.h"
-#include "sword2/router.h"
 #include "sword2/sound.h"
[...1423 lines suppressed...]
-}
-
-void Gui::updateGraphicsLevel(int newLevel) {
-	if (newLevel < 0)
-		newLevel = 0;
-	else if (newLevel > 3)
-		newLevel = 3;
-
-	_vm->_screen->setRenderLevel(newLevel);
-
-	// update our global variable - which needs to be checked when dimming
-	// the palette in PauseGame() in sword2.cpp (since palette-matching
-	// cannot be done with dimmed palette so we turn down one notch while
-	// dimmed, if at top level)
-
-	_currentGraphicsLevel = newLevel;
+	return result;
 }
 
 } // End of namespace Sword2

Index: controls.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/controls.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- controls.h	19 Feb 2005 14:02:10 -0000	1.17
+++ controls.h	20 Feb 2005 15:38:47 -0000	1.18
@@ -21,33 +21,152 @@
 #ifndef	_CONTROL_S
 #define	_CONTROL_S
 
+#include "sword2/defs.h"
+
+#define MAX_WIDGETS 25
+
 namespace Sword2 {
 
 class Sword2Engine;
+class FontRendererGui;
+class Widget;
+class Switch;
+class Slider;
+class Button;
+class ScrollButton;
+class Slot;
+
+enum {
+	kSaveDialog,
+	kLoadDialog
+};
+
+/**
+ * Base class for all dialogs.
+ */
+
+class Dialog {
+private:
+	int _numWidgets;
+	Widget *_widgets[MAX_WIDGETS];
+	bool _finish;
+	int _result;
 
-class Gui {
 public:
 	Sword2Engine *_vm;
 
-	int _baseSlot;
-	uint8 _currentGraphicsLevel;
+	Dialog(Sword2Engine *vm);
+	virtual ~Dialog();
 
-	bool _subtitles;
-	bool _pointerTextSelected;
+	void registerWidget(Widget *widget);
 
-	Gui(Sword2Engine *vm);
+	virtual void paint();
+	virtual void setResult(int result);
 
-	uint32 restoreControl(void);
-	void saveControl(void);
-	bool startControl(void);
-	void quitControl(void);
-	void restartControl(void);
-	void optionControl(void);
-	void readOptionSettings(void);
-	void writeOptionSettings(void);
-	void updateGraphicsLevel(int newLevel);
+	virtual int runModal();
+
+	virtual void onAction(Widget *widget, int result = 0) {}
 };
 
+class OptionsDialog : public Dialog {
+private:
+	FontRendererGui *_fr;
+	Widget *_panel;
+	Switch *_objectLabelsSwitch;
+	Switch *_subtitlesSwitch;
+	Switch *_reverseStereoSwitch;
+	Switch *_musicSwitch;
+	Switch *_speechSwitch;
+	Switch *_fxSwitch;
+	Slider *_musicSlider;
+	Slider *_speechSlider;
+	Slider *_fxSlider;
+	Slider *_gfxSlider;
+	Widget *_gfxPreview;
+	Button *_okButton;
+	Button *_cancelButton;
+	
+	SoundMixer *_mixer;
+
+public:
+	OptionsDialog(Sword2Engine *vm);
+	~OptionsDialog();
+
+	virtual void paint();
+	virtual void onAction(Widget *widget, int result = 0);
+};
+
+class SaveLoadDialog : public Dialog {
+private:
+	int _mode, _selectedSlot;
+	byte _editBuffer[SAVE_DESCRIPTION_LEN];
+	int _editPos, _firstPos;
+	int _cursorTick;
+
+	FontRendererGui *_fr1;
+	FontRendererGui *_fr2;
+	Widget *_panel;
+	Slot *_slotButton[8];
+	ScrollButton *_zupButton;
+	ScrollButton *_upButton;
+	ScrollButton *_downButton;
+	ScrollButton *_zdownButton;
+	Button *_okButton;
+	Button *_cancelButton;
+
+public:
+	SaveLoadDialog(Sword2Engine *vm, int mode);
+	~SaveLoadDialog();
+
+	void updateSlots();
+	void drawEditBuffer(Slot *slot);
+
+	virtual void onAction(Widget *widget, int result = 0);
+	virtual void paint();
+	virtual void setResult(int result);
+	virtual int runModal();
+};
+
+/**
+ * A "mini" dialog is usually a yes/no question, but also used for the
+ * restart/restore dialog at the beginning of the game.
+ */
+
+class MiniDialog : public Dialog {
+private:
+	uint32 _headerTextId;
+	uint32 _okTextId;
+	uint32 _cancelTextId;
+	FontRendererGui *_fr;
+	Widget *_panel;
+	Button *_okButton;
+	Button *_cancelButton;
+
+public:
+	MiniDialog(Sword2Engine *vm, uint32 headerTextId, uint32 okTextId = TEXT_OK, uint32 cancelTextId = TEXT_CANCEL);
+	virtual ~MiniDialog();
+	virtual void paint();
+	virtual void onAction(Widget *widget, int result = 0);
+};
+
+class StartDialog : public MiniDialog {
+public:
+	StartDialog(Sword2Engine *vm);
+	virtual int runModal();
+};
+
+class RestartDialog : public MiniDialog {
+public:
+	RestartDialog(Sword2Engine *vm);
+	virtual int runModal();
+};
+
+class QuitDialog : public MiniDialog {
+public:
+	QuitDialog(Sword2Engine *vm);
+	virtual int runModal();
+};
+ 
 } // End of namespace Sword2
 
 #endif

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/defs.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- defs.h	17 Jan 2005 10:57:10 -0000	1.14
+++ defs.h	20 Feb 2005 15:38:47 -0000	1.15
@@ -24,6 +24,21 @@
 #define	SIZE	0x10000			// 65536 items per section
 #define	NuSIZE	0xffff			// & with this
 
+#define TEXT_OK             0x08EB0000
+#define TEXT_CANCEL         0x08EB0001
+#define TEXT_RESTORE        0x08EB0002
+#define TEXT_SAVE           0x08EB0003
+#define TEXT_QUIT           0x08EB0004
+#define TEXT_RESTART        0x08EB0005
+#define TEXT_OPTIONS        0x08EB000A
+#define TEXT_SUBTITLES      0x08EB000B
+#define TEXT_OBJECT_LABELS  0x08EB000C
+#define TEXT_MUSIC_VOLUME   0x08EB000E
+#define TEXT_SPEECH_VOLUME  0x08EB000F
+#define TEXT_FX_VOLUME      0x08EB0010
+#define TEXT_GFX_QUALITY    0x08EB0011
+#define TEXT_REVERSE_STEREO 0x08EB0015
+
 // always 8 (George object used for Nico player character as well)
 #define CUR_PLAYER_ID 8
 

Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/function.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- function.cpp	19 Feb 2005 14:02:11 -0000	1.77
+++ function.cpp	20 Feb 2005 15:38:47 -0000	1.78
@@ -26,7 +26,6 @@
 #include "sword2/defs.h"
 #include "sword2/build_display.h"
 #include "sword2/console.h"
-#include "sword2/controls.h"
 #include "sword2/interpreter.h"
 #include "sword2/logic.h"
 #include "sword2/maketext.h"
@@ -1246,7 +1245,7 @@
 		// we don't want to use a wav for this line either, then just
 		// quit back to script right now!
 
-		if (!_vm->_gui->_subtitles && !wantSpeechForLine(params[S_WAV]))
+		if (!_vm->getSubtitles() && !wantSpeechForLine(params[S_WAV]))
 			return IR_CONT;
 
 		// Drop out for 1st cycle to allow walks/anims to end and
@@ -1411,7 +1410,7 @@
 			}
 		}
 
-		if (_vm->_gui->_subtitles || !speechRunning) {
+		if (_vm->getSubtitles() || !speechRunning) {
 			// We want subtitles, or the speech failed to load.
 			// Either way, we're going to show the text so create
 			// the text sprite.

Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mouse.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mouse.cpp	19 Feb 2005 14:02:11 -0000	1.66
+++ mouse.cpp	20 Feb 2005 15:38:47 -0000	1.67
@@ -326,19 +326,34 @@
 
 	switch (hit) {
 	case 0:
-		_vm->_gui->optionControl();
+		{
+			OptionsDialog dialog(_vm);
+			dialog.runModal();
+		}
 		break;
 	case 1:
-		_vm->_gui->quitControl();
+		{
+			QuitDialog dialog(_vm);
+			dialog.runModal();
+		}
 		break;
 	case 2:
-		_vm->_gui->saveControl();
+		{
+			SaveLoadDialog dialog(_vm, kSaveDialog);
+			dialog.runModal();
+		}
 		break;
 	case 3:
-		_vm->_gui->restoreControl();
+		{
+			SaveLoadDialog dialog(_vm, kLoadDialog);
+			dialog.runModal();
+		}
 		break;
 	case 4:
-		_vm->_gui->restartControl();
+		{
+			RestartDialog dialog(_vm);
+			dialog.runModal();
+		}
 		break;
 	}
 
@@ -993,7 +1008,7 @@
 	int16 xOffset, yOffset;
 	uint8 justification;
 
-	if (!_vm->_gui->_pointerTextSelected || !text_id)
+	if (!_objectLabels || !text_id)
 		return;
 
 	// Check what the pointer is, to set offsets correctly for text

Index: mouse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mouse.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mouse.h	19 Feb 2005 14:02:12 -0000	1.16
+++ mouse.h	20 Feb 2005 15:38:47 -0000	1.17
@@ -135,6 +135,8 @@
 	uint32 _mouseTouching;
 	uint32 _oldMouseTouching;
 
+	bool _objectLabels;
+
 	uint32 _menuSelectedPos;
 
 	void decompressMouse(byte *decomp, byte *comp, int width, int height, int pitch, int xOff = 0, int yOff = 0);
@@ -151,6 +153,9 @@
 	void getPos(int &x, int &y);
 	void setPos(int x, int y);
 
+	bool getObjectLabels() { return _objectLabels; }
+	void setObjectLabels(bool b) { _objectLabels = b; }
+
 	bool getMouseStatus() { return _mouseStatus; }
 	uint32 getMouseTouching() { return _mouseTouching; }
 	void setMouseTouching(uint32 touching) { _mouseTouching = touching; }

Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/save_rest.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- save_rest.cpp	19 Feb 2005 14:02:12 -0000	1.66
+++ save_rest.cpp	20 Feb 2005 15:38:47 -0000	1.67
@@ -102,6 +102,22 @@
 	uint32 errorCode = saveData(slotNo, saveBufferMem, bufferSize);
 
 	free(saveBufferMem);
+
+	if (errorCode != SR_OK) {
+		uint32 textId;
+
+		switch (errorCode) {
+		case SR_ERR_FILEOPEN:
+			textId = 213516674;
+			break;
+		default:	// SR_ERR_WRITEFAIL
+			textId = 213516676;
+			break;
+		}
+
+		_screen->displayMsg(fetchTextLine(_resman->openResource(textId / SIZE), textId & 0xffff) + 2, 0);
+	}
+
 	return errorCode;
 }
 
@@ -205,6 +221,37 @@
 	else
 		free(saveBufferMem);
 
+	if (errorCode != SR_OK) {
+		uint32 textId;
+
+		switch (errorCode) {
+		case SR_ERR_FILEOPEN:
+			textId = 213516670;
+			break;
+		case SR_ERR_INCOMPATIBLE:
+			textId = 213516671;
+			break;
+		default:	// SR_ERR_READFAIL
+			textId = 213516673;
+			break;
+		}
+
+		_screen->displayMsg(fetchTextLine(_resman->openResource(textId / SIZE), textId & 0xffff) + 2, 0);
+	} else {
+		// Prime system with a game cycle
+
+		// Reset the graphic 'BuildUnit' list before a new logic list
+		// (see fnRegisterFrame)
+		_screen->resetRenderLists();
+
+		// Reset the mouse hot-spot list. See fnRegisterMouse()
+		// and fnRegisterFrame()
+		_mouse->resetMouseList();
+
+		if (_logic->processSession())
+			error("restore 1st cycle failed??");
+	}
+
 	// Force the game engine to pick a cursor. This appears to be needed
 	// when using the -x command-line option to restore a game.
 	_mouse->setMouseTouching(1);

Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/speech.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- speech.cpp	19 Feb 2005 14:02:13 -0000	1.71
+++ speech.cpp	20 Feb 2005 15:38:48 -0000	1.72
@@ -23,7 +23,6 @@
 
 #include "sword2/sword2.h"
 #include "sword2/console.h"
-#include "sword2/controls.h"
 #include "sword2/defs.h"
 #include "sword2/interpreter.h"
 #include "sword2/logic.h"

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- sword2.cpp	19 Feb 2005 14:02:13 -0000	1.134
+++ sword2.cpp	20 Feb 2005 15:38:48 -0000	1.135
@@ -38,6 +38,7 @@
 #include "sword2/memory.h"
 #include "sword2/mouse.h"
 #include "sword2/resman.h"
+#include "sword2/router.h"
 #include "sword2/sound.h"
 
 #ifdef _WIN32_WCE
@@ -128,7 +129,6 @@
 	_mouse = NULL;
 	_logic = NULL;
 	_fontRenderer = NULL;
-	_gui = NULL;
 	_debugger = NULL;
 
 	_keyboardEvent.pending = false;
@@ -152,7 +152,6 @@
 Sword2Engine::~Sword2Engine() {
 	delete _debugger;
 	delete _sound;
-	delete _gui;
 	delete _fontRenderer;
 	delete _screen;
 	delete _mouse;
@@ -179,6 +178,43 @@
 	}
 }
 
+void Sword2Engine::registerDefaultSettings() {
+	ConfMan.registerDefault("music_mute", false);
+	ConfMan.registerDefault("speech_mute", false);
+	ConfMan.registerDefault("sfx_mute", false);
+	ConfMan.registerDefault("gfx_details", 2);
+	ConfMan.registerDefault("subtitles", false);
+	ConfMan.registerDefault("reverse_stereo", false);
+}
+
+void Sword2Engine::readSettings() {
+	_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
+	_mixer->setVolumeForSoundType(SoundMixer::kSpeechAudioDataType, ConfMan.getInt("speech_volume"));
+	_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
+	setSubtitles(ConfMan.getBool("subtitles"));
+	_sound->muteMusic(ConfMan.getBool("music_mute"));
+	_sound->muteSpeech(ConfMan.getBool("speech_mute"));
+	_sound->muteFx(ConfMan.getBool("sfx_mute"));
+	_sound->setReverseStereo(ConfMan.getBool("reverse_stereo"));
+	_mouse->setObjectLabels(ConfMan.getBool("object_labels"));
+	_screen->setRenderLevel(ConfMan.getInt("gfx_details"));
+}
+
+void Sword2Engine::writeSettings() {
+	ConfMan.set("music_volume", _mixer->getVolumeForSoundType(SoundMixer::kMusicAudioDataType));
+	ConfMan.set("speech_volume", _mixer->getVolumeForSoundType(SoundMixer::kSpeechAudioDataType));
+	ConfMan.set("sfx_volume", _mixer->getVolumeForSoundType(SoundMixer::kSFXAudioDataType));
+	ConfMan.set("music_mute", _sound->isMusicMute());
+	ConfMan.set("speech_mute", _sound->isSpeechMute());
+	ConfMan.set("sfx_mute", _sound->isFxMute());
+	ConfMan.set("gfx_details", _screen->getRenderLevel());
+	ConfMan.set("subtitles", getSubtitles());
+	ConfMan.set("object_labels", _mouse->getObjectLabels());
+	ConfMan.set("reverse_stereo", _sound->isReverseStereo());
+
+	ConfMan.flushToDisk();
+}
+
 /**
  * The global script variables and player object should be kept open throughout
  * the game, so that they are never expelled by the resource manager.
@@ -209,7 +245,6 @@
 	_resman = new ResourceManager(this);
 	_logic = new Logic(this);
 	_fontRenderer = new FontRenderer(this);
-	_gui = new Gui(this);
 	_sound = new Sound(this);
 	_mouse = new Mouse(this);
 
@@ -217,9 +252,8 @@
 	if (!_mixer->isReady())
 		warning("Sound initialization failed");
 
-	_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
-	_mixer->setVolumeForSoundType(SoundMixer::kSpeechAudioDataType, ConfMan.getInt("speech_volume"));
-	_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
+	registerDefaultSettings();
+	readSettings();
 
 	initStartMenu();
 
@@ -235,14 +269,15 @@
 	else
 		Logic::_scriptVars[DEMO] = 0;
 
-	_gui->readOptionSettings();
-
 	if (_saveSlot != -1) {
 		if (saveExists(_saveSlot))
 			restoreGame(_saveSlot);
 		else {
+			SaveLoadDialog dialog(this, kLoadDialog);
+
 			_mouse->setMouse(NORMAL_MOUSE_ID);
-			if (!_gui->restoreControl())
+
+			if (!dialog.runModal())
 				startGame();
 		}
 	} else if (!_bootParam && saveExists()) {
@@ -251,7 +286,10 @@
 
 		_mouse->setMouse(NORMAL_MOUSE_ID);
 		_logic->fnPlayMusic(pars);
-		result = _gui->startControl();
+
+		StartDialog dialog(this);
+
+		result = dialog.runModal();
 
 		// If the game is started from the beginning, the cutscene
 		// player will kill the music for us. Otherwise, the restore
@@ -350,6 +388,63 @@
 	_quit = true;
 }
 
+void Sword2Engine::restartGame() {
+	ScreenInfo *screenInfo = _screen->getScreenInfo();
+	uint32 temp_demo_flag;
+
+	_mouse->closeMenuImmediately();
+
+	// Restart the game. To do this, we must...
+
+	// Stop music instantly!
+	_sound->stopMusic(true);
+
+	// In case we were dead - well we're not anymore!
+	Logic::_scriptVars[DEAD] = 0;
+
+	// Restart the game. Clear all memory and reset the globals
+	temp_demo_flag = Logic::_scriptVars[DEMO];
+
+	// Remove all resources from memory, including player object and
+	// global variables
+	_resman->removeAll();
+
+	// Reopen global variables resource and player object
+	setupPersistentResources();
+
+	Logic::_scriptVars[DEMO] = temp_demo_flag;
+
+	// Free all the route memory blocks from previous game
+	_logic->_router->freeAllRouteMem();
+
+	// Call the same function that first started us up
+	startGame();
+
+	// Prime system with a game cycle
+
+	// Reset the graphic 'BuildUnit' list before a new logic list
+	// (see fnRegisterFrame)
+	_screen->resetRenderLists();
+
+	// Reset the mouse hot-spot list (see fnRegisterMouse and
+	// fnRegisterFrame)
+	_mouse->resetMouseList();
+
+	_mouse->closeMenuImmediately();
+
+	// FOR THE DEMO - FORCE THE SCROLLING TO BE RESET!
+	// - this is taken from fnInitBackground
+	// switch on scrolling (2 means first time on screen)
+	screenInfo->scroll_flag = 2;
+
+	if (_logic->processSession())
+		error("restart 1st cycle failed??");
+
+	// So palette not restored immediately after control panel - we want
+	// to fade up instead!
+	screenInfo->new_palette = 99;
+}
+
 bool Sword2Engine::checkForMouseEvents() {
 	return _mouseEvent.pending;
 }
@@ -529,11 +624,11 @@
 	_sound->pauseAllSound();
 	_mouse->pauseGame();
 
-	// If level at max, turn down because palette-matching won't work
-	// when dimmed
+	// If render level is at max, turn it down because palette-matching
+	// won't work when the palette is dimmed.
 
-	if (_gui->_currentGraphicsLevel == 3) {
-		_gui->updateGraphicsLevel(2);
+	if (_screen->getRenderLevel() == 3) {
+		_screen->setRenderLevel(2);
 		_graphicsLevelFudged = true;
 	}
 
@@ -559,7 +654,7 @@
 
 	// If graphics level at max, turn up again
 	if (_graphicsLevelFudged) {
-		_gui->updateGraphicsLevel(3);
+		_screen->setRenderLevel(3);
 		_graphicsLevelFudged = false;
 	}
 

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- sword2.h	19 Feb 2005 14:02:13 -0000	1.76
+++ sword2.h	20 Feb 2005 15:38:48 -0000	1.77
@@ -111,6 +111,8 @@
 	uint32 _totalScreenManagers;
 	uint32 _startRes;
 
+	bool _useSubtitles;
+
 	struct StartUp {
 		char description[MAX_description];
 
@@ -131,8 +133,15 @@
 	int go();
 	int init(GameDetector &detector);
 
+	void registerDefaultSettings();
+	void readSettings();
+	void writeSettings();
+
 	void setupPersistentResources();
 
+	bool getSubtitles() { return _useSubtitles; }
+	void setSubtitles(bool b) { _useSubtitles = b; }
+
 	bool _quit;
 
 	uint32 _features;
@@ -145,7 +154,6 @@
 	Mouse *_mouse;
 	Logic *_logic;
 	FontRenderer *_fontRenderer;
-	Gui *_gui;
 
 	Debugger *_debugger;
 
@@ -238,6 +246,7 @@
 	void startGame();
 	void gameCycle();
 	void closeGame();
+	void restartGame();
 
 	void sleepUntil(uint32 time);
 





More information about the Scummvm-git-logs mailing list