OpenTTD Source  12.0-beta2
newgrf_cargo.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
10 #ifndef NEWGRF_CARGO_H
11 #define NEWGRF_CARGO_H
12 
13 #include "newgrf_callbacks.h"
14 #include "cargo_type.h"
15 #include "gfx_type.h"
16 
17 static const CargoID CT_DEFAULT = NUM_CARGO + 0;
18 static const CargoID CT_PURCHASE = NUM_CARGO + 1;
19 static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2;
20 
21 /* Forward declarations of structs used */
22 struct CargoSpec;
23 struct GRFFile;
24 
26 uint16 GetCargoCallback(CallbackID callback, uint32 param1, uint32 param2, const CargoSpec *cs);
27 CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit = false);
28 
29 #endif /* NEWGRF_CARGO_H */
GetCustomCargoSprite
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
Definition: newgrf_cargo.cpp:54
GetCargoTranslation
CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit=false)
Translate a GRF-local cargo slot/bitnum into a CargoID.
Definition: newgrf_cargo.cpp:79
newgrf_callbacks.h
CargoSpec
Specification of a cargo type.
Definition: cargotype.h:57
CallbackID
CallbackID
List of implemented NewGRF callbacks.
Definition: newgrf_callbacks.h:20
SpriteID
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition: gfx_type.h:17
cargo_type.h
NUM_CARGO
@ NUM_CARGO
Maximal number of cargo types in a game.
Definition: cargo_type.h:65
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:20
gfx_type.h
GRFFile
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:105