changeset 17824:ef9605602055 draft

(svn r22615) -Codechange: The return value of PlayTileSound() has no purpose. Remove it and document the rest.
author frosch <frosch@openttd.org>
date Sat, 02 Jul 2011 11:28:22 +0000
parents ae60c5d29322
children aab80a8cc8f2
files src/newgrf_sound.cpp src/newgrf_sound.h
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_sound.cpp
+++ b/src/newgrf_sound.cpp
@@ -86,15 +86,20 @@
 	return true;
 }
 
-bool PlayTileSound(const GRFFile *file, SoundID sound_id, TileIndex tile)
+/**
+ * Play a NewGRF sound effect at the location of a specfic tile.
+ * @param file NewGRF triggering the sound effect.
+ * @param sound_id Sound effect the NewGRF wants to play.
+ * @param tile Location of the effect.
+ */
+void PlayTileSound(const GRFFile *file, SoundID sound_id, TileIndex tile)
 {
 	if (sound_id >= ORIGINAL_SAMPLE_COUNT) {
 		sound_id -= ORIGINAL_SAMPLE_COUNT;
-		if (sound_id > file->num_sounds) return false;
+		if (sound_id > file->num_sounds) return;
 		sound_id += file->sound_offset;
 	}
 
 	assert(sound_id < GetNumSounds());
 	SndPlayTileFx(sound_id, tile);
-	return true;
 }
--- a/src/newgrf_sound.h
+++ b/src/newgrf_sound.h
@@ -35,6 +35,6 @@
 SoundEntry *GetSound(SoundID sound_id);
 uint GetNumSounds();
 bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
-bool PlayTileSound(const struct GRFFile *file, SoundID sound_id, TileIndex tile);
+void PlayTileSound(const struct GRFFile *file, SoundID sound_id, TileIndex tile);
 
 #endif /* NEWGRF_SOUND_H */