mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(svn r19211) -Change: allow sound sets without a sample.cat file (blathijs)
This commit is contained in:
parent
945d2c08e0
commit
1810351813
@ -31,6 +31,9 @@ static void OpenBankFile(const char *filename)
|
||||
{
|
||||
memset(_original_sounds, 0, sizeof(_original_sounds));
|
||||
|
||||
/* If there is no sound file (nosound set), don't load anything */
|
||||
if (filename == NULL) return;
|
||||
|
||||
FioOpenFile(SOUND_SLOT, filename);
|
||||
size_t pos = FioGetPos();
|
||||
uint count = FioReadDword();
|
||||
@ -162,6 +165,9 @@ static void StartSound(SoundID sound_id, int panning, uint volume)
|
||||
const SoundEntry *sound = GetSound(sound_id);
|
||||
if (sound == NULL) return;
|
||||
|
||||
/* Empty sound? */
|
||||
if (sound->rate == 0) return;
|
||||
|
||||
MixerChannel *mc = MxAllocateChannel();
|
||||
if (mc == NULL) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user