aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/queen/journal.cpp4
-rw-r--r--engines/queen/queen.cpp2
-rw-r--r--engines/queen/queen.h3
-rw-r--r--engines/queen/sound.cpp11
-rw-r--r--engines/queen/sound.h6
5 files changed, 17 insertions, 9 deletions
diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp
index aaaa0cdb42..36f59fecb6 100644
--- a/engines/queen/journal.cpp
+++ b/engines/queen/journal.cpp
@@ -321,7 +321,7 @@ void Journal::handleMouseDown(int x, int y) {
drawConfigPanel();
break;
case ZN_MUSIC_VOLUME:
- val = (x - 136) * QueenEngine::MAX_MUSIC_VOLUME / (266 - 136);
+ val = (x - 136) * Audio::Mixer::kMaxMixerVolume / (266 - 136);
_vm->sound()->setVolume(val);
drawConfigPanel();
break;
@@ -453,7 +453,7 @@ void Journal::drawConfigPanel() {
_vm->checkOptionSettings();
drawSlideBar(_vm->talkSpeed(), QueenEngine::MAX_TEXT_SPEED, BOB_TALK_SPEED, 164, FRAME_BLUE_PIN);
- drawSlideBar(_vm->sound()->getVolume(), QueenEngine::MAX_MUSIC_VOLUME, BOB_MUSIC_VOLUME, 177, FRAME_GREEN_PIN);
+ drawSlideBar(_vm->sound()->getVolume(), Audio::Mixer::kMaxMixerVolume, BOB_MUSIC_VOLUME, 177, FRAME_GREEN_PIN);
drawCheckBox(_vm->sound()->sfxOn(), BOB_SFX_TOGGLE, 221, 155, FRAME_CHECK_BOX);
drawCheckBox(_vm->sound()->speechOn(), BOB_SPEECH_TOGGLE, 158, 155, FRAME_CHECK_BOX);
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index bb777b927d..46a0f42f36 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -153,8 +153,8 @@ void QueenEngine::readOptionSettings() {
_sound->setVolume(ConfMan.getInt("music_volume"));
_sound->musicToggle(!ConfMan.getBool("music_mute"));
_sound->sfxToggle(!ConfMan.getBool("sfx_mute"));
- _talkSpeed = (ConfMan.getInt("talkspeed") * (MAX_TEXT_SPEED - MIN_TEXT_SPEED) + 255 / 2) / 255 + MIN_TEXT_SPEED;
_sound->speechToggle(!ConfMan.getBool("speech_mute"));
+ _talkSpeed = (ConfMan.getInt("talkspeed") * (MAX_TEXT_SPEED - MIN_TEXT_SPEED) + 255 / 2) / 255 + MIN_TEXT_SPEED;
_subtitles = ConfMan.getBool("subtitles");
checkOptionSettings();
}
diff --git a/engines/queen/queen.h b/engines/queen/queen.h
index c1a9b0f455..072975432e 100644
--- a/engines/queen/queen.h
+++ b/engines/queen/queen.h
@@ -118,8 +118,7 @@ public:
AUTOSAVE_SLOT = 0xFF,
MIN_TEXT_SPEED = 4,
- MAX_TEXT_SPEED = 100,
- MAX_MUSIC_VOLUME = 255
+ MAX_TEXT_SPEED = 100
};
protected:
diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp
index 343e81efdb..d3ffcd6c2e 100644
--- a/engines/queen/sound.cpp
+++ b/engines/queen/sound.cpp
@@ -93,7 +93,7 @@ protected:
Sound::Sound(Audio::Mixer *mixer, QueenEngine *vm) :
_mixer(mixer), _vm(vm), _sfxToggle(true), _speechToggle(true), _musicToggle(true),
- _speechSfxExists(false), _lastOverride(0), _masterVolume(0) {
+ _speechSfxExists(false), _lastOverride(0), _musicVolume(0) {
}
Sound *Sound::makeSoundInstance(Audio::Mixer *mixer, QueenEngine *vm, uint8 compression) {
@@ -130,6 +130,13 @@ Sound *Sound::makeSoundInstance(Audio::Mixer *mixer, QueenEngine *vm, uint8 comp
}
}
+void Sound::setVolume(int vol) {
+ _musicVolume = vol;
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _musicVolume);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
+}
+
void Sound::saveState(byte *&ptr) {
WRITE_BE_UINT16(ptr, _lastOverride); ptr += 2;
}
@@ -221,6 +228,8 @@ void PCSound::playSpeech(const char *base) {
void PCSound::setVolume(int vol) {
Sound::setVolume(vol);
+ // Set mixer music volume to maximum, since music volume is regulated by MusicPlayer's MIDI messages
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume);
_music->setVolume(vol);
}
diff --git a/engines/queen/sound.h b/engines/queen/sound.h
index 40092299a7..8c2c9100d9 100644
--- a/engines/queen/sound.h
+++ b/engines/queen/sound.h
@@ -76,8 +76,8 @@ public:
virtual void updateMusic() {}
- virtual void setVolume(int vol) { _masterVolume = vol; }
- virtual int getVolume() { return _masterVolume; }
+ virtual void setVolume(int vol);
+ virtual int getVolume() { return _musicVolume; }
void playLastSong() { playSong(_lastOverride); }
@@ -127,7 +127,7 @@ protected:
bool _speechSfxExists;
int16 _lastOverride;
- int _masterVolume;
+ int _musicVolume;
};
class PCSound : public Sound {