From 83dc6ef6e6064441c9a5ebc22061de313147821a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 May 2009 14:57:14 +0000 Subject: (svn r16337) -Codechange: remove pointless variable + wrapper function; having it return anything else than ORIGINAL_SAMPLE_COUNT is asking for NewGRFs failing to load (due to invalid sample index), thus desyncs --- src/sound.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index 4401fc67b..a12b2b840 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -13,20 +13,15 @@ #include "vehicle_base.h" #include "debug.h" -static uint _file_count; static FileEntry *_files; MusicFileSettings msf; /* Number of levels of panning per side */ #define PANNING_LEVELS 16 -/** The number of sounds in the original sample.cat */ -static const uint ORIGINAL_SAMPLE_COUNT = 73; - static void OpenBankFile(const char *filename) { FileEntry *fe = CallocT(ORIGINAL_SAMPLE_COUNT); - _file_count = ORIGINAL_SAMPLE_COUNT; _files = fe; FioOpenFile(SOUND_SLOT, filename); @@ -99,11 +94,6 @@ static void OpenBankFile(const char *filename) } } -uint GetNumOriginalSounds() -{ - return _file_count; -} - static bool SetBankSource(MixerChannel *mc, const FileEntry *fe) { assert(fe != NULL); @@ -187,7 +177,7 @@ static const byte _sound_idx[] = { void SndCopyToPool() { - for (uint i = 0; i < _file_count; i++) { + for (uint i = 0; i < ORIGINAL_SAMPLE_COUNT; i++) { FileEntry *orig = &_files[_sound_idx[i]]; FileEntry *fe = AllocateFileEntry(); -- cgit v1.2.3-54-g00ecf