OpenTTD
newgrf_cargo.h
Go to the documentation of this file.
1 /* $Id: newgrf_cargo.h 24273 2012-05-25 17:23:19Z frosch $ */
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_CARGO_H
13 #define NEWGRF_CARGO_H
14 
15 #include "newgrf_callbacks.h"
16 #include "cargo_type.h"
17 #include "gfx_type.h"
18 
19 static const CargoID CT_DEFAULT = NUM_CARGO + 0;
20 static const CargoID CT_PURCHASE = NUM_CARGO + 1;
21 static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2;
22 
23 /* Forward declarations of structs used */
24 struct CargoSpec;
25 struct GRFFile;
26 
28 uint16 GetCargoCallback(CallbackID callback, uint32 param1, uint32 param2, const CargoSpec *cs);
29 CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit = false);
30 
31 #endif /* NEWGRF_CARGO_H */
Specification of a cargo type.
Definition: cargotype.h:56
CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit=false)
Translate a GRF-local cargo slot/bitnum into a CargoID.
Types related to cargoes...
Callbacks that NewGRFs could implement.
Maximal number of cargo types in a game.
Definition: cargo_type.h:66
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition: gfx_type.h:19
CallbackID
List of implemented NewGRF callbacks.
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:22
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
Types related to the graphics and/or input devices.
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:104