(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

This commit is contained in:
rubidium
2009-05-17 14:57:14 +00:00
parent 10ea72a08e
commit 83dc6ef6e6
5 changed files with 7 additions and 15 deletions

View File

@@ -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<FileEntry>(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();