KYRA: fixed pc98 intro sfx (regression)

svn-id: r46185
This commit is contained in:
Florian Kagerer 2009-11-29 00:39:22 +00:00
parent 67a96069a4
commit 8b0f3ee4b5
3 changed files with 18 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);