From 8b0f3ee4b50d64432ada907f5bbf3bc976f8f2db Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sun, 29 Nov 2009 00:39:22 +0000 Subject: KYRA: fixed pc98 intro sfx (regression) svn-id: r46185 --- engines/kyra/kyra_lok.cpp | 2 +- engines/kyra/sound_intern.h | 2 +- engines/kyra/sound_towns.cpp | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index a1ee5c84fb..f578411724 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -198,7 +198,7 @@ Common::Error KyraEngine_LoK::init() { error("Couldn't init sound"); if (_flags.platform == Common::kPlatformPC98) - _sound->loadSoundFile("introsfx.98"); + _sound->loadSoundFile(k1PC98IntroSfx); else _sound->loadSoundFile(0); diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 79789e1d46..f4aab4db29 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -170,7 +170,7 @@ public: bool init(); void process() {} - void loadSoundFile(uint file) {} + void loadSoundFile(uint file); void loadSoundFile(Common::String file); void playTrack(uint8 track); diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 9fe502e2c2..d30098d5f7 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -4049,6 +4049,22 @@ bool SoundPC98::init() { return _driver->init(); } +void SoundPC98::loadSoundFile(uint file) { + delete[] _sfxTrackData; + + int tmpSize; + const uint8 *tmp = _vm->staticres()->loadRawData((int) file, tmpSize); + + if (!tmp) { + warning("Failed to load static sound data with id %d.", file); + _sfxTrackData = 0; + return; + } + + _sfxTrackData = new uint8[tmpSize]; + memcpy(_sfxTrackData, tmp, tmpSize); +} + void SoundPC98::loadSoundFile(Common::String file) { delete[] _sfxTrackData; _sfxTrackData = _vm->resource()->fileData(file.c_str(), 0); -- cgit v1.2.3