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 */
Types related to the industry.
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)
&#39;Execute&#39; an AI purchase selection callback
void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group)
Add a generic feature callback sprite group to the appropriate feature list.
Check if we should build an engine.
Check if we should build an engine.
static void AmbientSoundEffect(TileIndex tile)
Play an ambient sound effect for an empty tile.
Check if we should build an engine.
AIConstructionEvent
AI events for asking the NewGRF for information.
Get a station ID to build.
static const IndustryType IT_AI_UNKNOWN
The AI has no specific industry in mind.
Check if we should build an engine.
static const IndustryType IT_AI_TOWN
The AI actually wants to transport to/from a town, not an industry.
void ResetGenericCallbacks()
Reset all generic feature callback sprite groups.
Check if we should build an engine.
Check if we should build an engine.
Unused, we check all.
Check if we should build an engine.
Check if we should build an engine.
Check if we should build an engine.
void AmbientSoundEffectCallback(TileIndex tile)
&#39;Execute&#39; the ambient sound effect callback.
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
Unused, we check all.
Unused, we check all.
Check if we should build a railtype.
Unused, we check all.
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:22
Types related to tiles.
Check if we should build an engine.
static bool HasGrfMiscBit(GrfMiscBit bit)
Check for grf miscellaneous bits.
Definition: newgrf.h:174
Check if we should build an engine.
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:104
Base for the NewGRF implementation.