[Scummvm-cvs-logs] SF.net SVN: scummvm: [32863] scummvm/branches/gsoc2008-rtl/engines/saga

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Tue Jul 1 05:01:11 CEST 2008


Revision: 32863
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32863&view=rev
Author:   cpage88
Date:     2008-06-30 20:01:11 -0700 (Mon, 30 Jun 2008)

Log Message:
-----------
Sound settings for Saga can be configured from the GMM

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/saga/music.cpp
    scummvm/branches/gsoc2008-rtl/engines/saga/music.h
    scummvm/branches/gsoc2008-rtl/engines/saga/saga.cpp
    scummvm/branches/gsoc2008-rtl/engines/saga/saga.h

Modified: scummvm/branches/gsoc2008-rtl/engines/saga/music.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/music.cpp	2008-07-01 01:55:40 UTC (rev 32862)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/music.cpp	2008-07-01 03:01:11 UTC (rev 32863)
@@ -346,7 +346,7 @@
 	}
 }
 
-Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver, int enabled) : _vm(vm), _mixer(mixer), _enabled(enabled), _adlib(false) {
+Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : _vm(vm), _mixer(mixer), _adlib(false) {
 	_player = new MusicPlayer(driver);
 	_currentVolume = 0;
 
@@ -432,11 +432,7 @@
 	uint32 loopStart;
 
 	debug(2, "Music::play %d, %d", resourceId, flags);
-
-	if (!_enabled) {
-		return;
-	}
-
+	
 	if (isPlaying() && _trackNumber == resourceId) {
 		return;
 	}
@@ -444,11 +440,7 @@
 	_trackNumber = resourceId;
 	_player->stopMusic();
 	_mixer->stopHandle(_musicHandle);
-
-	if (!_vm->_musicVolume) {
-		return;
-	}
-
+	
 	int realTrackNumber;
 
 	if (_vm->getGameType() == GType_ITE) {

Modified: scummvm/branches/gsoc2008-rtl/engines/saga/music.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/music.h	2008-07-01 01:55:40 UTC (rev 32862)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/music.h	2008-07-01 03:01:11 UTC (rev 32863)
@@ -105,7 +105,7 @@
 class Music {
 public:
 
-	Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver, int enabled);
+	Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver);
 	~Music(void);
 	void setNativeMT32(bool b)	{ _player->setNativeMT32(b); }
 	bool hasNativeMT32()		{ return _player->hasNativeMT32(); }
@@ -133,7 +133,6 @@
 	Audio::SoundHandle _musicHandle;
 	uint32 _trackNumber;
 
-	int _enabled;
 	bool _adlib;
 
 	int _targetVolume;

Modified: scummvm/branches/gsoc2008-rtl/engines/saga/saga.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/saga.cpp	2008-07-01 01:55:40 UTC (rev 32862)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/saga.cpp	2008-07-01 03:01:11 UTC (rev 32863)
@@ -193,14 +193,9 @@
 	if (native_mt32)
 		_driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
 
-	_music = new Music(this, _mixer, _driver, _musicVolume);
+	_music = new Music(this, _mixer, _driver);
 	_music->setNativeMT32(native_mt32);
 	_music->setAdlib(adlib);
-
-	if (!_musicVolume) {
-		debug(1, "Music disabled.");
-	}
-
 	_render = new Render(this, _system);
 	if (!_render->initialized()) {
 		return FAILURE;
@@ -208,14 +203,11 @@
 
 	// Initialize system specific sound
 	_sound = new Sound(this, _mixer, _soundVolume);
-	if (!_soundVolume) {
-		debug(1, "Sound disabled.");
-	}
-
+	
 	_interface->converseInit();
 	_script->setVerb(_script->getVerbType(kVerbWalkTo));
 
-	_music->setVolume(-1, 1);
+	_music->setVolume(_musicVolume, 1);
 
 	_gfx->initPalette();
 
@@ -519,4 +511,18 @@
 	return (ConfMan.getInt("talkspeed") * 3 + 255 / 2) / 255;
 }
 
+void SagaEngine::syncSoundSettings() {
+	_soundVolume = ConfMan.getInt("sfx_volume");
+	_musicVolume = ConfMan.getInt("music_volume");
+	_subtitlesEnabled = ConfMan.getBool("subtitles");
+	_readingSpeed = getTalkspeed();
+
+	if (_readingSpeed > 3)
+		_readingSpeed = 0;
+
+	_music->setVolume(_musicVolume, 1);
+	_sound->setVolume(_soundVolume);
+
+}
+
 } // End of namespace Saga

Modified: scummvm/branches/gsoc2008-rtl/engines/saga/saga.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/saga.h	2008-07-01 01:55:40 UTC (rev 32862)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/saga.h	2008-07-01 03:01:11 UTC (rev 32863)
@@ -512,6 +512,8 @@
 		return isSaveListFull() ? _saveFilesCount : _saveFilesCount + 1;
 	}
 
+	virtual void syncSoundSettings();
+	
 	int16 _framesEsc;
 
 	uint32 _globalFlags;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list