aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/kyra.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-12-16 18:48:43 +0000
committerJohannes Schickel2007-12-16 18:48:43 +0000
commit4a3dedfe7e14d0309b7b046efd96775d87c9583e (patch)
tree5707e7869c68afbdf239d69c8e9cb7516bb9f42c /engines/kyra/kyra.cpp
parent8da3b3a0eab089672f0d569b01cfed8e3fb01a10 (diff)
downloadscummvm-rg350-4a3dedfe7e14d0309b7b046efd96775d87c9583e.tar.gz
scummvm-rg350-4a3dedfe7e14d0309b7b046efd96775d87c9583e.tar.bz2
scummvm-rg350-4a3dedfe7e14d0309b7b046efd96775d87c9583e.zip
Commit of patch #1848147 "KYRA: SoundTowns Update" with some changes. Thanks to Florian for the patch.
svn-id: r29881
Diffstat (limited to 'engines/kyra/kyra.cpp')
-rw-r--r--engines/kyra/kyra.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index f690fde3cd..c6f9bd5625 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -92,15 +92,31 @@ int KyraEngine::init() {
// for now we prefer Adlib over native MIDI
int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
- if (_flags.platform == Common::kPlatformFMTowns) {
- // TODO: later on here should be a usage of MixedSoundDriver
- _sound = new SoundTowns(this, _mixer);
- } else if (_flags.platform == Common::kPlatformPC98) {
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
// TODO: currently we don't support the PC98 sound data,
// but since it has the FM-Towns data files, we just use the
// FM-Towns driver
- // TODO: later on here should be a usage of MixedSoundDriver
- _sound = new SoundTowns(this, _mixer);
+
+ // Since we handle the volume internally for our FM-Towns driver we set the global
+ // volume for those sound types to the maximum.
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, Audio::Mixer::kMaxMixerVolume);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume);
+
+ if (_flags.gameID == GI_KYRA1) {
+ SoundTowns *snd = new SoundTowns(this, _mixer);
+
+ snd->setMusicVolume(ConfMan.getInt("music_volume"));
+ snd->setSoundEffectsVolume(ConfMan.getInt("sfx_volume"));
+
+ _sound = snd;
+ } else {
+ SoundTowns_v2 *snd = new SoundTowns_v2(this, _mixer);
+
+ snd->setMusicVolume(ConfMan.getInt("music_volume"));
+ snd->setSoundEffectsVolume(ConfMan.getInt("sfx_volume"));
+
+ _sound = snd;
+ }
} else if (midiDriver == MD_ADLIB) {
_sound = new SoundAdlibPC(this, _mixer);
assert(_sound);
@@ -232,3 +248,4 @@ void KyraEngine::delayWithTicks(int ticks) {
} // End of namespace Kyra
+