aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-22 00:37:41 +0000
committerJohannes Schickel2009-05-22 00:37:41 +0000
commitf7b1aa2a8eb8482db95e12e17c57e4cb41b4e180 (patch)
tree9144837964b3c20c5923fdf775e1b423055efa2c /engines/kyra
parent230277739c5bef9c49808535627030873fde8d1b (diff)
downloadscummvm-rg350-f7b1aa2a8eb8482db95e12e17c57e4cb41b4e180.tar.gz
scummvm-rg350-f7b1aa2a8eb8482db95e12e17c57e4cb41b4e180.tar.bz2
scummvm-rg350-f7b1aa2a8eb8482db95e12e17c57e4cb41b4e180.zip
Fix crash when playing LoL demo.
svn-id: r40780
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/staticres.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 9e27d6c829..cedd64aaa9 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -1761,6 +1761,35 @@ void KyraEngine_MR::initStaticResource() {
#ifdef ENABLE_LOL
// TODO: move this to lol.cpp maybe?
void LoLEngine::initStaticResource() {
+ // assign music data
+ static const char *pcMusicFileListIntro[] = { "LOREINTR" };
+ static const char *pcMusicFileListFinale[] = { "LOREFINL" };
+ static const char *pcMusicFileListIngame[] = { "LORE%02d%c" };
+
+ static const char *pc98MusicFileListIntro[] = { 0, "lore84.86", "lore82.86", 0, 0, 0, "lore83.86", "lore81.86" };
+ static const char *pc98MusicFileListFinale[] = { "lore%02d.86" };
+ static const char *pc98MusicFileListIngame[] = { "lore%02d.86" };
+
+ memset(_soundData, 0, sizeof(_soundData));
+ if (_flags.platform == Common::kPlatformPC) {
+ _soundData[0].fileList = pcMusicFileListIntro;
+ _soundData[0].fileListLen = ARRAYSIZE(pcMusicFileListIntro);
+ _soundData[1].fileList = pcMusicFileListIngame;
+ _soundData[1].fileListLen = ARRAYSIZE(pcMusicFileListIngame);
+ _soundData[2].fileList = pcMusicFileListFinale;
+ _soundData[2].fileListLen = ARRAYSIZE(pcMusicFileListFinale);
+ } else if (_flags.platform == Common::kPlatformPC98) {
+ _soundData[0].fileList = pc98MusicFileListIntro;
+ _soundData[0].fileListLen = ARRAYSIZE(pc98MusicFileListIntro);
+ _soundData[1].fileList = pc98MusicFileListIngame;
+ _soundData[1].fileListLen = ARRAYSIZE(pc98MusicFileListIngame);
+ _soundData[2].fileList = pc98MusicFileListFinale;
+ _soundData[2].fileListLen = ARRAYSIZE(pc98MusicFileListFinale);
+ }
+
+ if (_flags.isDemo)
+ return;
+
_charDefaults = _staticres->loadCharData(kLolCharacterDefs, _charDefaultsSize);
_ingameSoundIndex = (const uint16 *)_staticres->loadRawData(kLolIngameSfxIndex, _ingameSoundIndexSize);
_musicTrackMap = _staticres->loadRawData(kLolMusicTrackMap, _musicTrackMapSize);
@@ -1869,32 +1898,6 @@ void LoLEngine::initStaticResource() {
}
_staticres->unloadId(lolLightningDefs);
- // assign music data
- static const char *pcMusicFileListIntro[] = { "LOREINTR" };
- static const char *pcMusicFileListFinale[] = { "LOREFINL" };
- static const char *pcMusicFileListIngame[] = { "LORE%02d%c" };
-
- static const char *pc98MusicFileListIntro[] = { 0, "lore84.86", "lore82.86", 0, 0, 0, "lore83.86", "lore81.86" };
- static const char *pc98MusicFileListFinale[] = { "lore%02d.86" };
- static const char *pc98MusicFileListIngame[] = { "lore%02d.86" };
-
- memset(_soundData, 0, sizeof(_soundData));
- if (_flags.platform == Common::kPlatformPC) {
- _soundData[0].fileList = pcMusicFileListIntro;
- _soundData[0].fileListLen = ARRAYSIZE(pcMusicFileListIntro);
- _soundData[1].fileList = pcMusicFileListIngame;
- _soundData[1].fileListLen = ARRAYSIZE(pcMusicFileListIngame);
- _soundData[2].fileList = pcMusicFileListFinale;
- _soundData[2].fileListLen = ARRAYSIZE(pcMusicFileListFinale);
- } else if (_flags.platform == Common::kPlatformPC98) {
- _soundData[0].fileList = pc98MusicFileListIntro;
- _soundData[0].fileListLen = ARRAYSIZE(pc98MusicFileListIntro);
- _soundData[1].fileList = pc98MusicFileListIngame;
- _soundData[1].fileListLen = ARRAYSIZE(pc98MusicFileListIngame);
- _soundData[2].fileList = pc98MusicFileListFinale;
- _soundData[2].fileListLen = ARRAYSIZE(pc98MusicFileListFinale);
- }
-
_buttonCallbacks.clear();
#define cb(x) _buttonCallbacks.push_back(BUTTON_FUNCTOR(LoLEngine, this, &LoLEngine::x))
// 0x00