OpenTTD Source 20250312-master-gcdcc6b491d
GRFFile Struct Reference

Dynamic data of a loaded NewGRF. More...

#include <newgrf.h>

Public Member Functions

 GRFFile (const struct GRFConfig &config)
 Constructor for GRFFile.
 
uint32_t GetParam (uint number) const
 Get GRF Parameter with range checking.
 

Data Fields

std::string filename {}
 
uint32_t grfid = 0
 
uint8_t grf_version = 0
 
uint sound_offset = 0
 
uint16_t num_sounds = 0
 
std::vector< std::unique_ptr< struct StationSpec > > stations
 
std::vector< std::unique_ptr< struct HouseSpec > > housespec
 
std::vector< std::unique_ptr< struct IndustrySpec > > industryspec
 
std::vector< std::unique_ptr< struct IndustryTileSpec > > indtspec
 
std::vector< std::unique_ptr< struct ObjectSpec > > objectspec
 
std::vector< std::unique_ptr< struct AirportSpec > > airportspec
 
std::vector< std::unique_ptr< struct AirportTileSpec > > airtspec
 
std::vector< std::unique_ptr< struct RoadStopSpec > > roadstops
 
std::vector< uint32_t > param {}
 
std::vector< GRFLabellabels {}
 List of labels.
 
std::vector< CargoLabelcargo_list {}
 Cargo translation table (local ID -> label)
 
std::array< uint8_t, NUM_CARGOcargo_map {}
 Inverse cargo translation table (CargoType -> local ID)
 
std::vector< BadgeIDbadge_list {}
 Badge translation table (local index -> global index)
 
std::unordered_map< uint16_t, BadgeIDbadge_map {}
 
std::vector< RailTypeLabel > railtype_list {}
 Railtype translation table.
 
std::array< RailType, RAILTYPE_ENDrailtype_map {}
 
std::vector< RoadTypeLabel > roadtype_list {}
 Roadtype translation table (road)
 
std::array< RoadType, ROADTYPE_ENDroadtype_map {}
 
std::vector< RoadTypeLabel > tramtype_list {}
 Roadtype translation table (tram)
 
std::array< RoadType, ROADTYPE_ENDtramtype_map {}
 
std::array< CanalProperties, CF_END > canal_local_properties {}
 Canal properties as set by this NewGRF.
 
std::unordered_map< uint8_t, LanguageMaplanguage_map {}
 Mappings related to the languages.
 
int traininfo_vehicle_pitch = 0
 Vertical offset for drawing train images in depot GUI and vehicle details.
 
uint traininfo_vehicle_width = 0
 Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details.
 
uint32_t grf_features = 0
 Bitset of GrfSpecFeature the grf uses.
 
PriceMultipliers price_base_multipliers {}
 Price base multipliers as set by the grf.
 

Detailed Description

Dynamic data of a loaded NewGRF.

Definition at line 111 of file newgrf.h.

Constructor & Destructor Documentation

◆ GRFFile()

GRFFile::GRFFile ( const struct GRFConfig config)

Member Function Documentation

◆ GetParam()

uint32_t GRFFile::GetParam ( uint  number) const
inline

Get GRF Parameter with range checking.

Definition at line 160 of file newgrf.h.

Referenced by ParamSet().

Field Documentation

◆ airportspec

std::vector<std::unique_ptr<struct AirportSpec> > GRFFile::airportspec

Definition at line 124 of file newgrf.h.

◆ airtspec

std::vector<std::unique_ptr<struct AirportTileSpec> > GRFFile::airtspec

Definition at line 125 of file newgrf.h.

◆ badge_list

std::vector<BadgeID> GRFFile::badge_list {}

Badge translation table (local index -> global index)

Definition at line 135 of file newgrf.h.

Referenced by GetBadgeVariableResult(), GlobalVarChangeInfo(), and ReadBadgeList().

◆ badge_map

std::unordered_map<uint16_t, BadgeID> GRFFile::badge_map {}

Definition at line 136 of file newgrf.h.

◆ canal_local_properties

std::array<CanalProperties, CF_END> GRFFile::canal_local_properties {}

Canal properties as set by this NewGRF.

Definition at line 147 of file newgrf.h.

Referenced by CanalChangeInfo().

◆ cargo_list

std::vector<CargoLabel> GRFFile::cargo_list {}

Cargo translation table (local ID -> label)

Definition at line 132 of file newgrf.h.

Referenced by CalculateRefitMasks(), GetCargoTranslation(), GetCargoTranslationTable(), and GlobalVarChangeInfo().

◆ cargo_map

std::array<uint8_t, NUM_CARGO> GRFFile::cargo_map {}

◆ filename

