diff options
| author | Travis Howell | 2004-09-02 03:54:29 +0000 |
|---|---|---|
| committer | Travis Howell | 2004-09-02 03:54:29 +0000 |
| commit | a8a75eb009a98871829295112d1fd2674a85d7a4 (patch) | |
| tree | 2ef5a076fe63b9e935ad43dd463b082d4a7f17b7 | |
| parent | b556b277fced5a9f4a70be8751f3aa500fb47a31 (diff) | |
| download | scummvm-rg350-a8a75eb009a98871829295112d1fd2674a85d7a4.tar.gz scummvm-rg350-a8a75eb009a98871829295112d1fd2674a85d7a4.tar.bz2 scummvm-rg350-a8a75eb009a98871829295112d1fd2674a85d7a4.zip | |
HE games should check _numSounds to check whether sound type is music.
Set maximum resource idx at 8000 for now, some HE games include huge amounts of sound resources.
svn-id: r14859
| -rw-r--r-- | scumm/resource.cpp | 8 | ||||
| -rw-r--r-- | scumm/scumm.h | 3 | ||||
| -rw-r--r-- | scumm/sound.cpp | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 7fc256c688..ff816fa5ab 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -713,12 +713,8 @@ void ScummEngine::allocResTypeData(int id, uint32 tag, int num, const char *name debug(9, "allocResTypeData(%s/%s,%s,%d,%d)", resTypeFromId(id), name, tag2str(TO_BE_32(tag)), num, mode); assert(id >= 0 && id < (int)(ARRAYSIZE(res.mode))); - if (num >= 2000) { - /* FIXME: this used to be an error but it seems the newer humongous titles - * exceed this presumably old limit, need to determine a new ceiling - */ - warning("Too many %ss (%d) in directory", name, num); - } + if (num >= 8000) + error("Too many %ss (%d) in directory", name, num); res.mode[id] = mode; res.num[id] = num; diff --git a/scumm/scumm.h b/scumm/scumm.h index e9f3ed0c8b..4cd8f1661f 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -477,10 +477,11 @@ protected: /* Global resource tables */ int _numVariables, _numBitVariables, _numLocalObjects; int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; - int _numInventory, _numRooms, _numScripts, _numSounds; + int _numInventory, _numRooms, _numScripts; int _numNewNames, _numGlobalScripts; int _numActors, _numImages, _numRoomVariables; public: + int _numSounds; int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette int _numCharsets; // FIXME - should be protected, used by CharsetRenderer diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 8b40a54792..da15d35327 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -162,7 +162,7 @@ void Sound::playSound(int soundID, int offset) { byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; bool music = false; - if ((_vm->_heversion >= 70) && soundID >= 4000) { + if (_vm->_heversion >= 70 && soundID > _vm->_numSounds) { debugC(DEBUG_SOUND, "playSound #%d", soundID); int music_offs, total_size; @@ -203,7 +203,6 @@ void Sound::playSound(int soundID, int offset) { } - music_offs = musicFile.readUint32LE(); size = musicFile.readUint32LE(); |
