Changeset - r14624:f0f6d8556d19
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2010-02-22 20:18:38
yexo@openttd.org
(svn r19211) -Change: allow sound sets without a sample.cat file (blathijs)
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/sound.cpp
Show inline comments
 
@@ -31,6 +31,9 @@ static void OpenBankFile(const char *fil
 
{
 
	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,
 
	const SoundEntry *sound = GetSound(sound_id);
 
	if (sound == NULL) return;
 

	
 
	/* Empty sound? */
 
	if (sound->rate == 0) return;
 

	
 
	MixerChannel *mc = MxAllocateChannel();
 
	if (mc == NULL) return;
 

	
0 comments (0 inline, 0 general)