OpenTTD
newgrf_generic.h
Go to the documentation of this file.
1 /* $Id: newgrf_generic.h 23735 2012-01-03 20:26:05Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef NEWGRF_GENERIC_H
13 #define NEWGRF_GENERIC_H
14 
15 #include "industry_type.h"
16 #include "newgrf.h"
17 #include "tile_type.h"
18 
19 struct SpriteGroup;
20 
32 
36 
40 
42 
44 };
45 
46 static const IndustryType IT_AI_UNKNOWN = 0xFE;
47 static const IndustryType IT_AI_TOWN = 0xFF;
48 
50 void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group);
51 
52 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);
53 
55 static inline void AmbientSoundEffect(TileIndex tile)
56 {
57  /* Only run callback if enabled. */
58  if (!HasGrfMiscBit(GMB_AMBIENT_SOUND_CALLBACK)) return;
59 
60  extern void AmbientSoundEffectCallback(TileIndex tile);
62 }
63 
64 #endif /* NEWGRF_GENERIC_H */