[Scummvm-cvs-logs] CVS: scummvm/sword2 controls.cpp,1.41,1.42

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Nov 1 10:13:02 CET 2003


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv24864

Modified Files:
	controls.cpp 
Log Message:
Instead of having a function that reverses the panning table, we now have a
function that creates the panning table. The difference is that you now
have to tell whether you want one for normal or reverse stereo, so you are
not dependent on the previous state of the table.

(I still think it may be possible to get rid of the panning table
completely, but that's for later cleanups.)


Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/controls.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- controls.cpp	1 Nov 2003 17:08:23 -0000	1.41
+++ controls.cpp	1 Nov 2003 18:12:03 -0000	1.42
@@ -777,9 +777,9 @@
 
 		gui->readOptionSettings();
 
-		_objectLabelsSwitch->setValue(gui->_pointerTextSelected != 0);
-		_subtitlesSwitch->setValue(gui->_subtitles != 0);
-		_reverseStereoSwitch->setValue(gui->_stereoReversed != 0);
+		_objectLabelsSwitch->setValue(gui->_pointerTextSelected);
+		_subtitlesSwitch->setValue(gui->_subtitles);
+		_reverseStereoSwitch->setValue(gui->_stereoReversed);
 		_musicSwitch->setValue(!g_sound->isMusicMute());
 		_speechSwitch->setValue(!g_sound->isSpeechMute());
 		_fxSwitch->setValue(!g_sound->isFxMute());
@@ -839,14 +839,9 @@
 
 	virtual void onAction(Widget *widget, int result = 0) {
 		// Since there is music playing while the dialog is displayed
-		// we need to update music volume immediately. Everything else
-		// is handled when the dialog is terminated.
+		// we need to update music volume immediately.
 
-		if (widget == _reverseStereoSwitch) {
-			if (result != gui->_stereoReversed)
-				g_sound->reverseStereo();
-			gui->_stereoReversed = result;
-		} else if (widget == _musicSwitch) {
+		if (widget == _musicSwitch) {
 			g_sound->muteMusic(result);
 		} else if (widget == _musicSlider) {
 			g_sound->setMusicVolume(result);
@@ -860,6 +855,10 @@
 			_gfxPreview->setState(result);
 			gui->updateGraphicsLevel(result);
 		} else if (widget == _okButton) {
+			gui->_subtitles = _subtitlesSwitch->getValue();
+			gui->_pointerTextSelected = _objectLabelsSwitch->getValue();
+			gui->_stereoReversed = _reverseStereoSwitch->getValue();
+
 			// Apply the changes
 			g_sound->muteMusic(!_musicSwitch->getValue());
 			g_sound->muteSpeech(!_speechSwitch->getValue());
@@ -867,13 +866,10 @@
 			g_sound->setMusicVolume(_musicSlider->getValue());
 			g_sound->setSpeechVolume(_speechSlider->getValue());
 			g_sound->setFxVolume(_fxSlider->getValue());
+			g_sound->buildPanTable(gui->_stereoReversed);
 
 			gui->updateGraphicsLevel(_gfxSlider->getValue());
 
-			gui->_subtitles = _subtitlesSwitch->getValue();
-			gui->_pointerTextSelected = _objectLabelsSwitch->getValue();
-			gui->_stereoReversed = _reverseStereoSwitch->getValue();
-
 			gui->writeOptionSettings();
 			setResult(1);
 		} else if (widget == _cancelButton) {
@@ -1365,7 +1361,11 @@
 }
 
 void Gui::readOptionSettings(void) {
-	bool newStereoReversed;
+	_subtitles = !ConfMan.getBool("nosubtitles");
+	_pointerTextSelected = ConfMan.getBool("object_labels");
+	_stereoReversed = ConfMan.getBool("reverse_stereo");
+
+	updateGraphicsLevel((uint8) ConfMan.getInt("gfx_details"));
 
 	g_sound->setMusicVolume((16 * ConfMan.getInt("music_volume")) / 255);
 	g_sound->setSpeechVolume((14 * ConfMan.getInt("speech_volume")) / 255);
@@ -1373,15 +1373,7 @@
 	g_sound->muteMusic(ConfMan.getBool("music_mute"));
 	g_sound->muteSpeech(ConfMan.getBool("speech_mute"));
 	g_sound->muteFx(ConfMan.getBool("sfx_mute"));
-	updateGraphicsLevel((uint8) ConfMan.getInt("gfx_details"));
-	_subtitles = !ConfMan.getBool("nosubtitles");
-	_pointerTextSelected = ConfMan.getBool("object_labels");
-	newStereoReversed = ConfMan.getBool("reverse_stereo");
-
-	if (_stereoReversed != newStereoReversed)
-		g_sound->reverseStereo();
-
-	_stereoReversed = newStereoReversed;
+	g_sound->buildPanTable(_stereoReversed);
 }
 
 void Gui::writeOptionSettings(void) {





More information about the Scummvm-git-logs mailing list