diff options
author | Filippos Karapetis | 2007-07-27 18:36:50 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-07-27 18:36:50 +0000 |
commit | a32b81d126aee4644adc074b3b091a4c121e4f7c (patch) | |
tree | e80787bbc10aece710e7d77a4818be6663277509 | |
parent | f9b66f8816cc2157ddae17e180550171e5908d8d (diff) | |
download | scummvm-rg350-a32b81d126aee4644adc074b3b091a4c121e4f7c.tar.gz scummvm-rg350-a32b81d126aee4644adc074b3b091a4c121e4f7c.tar.bz2 scummvm-rg350-a32b81d126aee4644adc074b3b091a4c121e4f7c.zip |
Do not try to load music if the music resource id is 0. Also, the voice LUT resource ID and the voice bank are now set correctly for the IHNM demo.
The IHNM demo starts now, showing some scenes, but the main panel is not loaded correctly, the status line is shown incorrectly and the demo crashes after a cutaway is shown
svn-id: r28245
-rw-r--r-- | engines/saga/rscfile.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index 318d8b71b7..3063e8a9a6 100644 --- a/engines/saga/rscfile.cpp +++ b/engines/saga/rscfile.cpp @@ -683,22 +683,24 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) { _vm->_anim->loadCutawayList(resourcePointer, resourceLength); - _vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength); + if (_metaResource.songTableID > 0) { + _vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength); - if (resourceLength == 0) { - error("Resource::loadGlobalResources Can't load songs list for current track"); - } + if (resourceLength == 0) { + error("Resource::loadGlobalResources Can't load songs list for current track"); + } - free(_vm->_music->_songTable); - - _vm->_music->_songTableLen = resourceLength / 4; - _vm->_music->_songTable = (int32 *)malloc(sizeof(int32) * _vm->_music->_songTableLen); + free(_vm->_music->_songTable); + + _vm->_music->_songTableLen = resourceLength / 4; + _vm->_music->_songTable = (int32 *)malloc(sizeof(int32) * _vm->_music->_songTableLen); - MemoryReadStream songS(resourcePointer, resourceLength); + MemoryReadStream songS(resourcePointer, resourceLength); - for (i = 0; i < _vm->_music->_songTableLen; i++) - _vm->_music->_songTable[i] = songS.readSint32LE(); - free(resourcePointer); + for (i = 0; i < _vm->_music->_songTableLen; i++) + _vm->_music->_songTable[i] = songS.readSint32LE(); + free(resourcePointer); + } int voiceLUTResourceID = 0; @@ -730,6 +732,9 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) { voiceLUTResourceID = 28; break; case 7: + // IHNM demo + _vm->_sndRes->setVoiceBank(0); + voiceLUTResourceID = 17; break; case 8: _vm->_sndRes->setVoiceBank(0); |