belugas@3866: /* $Id$ */ belugas@3866: rubidium@9111: /** @file newgrf_cargo.h Cargo support for NewGRFs. */ belugas@6348: belugas@3866: #ifndef NEWGRF_CARGO_H belugas@3866: #define NEWGRF_CARGO_H belugas@3866: rubidium@7327: #include "newgrf_callbacks.h" rubidium@8119: #include "cargo_type.h" rubidium@8264: #include "gfx_type.h" rubidium@7327: belugas@3866: enum { rubidium@8021: CC_NOAVAILABLE = 0, ///< No cargo class has been specified rubidium@8021: CC_PASSENGERS = 1 << 0, ///< Passengers rubidium@8021: CC_MAIL = 1 << 1, ///< Mail rubidium@8021: CC_EXPRESS = 1 << 2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers) rubidium@8021: CC_ARMOURED = 1 << 3, ///< Armoured cargo (Valuables, Gold, Diamonds) rubidium@8021: CC_BULK = 1 << 4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit) rubidium@8021: CC_PIECE_GOODS = 1 << 5, ///< Piece goods (Livestock, Wood, Steel, Paper) rubidium@8021: CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber) rubidium@8021: CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit) rubidium@8021: CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nucleair Fuel, Explosives, etc.) rubidium@8021: CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.) rubidium@8021: CC_SPECIAL = 1 << 15 ///< Special bit used for livery refit tricks instead of normal cargoes. belugas@3866: }; belugas@3866: peter1138@6148: static const CargoID CT_DEFAULT = NUM_CARGO + 0; peter1138@6148: static const CargoID CT_PURCHASE = NUM_CARGO + 1; peter1138@6148: static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2; belugas@3866: peter1138@6460: /* Forward declarations of structs used */ peter1138@6371: struct CargoSpec; peter1138@6460: struct GRFFile; peter1138@6365: peter1138@6365: SpriteID GetCustomCargoSprite(const CargoSpec *cs); rubidium@7327: uint16 GetCargoCallback(CallbackID callback, uint32 param1, uint32 param2, const CargoSpec *cs); glx@7717: CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit = false); rubidium@7199: uint8 GetReverseCargoTranslation(CargoID cargo, const GRFFile *grffile); peter1138@6365: belugas@3866: #endif /* NEWGRF_CARGO_H */