diff options
author | James Brown | 2003-01-18 15:54:38 +0000 |
---|---|---|
committer | James Brown | 2003-01-18 15:54:38 +0000 |
commit | 97ff115e7d8d53e1ef3a8cc5c0fb60693a13d11e (patch) | |
tree | dbb75939feb4f60895055679363d52bcc9640679 | |
parent | 92a53a5bdf9aa1b67b6c844fa68ea783dd7ec96c (diff) | |
download | scummvm-rg350-97ff115e7d8d53e1ef3a8cc5c0fb60693a13d11e.tar.gz scummvm-rg350-97ff115e7d8d53e1ef3a8cc5c0fb60693a13d11e.tar.bz2 scummvm-rg350-97ff115e7d8d53e1ef3a8cc5c0fb60693a13d11e.zip |
Fix shadowed variable in debugger, change bundle compression tables to be dynamic
svn-id: r6499
-rw-r--r-- | scumm/bundle.cpp | 10 | ||||
-rw-r--r-- | scumm/bundle.h | 4 | ||||
-rw-r--r-- | scumm/debugger.cpp | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp index 9d8fc0793c..3723f6309f 100644 --- a/scumm/bundle.cpp +++ b/scumm/bundle.cpp @@ -260,7 +260,10 @@ int32 Bundle::decompressVoiceSampleByIndex(int32 index, byte *comp_final, int32 return 0; } - assert(num <= 50); + if (_compVoiceTable) + free(_compVoiceTable); + + _compVoiceTable = (CompTable*)malloc(sizeof(CompTable) * num); for (i = 0; i < num; i++) { _compVoiceTable[i].offset = _voiceFile.readUint32BE(); _compVoiceTable[i].size = _voiceFile.readUint32BE(); @@ -315,7 +318,10 @@ int32 Bundle::decompressMusicSampleByIndex(int32 index, int32 number, byte *comp return 0; } - assert(num <= 3361); + if (_compMusicTable) + free(_compMusicTable); + _compMusicTable = (CompTable*)malloc(sizeof(CompTable) * num); + for (i = 0; i < num; i++) { _compMusicTable[i].offset = _musicFile.readUint32BE(); _compMusicTable[i].size = _musicFile.readUint32BE(); diff --git a/scumm/bundle.h b/scumm/bundle.h index ac9881102c..c4c9c68a41 100644 --- a/scumm/bundle.h +++ b/scumm/bundle.h @@ -42,8 +42,8 @@ struct BundleAudioTable { int32 compDecode(byte *src, byte *dst); int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size, int32 index, int32 & channels); - CompTable _compVoiceTable[50]; - CompTable _compMusicTable[3361]; + CompTable *_compVoiceTable; + CompTable *_compMusicTable; File _voiceFile; BundleAudioTable *_bundleVoiceTable; BundleAudioTable *_bundleMusicTable; diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 847f6a8d29..91c4a0456c 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -360,8 +360,6 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) { } bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) { - int level; - if (argc == 1) { if (_s->_debugMode == false) Debug_Printf("Debugging is not enabled at this time\n"); |