SCI: DoSound: when setting volume return previous value, fixes KQ6CD intro.

svn-id: r47292
This commit is contained in:
Walter van Niftrik 2010-01-13 17:34:42 +00:00
parent 29302d172b
commit b59eebfea8

View File

@ -609,12 +609,14 @@ void SoundCommandParser::cmdMuteSound(reg_t obj, int16 value) {
void SoundCommandParser::cmdMasterVolume(reg_t obj, int16 value) {
#ifdef USE_OLD_MUSIC_FUNCTIONS
_acc = make_reg(0, _state->sfx_getVolume());
if (obj != SIGNAL_REG)
_state->sfx_setVolume(obj.toSint16());
_acc = make_reg(0, _state->sfx_getVolume());
#else
debugC(2, kDebugLevelSound, "cmdMasterVolume: %d", value);
_acc = make_reg(0, _music->soundGetMasterVolume());
if (_argc > 1) { // the first parameter is the sound command
int vol = CLIP<int16>(obj.toSint16(), 0, kMaxSciVolume);
vol = vol * Audio::Mixer::kMaxMixerVolume / kMaxSciVolume;
@ -622,7 +624,6 @@ void SoundCommandParser::cmdMasterVolume(reg_t obj, int16 value) {
ConfMan.setInt("sfx_volume", vol);
g_engine->syncSoundSettings();
}
_acc = make_reg(0, _music->soundGetMasterVolume());
#endif
}