std::string GRFFile::filename {}

Definition at line 112 of file newgrf.h.

◆ grf_features

uint32_t GRFFile::grf_features = 0

Bitset of GrfSpecFeature the grf uses.

Definition at line 154 of file newgrf.h.

Referenced by FinalisePriceBaseMultipliers().

◆ grf_version

uint8_t GRFFile::grf_version = 0

Definition at line 114 of file newgrf.h.

◆ grfid

uint32_t GRFFile::grfid = 0

Definition at line 113 of file newgrf.h.

◆ housespec

std::vector<std::unique_ptr<struct HouseSpec> > GRFFile::housespec

Definition at line 120 of file newgrf.h.

◆ indtspec

std::vector<std::unique_ptr<struct IndustryTileSpec> > GRFFile::indtspec

Definition at line 122 of file newgrf.h.

◆ industryspec

std::vector<std::unique_ptr<struct IndustrySpec> > GRFFile::industryspec

Definition at line 121 of file newgrf.h.

◆ labels

std::vector<GRFLabel> GRFFile::labels {}

List of labels.

Definition at line 130 of file newgrf.h.

Referenced by ClearTemporaryNewGRFData(), and DefineGotoLabel().

◆ language_map

std::unordered_map<uint8_t, LanguageMap> GRFFile::language_map {}

Mappings related to the languages.

Definition at line 149 of file newgrf.h.

Referenced by LanguageMap::GetLanguageMap(), and GlobalVarChangeInfo().

◆ num_sounds

uint16_t GRFFile::num_sounds = 0

Definition at line 117 of file newgrf.h.

◆ objectspec

std::vector<std::unique_ptr<struct ObjectSpec> > GRFFile::objectspec

Definition at line 123 of file newgrf.h.

◆ param

std::vector<uint32_t> GRFFile::param {}

Definition at line 128 of file newgrf.h.

◆ price_base_multipliers

PriceMultipliers GRFFile::price_base_multipliers {}

Price base multipliers as set by the grf.

Definition at line 155 of file newgrf.h.

Referenced by FinalisePriceBaseMultipliers(), GetPrice(), GlobalVarChangeInfo(), and GRFFile().

◆ railtype_list

std::vector<RailTypeLabel> GRFFile::railtype_list {}

Railtype translation table.

Definition at line 138 of file newgrf.h.

Referenced by GetRailTypeTranslation(), GetReverseRailTypeTranslation(), GlobalVarChangeInfo(), and RailVehicleChangeInfo().

◆ railtype_map

std::array<RailType, RAILTYPE_END> GRFFile::railtype_map {}

Definition at line 139 of file newgrf.h.

◆ roadstops

std::vector<std::unique_ptr<struct RoadStopSpec> > GRFFile::roadstops

Definition at line 126 of file newgrf.h.

◆ roadtype_list

std::vector<RoadTypeLabel> GRFFile::roadtype_list {}

Roadtype translation table (road)

Definition at line 141 of file newgrf.h.

Referenced by AfterLoadGRFs(), GetReverseRoadTypeTranslation(), GetRoadTypeTranslation(), and GlobalVarChangeInfo().

◆ roadtype_map

std::array<RoadType, ROADTYPE_END> GRFFile::roadtype_map {}

Definition at line 142 of file newgrf.h.

◆ sound_offset

uint GRFFile::sound_offset = 0

Definition at line 116 of file newgrf.h.

◆ stations

std::vector<std::unique_ptr<struct StationSpec> > GRFFile::stations

Definition at line 119 of file newgrf.h.

◆ traininfo_vehicle_pitch

int GRFFile::traininfo_vehicle_pitch = 0

Vertical offset for drawing train images in depot GUI and vehicle details.

Definition at line 151 of file newgrf.h.

Referenced by DrawTrainDetails(), Train::GetDisplayImageWidth(), GetGlobalVariable(), GRFFile(), and ParamSet().

◆ traininfo_vehicle_width

uint GRFFile::traininfo_vehicle_width = 0

Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details.

Definition at line 152 of file newgrf.h.

Referenced by Train::GetDisplayImageWidth(), GetGlobalVariable(), GRFFile(), and ParamSet().

◆ tramtype_list

std::vector<RoadTypeLabel> GRFFile::tramtype_list {}

Roadtype translation table (tram)

Definition at line 144 of file newgrf.h.

Referenced by AfterLoadGRFs(), GetReverseRoadTypeTranslation(), GetRoadTypeTranslation(), and GlobalVarChangeInfo().

◆ tramtype_map

std::array<RoadType, ROADTYPE_END> GRFFile::tramtype_map {}

Definition at line 145 of file newgrf.h.


The documentation for this struct was generated from the following files: