(svn r11095) -Codechange: don't abuse 'file_pos' by storing the file_slot in it too, but use a nice seperate variable for it

-Note: on a side-note, this allows files bigger than 16+ MiB, needed for tar-support
This commit is contained in:
truelight
2007-09-13 18:22:34 +00:00
parent 1970e657a3
commit 8cd9ab9b7e
11 changed files with 35 additions and 25 deletions

View File

@@ -45,6 +45,7 @@ static void OpenBankFile(const char *filename)
FioSeekTo(0, SEEK_SET);
for (i = 0; i != count; i++) {
fe[i].file_slot = SOUND_SLOT;
fe[i].file_offset = FioReadDword();
fe[i].file_size = FioReadDword();
}
@@ -75,7 +76,8 @@ static void OpenBankFile(const char *filename)
FioSeekTo(size - (2 + 2 + 4 + 4 + 2 + 1), SEEK_CUR);
} else if (tag == 'atad') {
fe->file_size = size;
fe->file_offset = FioGetPos() | (SOUND_SLOT << 24);
fe->file_slot = SOUND_SLOT;
fe->file_offset = FioGetPos();
break;
} else {
fe->file_size = 0;
@@ -91,7 +93,8 @@ static void OpenBankFile(const char *filename)
fe->channels = 1;
fe->rate = 11025;
fe->bits_per_sample = 8;
fe->file_offset = FioGetPos() | (SOUND_SLOT << 24);
fe->file_slot = SOUND_SLOT;
fe->file_offset = FioGetPos();
}
}
}
@@ -114,7 +117,7 @@ static bool SetBankSource(MixerChannel *mc, uint bank)
int8 *mem = MallocT<int8>(fe->file_size);
if (mem == NULL) return false;
FioSeekToFile(fe->file_offset);
FioSeekToFile(fe->file_slot, fe->file_offset);
FioReadBlock(mem, fe->file_size);
for (i = 0; i != fe->file_size; i++)