Files
@ r6873:011bb2269607
Branch filter:
Location: cpp/openttd-patchpack/source/src/cargotype.h - annotation
r6873:011bb2269607
1.2 KiB
text/x-c
(svn r10114) -Fix: Only load newgrf error messages if the language matches the current
language. Since only one error can be loaded anyway, if the language didn't
match you'd get "Undefined string". Also since we're only loading one language
there's no need to use AddGRFString any more.
language. Since only one error can be loaded anyway, if the language didn't
match you'd get "Undefined string". Also since we're only loading one language
there's no need to use AddGRFString any more.
r6091:2faa7d307565 r6091:2faa7d307565 r6123:049e9624d068 r6123:049e9624d068 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6311:78f38fcd68ca r6091:2faa7d307565 r6248:b940b09d7ab8 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6311:78f38fcd68ca r6091:2faa7d307565 r6359:99cac4de410b r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6365:410001496130 r6122:508316e17f8e r6122:508316e17f8e r6248:b940b09d7ab8 r6091:2faa7d307565 r6091:2faa7d307565 r6113:c77736e8b915 r6359:99cac4de410b r6113:c77736e8b915 r6113:c77736e8b915 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6091:2faa7d307565 r6143:9ed364174dfd r6143:9ed364174dfd r6460:74b53af67ae0 r6113:c77736e8b915 r6329:73b25d0f4ee2 r6329:73b25d0f4ee2 r6335:0f64aac189b1 r6329:73b25d0f4ee2 r6329:73b25d0f4ee2 r6091:2faa7d307565 r6091:2faa7d307565 | /* $Id$ */
/** @file cargotype.h */
#ifndef CARGOTYPE_H
#define CARGOTYPE_H
typedef uint32 CargoLabel;
enum TownEffect {
TE_NONE,
TE_PASSENGERS,
TE_MAIL,
TE_GOODS,
TE_WATER,
TE_FOOD,
};
struct CargoSpec {
uint8 bitnum;
CargoLabel label;
uint32 grfid;
uint8 legend_colour;
uint8 rating_colour;
uint8 weight;
uint16 initial_payment;
uint8 transit_days[2];
bool is_freight;
TownEffect town_effect; ///< The effect this cargo type has on towns
uint16 multipliertowngrowth;
uint8 callback_mask;
StringID name;
StringID name_plural;
StringID units_volume;
StringID quantifier;
StringID abbrev;
SpriteID sprite;
uint16 classes;
const struct SpriteGroup *group;
bool IsValid() const;
};
extern uint32 _cargo_mask;
extern CargoSpec _cargo[NUM_CARGO];
/* Set up the default cargo types for the given landscape type */
void SetupCargoForClimate(LandscapeID l);
/* Retrieve cargo details for the given cargo ID */
const CargoSpec *GetCargo(CargoID c);
/* Get the cargo ID with the cargo label */
CargoID GetCargoIDByLabel(CargoLabel cl);
CargoID GetCargoIDByBitnum(uint8 bitnum);
static inline bool IsCargoInClass(CargoID c, uint16 cc)
{
return (GetCargo(c)->classes & cc) != 0;
}
#endif /* CARGOTYPE_H */
|