[Scummvm-cvs-logs] SF.net SVN: scummvm:[33091] scummvm/branches/gsoc2008-rtl/engines/sword1/ sword1.cpp
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Thu Jul 17 22:09:06 CEST 2008
Revision: 33091
http://scummvm.svn.sourceforge.net/scummvm/?rev=33091&view=rev
Author: cpage88
Date: 2008-07-17 20:08:59 +0000 (Thu, 17 Jul 2008)
Log Message:
-----------
More work with SWORD1 sound settings
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp
Modified: scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp 2008-07-17 17:49:38 UTC (rev 33090)
+++ scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp 2008-07-17 20:08:59 UTC (rev 33091)
@@ -247,8 +247,6 @@
_resMan = new ResMan("swordres.rif", _systemVars.isMac);
debug(5, "Starting object manager");
_objectMan = new ObjectMan(_resMan);
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, Audio::Mixer::kMaxMixerVolume);
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume);
_mouse = new Mouse(_system, _resMan, _objectMan);
_screen = new Screen(_system, _resMan, _objectMan);
_music = new Music(_mixer);
@@ -257,54 +255,8 @@
_logic = new Logic(_objectMan, _resMan, _screen, _mouse, _sound, _music, _menu, _system, _mixer);
_mouse->useLogicAndMenu(_logic, _menu);
- uint musicVol = ConfMan.getInt("music_volume");
- uint speechVol = ConfMan.getInt("speech_volume");
- uint sfxVol = ConfMan.getInt("sfx_volume");
- uint musicBal = 50;
- if (ConfMan.hasKey("music_balance")) {
- musicBal = CLIP(ConfMan.getInt("music_balance"), 0, 100);
- }
- uint speechBal = 50;
- if (ConfMan.hasKey("speech_balance")) {
- speechBal = CLIP(ConfMan.getInt("speech_balance"), 0, 100);
- }
- uint sfxBal = 50;
- if (ConfMan.hasKey("sfx_balance")) {
- sfxBal = CLIP(ConfMan.getInt("sfx_balance"), 0, 100);
- }
+ syncSoundSettings();
- uint musicVolL = 2 * musicVol * musicBal / 100;
- uint musicVolR = 2 * musicVol - musicVolL;
-
- uint speechVolL = 2 * speechVol * speechBal / 100;
- uint speechVolR = 2 * speechVol - speechVolL;
-
- uint sfxVolL = 2 * sfxVol * sfxBal / 100;
- uint sfxVolR = 2 * sfxVol - sfxVolL;
-
- if (musicVolR > 255) {
- musicVolR = 255;
- }
- if (musicVolL > 255) {
- musicVolL = 255;
- }
- if (speechVolR > 255) {
- speechVolR = 255;
- }
- if (speechVolL > 255) {
- speechVolL = 255;
- }
- if (sfxVolR > 255) {
- sfxVolR = 255;
- }
- if (sfxVolL > 255) {
- sfxVolL = 255;
- }
-
- _music->setVolume(musicVolL, musicVolR);
- _sound->setSpeechVol(speechVolL, speechVolR);
- _sound->setSfxVol(sfxVolL, sfxVolR);
-
_systemVars.justRestoredGame = 0;
_systemVars.currentCD = 0;
_systemVars.controlPanelMode = CP_NEWGAME;
@@ -358,21 +310,33 @@
}
void SwordEngine::syncSoundSettings() {
- int soundVolumeSFX = ConfMan.getInt("sfx_volume");
- int soundVolumeSpeech = ConfMan.getInt("speech_volume");
-
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX);
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
-
uint musicVol = ConfMan.getInt("music_volume");
+ uint sfxVol = ConfMan.getInt("sfx_volume");
+ uint speechVol = ConfMan.getInt("speech_volume");
+
uint musicBal = 50;
if (ConfMan.hasKey("music_balance")) {
musicBal = CLIP(ConfMan.getInt("music_balance"), 0, 100);
}
+ uint speechBal = 50;
+ if (ConfMan.hasKey("speech_balance")) {
+ speechBal = CLIP(ConfMan.getInt("speech_balance"), 0, 100);
+ }
+ uint sfxBal = 50;
+ if (ConfMan.hasKey("sfx_balance")) {
+ sfxBal = CLIP(ConfMan.getInt("sfx_balance"), 0, 100);
+ }
+
uint musicVolL = 2 * musicVol * musicBal / 100;
uint musicVolR = 2 * musicVol - musicVolL;
+ uint speechVolL = 2 * speechVol * speechBal / 100;
+ uint speechVolR = 2 * speechVol - speechVolL;
+
+ uint sfxVolL = 2 * sfxVol * sfxBal / 100;
+ uint sfxVolR = 2 * sfxVol - sfxVolL;
+
if (musicVolR > 255) {
musicVolR = 255;
}
@@ -380,7 +344,25 @@
musicVolL = 255;
}
+ if (speechVolR > 255) {
+ speechVolR = 255;
+ }
+ if (speechVolL > 255) {
+ speechVolL = 255;
+ }
+ if (sfxVolR > 255) {
+ sfxVolR = 255;
+ }
+ if (sfxVolL > 255) {
+ sfxVolL = 255;
+ }
+
_music->setVolume(musicVolL, musicVolR);
+ _sound->setSpeechVol(speechVolL, speechVolR);
+ _sound->setSfxVol(sfxVolL, sfxVolR);
+
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
}
void SwordEngine::flagsToBool(bool *dest, uint8 flags) {
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