(svn r23724) -Codechange: split of the check to see if ambient sounds are enabled to a header file allowing compilers to inline that check

This commit is contained in:
yexo
2012-01-03 00:45:22 +00:00
parent 7975bedc23
commit f884be58e5
5 changed files with 13 additions and 6 deletions

View File

@@ -51,6 +51,15 @@ void ResetGenericCallbacks();
void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group);
uint16 GetAiPurchaseCallbackResult(uint8 feature, CargoID cargo_type, uint8 default_selection, IndustryType src_industry, IndustryType dst_industry, uint8 distance, AIConstructionEvent event, uint8 count, uint8 station_size, const GRFFile **file);
void AmbientSoundEffectCallback(TileIndex tile);
/** Play an ambient sound effect for an empty tile. */
static inline void AmbientSoundEffect(TileIndex tile)
{
/* Only run callback if enabled. */
if (!HasGrfMiscBit(GMB_AMBIENT_SOUND_CALLBACK)) return;
extern void AmbientSoundEffectCallback(TileIndex tile);
AmbientSoundEffectCallback(tile);
}
#endif /* NEWGRF_GENERIC_H */