aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-06-24 16:14:28 +0000
committerMax Horn2005-06-24 16:14:28 +0000
commit587a90ed26ad19d6f8a9e130b485d77accca9527 (patch)
tree317ab7a22d079fb2a2b1cef82774a0a14c52ea5f
parent46b6eff722a8d12b9325d0fd4ba13aed8d9824f3 (diff)
downloadscummvm-rg350-587a90ed26ad19d6f8a9e130b485d77accca9527.tar.gz
scummvm-rg350-587a90ed26ad19d6f8a9e130b485d77accca9527.tar.bz2
scummvm-rg350-587a90ed26ad19d6f8a9e130b485d77accca9527.zip
cleanup
svn-id: r18452
-rw-r--r--scumm/imuse_digi/dimuse_codecs.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/scumm/imuse_digi/dimuse_codecs.cpp b/scumm/imuse_digi/dimuse_codecs.cpp
index 1c59cb9746..7b1157b0ea 100644
--- a/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/scumm/imuse_digi/dimuse_codecs.cpp
@@ -138,15 +138,14 @@ void releaseImcTables() {
#endif
void initializeImcTables() {
- int32 destTablePos = 0;
- int32 pos = 0;
+ int pos;
#ifdef __PALM_OS__
if (!_destImcTable) _destImcTable = (byte *)calloc(89, sizeof(byte));
if (!_destImcTable2) _destImcTable2 = (uint32 *)calloc(89 * 64, sizeof(uint32));
#endif
- do {
+ for (pos = 0; pos <= 88; ++pos) {
byte put = 1;
int32 tableValue = ((imcTable[pos] * 4) / 7) / 2;
while (tableValue != 0) {
@@ -159,16 +158,11 @@ void initializeImcTables() {
if (put > 8) {
put = 8;
}
- put--;
- assert(pos < 89);
- _destImcTable[pos] = put;
- } while (++pos <= 88);
- _destImcTable[89] = 0;
+ _destImcTable[pos] = put - 1;
+ }
for (int n = 0; n < 64; n++) {
- pos = 0;
- destTablePos = n;
- do {
+ for (pos = 0; pos <= 88; ++pos) {
int32 count = 32;
int32 put = 0;
int32 tableValue = imcTable[pos];
@@ -179,10 +173,8 @@ void initializeImcTables() {
count /= 2;
tableValue /= 2;
} while (count != 0);
- assert(destTablePos < 89 * 64);
- _destImcTable2[destTablePos] = put;
- destTablePos += 64;
- } while (++pos <= 88);
+ _destImcTable2[n + pos * 64] = put;
+ }
}
}
#define NextBit \