diff options
author | truelight <truelight@openttd.org> | 2007-09-13 18:22:34 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-09-13 18:22:34 +0000 |
commit | 8cd9ab9b7eb684737321cb09a875e41b1632a609 (patch) | |
tree | 0593f8ece7aec74da5da2ff346539cd1698e6ec4 /src/sound.cpp | |
parent | 1970e657a353cb5a86a4d1f101595039eadf6f29 (diff) | |
download | openttd-8cd9ab9b7eb684737321cb09a875e41b1632a609.tar.xz |
(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
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sound.cpp b/src/sound.cpp index 249ff73e3..a63e9564f 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -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++) |