mirror of https://github.com/OpenTTD/OpenTTD
(svn r22615) -Codechange: The return value of PlayTileSound() has no purpose. Remove it and document the rest.
parent
ff52f85b9e
commit
4e5534f85e
|
@ -86,15 +86,20 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
|
||||||
return true;
|
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) {
|
if (sound_id >= ORIGINAL_SAMPLE_COUNT) {
|
||||||
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;
|
sound_id += file->sound_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(sound_id < GetNumSounds());
|
assert(sound_id < GetNumSounds());
|
||||||
SndPlayTileFx(sound_id, tile);
|
SndPlayTileFx(sound_id, tile);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,6 @@ void InitializeSoundPool();
|
||||||
SoundEntry *GetSound(SoundID sound_id);
|
SoundEntry *GetSound(SoundID sound_id);
|
||||||
uint GetNumSounds();
|
uint GetNumSounds();
|
||||||
bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
|
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 */
|
#endif /* NEWGRF_SOUND_H */
|
||||||
|
|
Loading…
Reference in New Issue