|
@@ -101,52 +101,52 @@ struct GRFLabel {
|
|
|
};
|
|
|
|
|
|
/** Dynamic data of a loaded NewGRF */
|
|
|
struct GRFFile : ZeroedMemoryAllocator {
|
|
|
char *filename;
|
|
|
uint32 grfid;
|
|
|
byte grf_version;
|
|
|
|
|
|
uint sound_offset;
|
|
|
uint16 num_sounds;
|
|
|
|
|
|
struct StationSpec **stations;
|
|
|
struct HouseSpec **housespec;
|
|
|
struct IndustrySpec **industryspec;
|
|
|
struct IndustryTileSpec **indtspec;
|
|
|
struct ObjectSpec **objectspec;
|
|
|
struct AirportSpec **airportspec;
|
|
|
struct AirportTileSpec **airtspec;
|
|
|
|
|
|
uint32 param[0x80];
|
|
|
uint param_end; ///< one more than the highest set parameter
|
|
|
|
|
|
GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array.
|
|
|
|
|
|
std::vector<CargoLabel> cargo_list; ///< Cargo translation table (local ID -> label)
|
|
|
std::vector<CargoLabel> cargo_list; ///< Cargo translation table (local ID -> label)
|
|
|
uint8 cargo_map[NUM_CARGO]; ///< Inverse cargo translation table (CargoID -> local ID)
|
|
|
|
|
|
std::vector<RailTypeLabel> railtype_list; ///< Railtype translation table
|
|
|
std::vector<RailTypeLabel> railtype_list; ///< Railtype translation table
|
|
|
RailTypeByte railtype_map[RAILTYPE_END];
|
|
|
|
|
|
CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF
|
|
|
|
|
|
struct LanguageMap *language_map; ///< Mappings related to the languages.
|
|
|
|
|
|
int traininfo_vehicle_pitch; ///< Vertical offset for draing train images in depot GUI and vehicle details
|
|
|
uint traininfo_vehicle_width; ///< Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details
|
|
|
|
|
|
uint32 grf_features; ///< Bitset of GrfSpecFeature the grf uses
|
|
|
PriceMultipliers price_base_multipliers; ///< Price base multipliers as set by the grf.
|
|
|
|
|
|
GRFFile(const struct GRFConfig *config);
|
|
|
~GRFFile();
|
|
|
|
|
|
/** Get GRF Parameter with range checking */
|
|
|
uint32 GetParam(uint number) const
|
|
|
{
|
|
|
/* Note: We implicitly test for number < lengthof(this->param) and return 0 for invalid parameters.
|
|
|
* In fact this is the more important test, as param is zeroed anyway. */
|
|
|
assert(this->param_end <= lengthof(this->param));
|
|
|
return (number < this->param_end) ? this->param[number] : 0;
|
|
|
}
|
|
|
};
|