OpenTTD Source: src/newgrf_cargo.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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/* Forward declarations of structs used */
18struct CargoSpec;
19struct GRFFile;
20
21 SpriteID GetCustomCargoSprite(const CargoSpec *cs);
22uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2, const CargoSpec *cs, std::span<int32_t> regs100 = {});
23 CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit = false);
24
25std::span<const CargoLabel> GetClimateDependentCargoTranslationTable();
26std::span<const CargoLabel> GetClimateIndependentCargoTranslationTable();
27
28#endif /* NEWGRF_CARGO_H */
cargo_type.h
Types related to cargoes...
CargoType
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
Definition cargo_type.h:21
gfx_type.h
Types related to the graphics and/or input devices.
SpriteID
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
newgrf_callbacks.h
Callbacks that NewGRFs could implement.
CallbackID
CallbackID
List of implemented NewGRF callbacks.
Definition newgrf_callbacks.h:22
GetClimateDependentCargoTranslationTable
std::span< const CargoLabel > GetClimateDependentCargoTranslationTable()
Get default climate-dependent cargo translation table for a NewGRF, used if the NewGRF does not provi...
Definition cargotype.cpp:113
GetCustomCargoSprite
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
Get the custom sprite for the given cargo type.
Definition newgrf_cargo.cpp:55
GetClimateIndependentCargoTranslationTable
std::span< const CargoLabel > GetClimateIndependentCargoTranslationTable()
Get default climate-independent cargo translation table for a NewGRF, used if the NewGRF does not pro...
Definition cargotype.cpp:122
GetCargoTranslation
CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit=false)
Translate a GRF-local cargo slot/bitnum into a CargoType.
Definition newgrf_cargo.cpp:80
CargoSpec
Specification of a cargo type.
Definition cargotype.h:74
GRFFile
Dynamic data of a loaded NewGRF.
Definition newgrf.h:114