aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kagerer2010-08-03 18:19:25 +0000
committerFlorian Kagerer2010-08-03 18:19:25 +0000
commit3fc3a59139b52828fa06f8f3e22f068c004fd469 (patch)
tree8c5a493b22c92283a9b22c79d983f8babf55291d
parent3d228f270f380d5b74becfb3e3598d0ef1ed5c8c (diff)
downloadscummvm-rg350-3fc3a59139b52828fa06f8f3e22f068c004fd469.tar.gz
scummvm-rg350-3fc3a59139b52828fa06f8f3e22f068c004fd469.tar.bz2
scummvm-rg350-3fc3a59139b52828fa06f8f3e22f068c004fd469.zip
KYRA/TOWNS: replace some music stops with fadeouts (based on original code)
svn-id: r51708
-rw-r--r--engines/kyra/sound_lok.cpp6
-rw-r--r--sound/softsynth/fmtowns_pc98/towns_audio.cpp7
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp
index 1d0b334a09..40daa0b5bd 100644
--- a/engines/kyra/sound_lok.cpp
+++ b/engines/kyra/sound_lok.cpp
@@ -49,16 +49,14 @@ void KyraEngine_LoK::snd_playWanderScoreViaMap(int command, int restart) {
_lastMusicCommand = -1;
if (_flags.platform == Common::kPlatformFMTowns) {
- if (command == 1) {
- _sound->beginFadeOut();
- } else if (command >= 35 && command <= 38) {
+ if (command >= 35 && command <= 38) {
snd_playSoundEffect(command - 20);
} else if (command >= 2) {
if (_lastMusicCommand != command)
// the original does -2 here we handle this inside _sound->playTrack()
_sound->playTrack(command);
} else {
- _sound->haltTrack();
+ _sound->beginFadeOut();
}
_lastMusicCommand = command;
} else if (_flags.platform == Common::kPlatformPC98) {
diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
index 683f574f65..ea5797baec 100644
--- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -101,8 +101,8 @@ private:
TownsAudioInterface::TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver) : TownsPC98_FmSynth(mixer, kTypeTowns),
_fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0),
- _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver),
- _musicVolume(256), _sfxVolume(256), _pcmSfxChanMask(0), _ready(false) {
+ _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _pcmSfxChanMask(0),
+ _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume), _ready(false) {
#define INTCB(x) &TownsAudioInterface::intf_##x
static const TownsAudioIntfCallback intfCb[] = {
@@ -257,6 +257,9 @@ bool TownsAudioInterface::init() {
}
int TownsAudioInterface::callback(int command, ...) {
+ if (!_ready)
+ return 1;
+
va_list args;
va_start(args, command);