|
OpenTTD Source 20261112-master-gbcbec5e63f
|
Dynamic data of a loaded NewGRF. More...
#include <newgrf.h>
Public Member Functions | |
| GRFFile (const GRFConfig &config) | |
| Constructor for GRFFile. | |
| GRFFile (GRFFile &&other) | |
| uint32_t | GetParam (uint number) const |
| Get GRF Parameter with range checking. | |
Data Fields | |
| std::string | filename {} |
| The filename. | |
| GrfID | grfid {} |
| The GRF ID. | |
| uint8_t | grf_version = 0 |
| GRF version (See https://newgrf-specs.tt-wiki.net/wiki/Version_numbers#GRF_version). | |
| uint | sound_offset = 0 |
| Index of first sound. | |
| uint16_t | num_sounds = 0 |
| Number of sounds. | |
| std::vector< std::unique_ptr< struct StationSpec > > | stations |
| Station definitions. | |
| std::vector< std::unique_ptr< struct HouseSpec > > | housespec |
| House definitions. | |
| std::vector< std::unique_ptr< struct IndustrySpec > > | industryspec |
| Industry definitions. | |
| std::vector< std::unique_ptr< struct IndustryTileSpec > > | indtspec |
| Industry Tile definitions. | |
| std::vector< std::unique_ptr< struct ObjectSpec > > | objectspec |
| Object definitions. | |
| std::vector< std::unique_ptr< struct AirportSpec > > | airportspec |
| Airport definitions. | |
| std::vector< std::unique_ptr< struct AirportTileSpec > > | airtspec |
| Airport Tile definitions. | |
| std::vector< std::unique_ptr< struct RoadStopSpec > > | roadstops |
| RoadStop definitions. | |
| std::vector< uint32_t > | param {} |
| Parameters, initialised by GRFConfig. | |
| std::vector< GRFLabel > | labels {} |
| List of labels. | |
| std::vector< CargoLabel > | cargo_list {} |
| Cargo translation table (local ID -> label). | |
| std::array< uint8_t, NUM_CARGO > | cargo_map {} |
| Inverse cargo translation table (CargoType -> local ID). | |
| std::vector< BadgeID > | badge_list {} |
| Badge translation table (local index -> global index). | |
| std::unordered_map< uint16_t, BadgeID > | badge_map {} |
| Mapping from local id to global badge id. | |
| std::vector< RailTypeLabel > | railtype_list {} |
| Railtype translation table. | |
| std::array< RailType, RAILTYPE_END > | railtype_map {} |
| Mapping from local id to global rail type id. | |
| std::vector< RoadTypeLabel > | roadtype_list {} |
| Roadtype translation table (road). | |
| std::array< RoadType, ROADTYPE_END > | roadtype_map {} |
| Mapping from local id to global road type id. | |
| std::vector< RoadTypeLabel > | tramtype_list {} |
| Roadtype translation table (tram). | |
| std::array< RoadType, ROADTYPE_END > | tramtype_map {} |
| Mapping from local id to global tram type id. | |
| EnumIndexArray< CanalProperties, CanalFeature, CanalFeature::End > | canal_local_properties {} |
| Canal properties as set by this NewGRF. | |
| std::unordered_map< GRFLanguage, LanguageMap > | language_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. | |
| bool | cargo_list_is_fallback = false |
| Set if cargo types have been created but a cargo list has not been installed. | |
| GrfSpecFeatures | grf_features {} |
| Bitset of GrfSpecFeature the grf uses. | |
| PriceMultipliers | price_base_multipliers {} |
| Price base multipliers as set by the grf. | |
| GRFFile::GRFFile | ( | const GRFConfig & | config | ) |
Constructor for GRFFile.
| config | GRFConfig to copy name, grfid and parameters from. |
Definition at line 577 of file newgrf.cpp.
References GRFConfig::filename, filename, grfid, GRFIdentifier::grfid, GRFConfig::ident, INVALID_RAILTYPE, INVALID_ROADTYPE, GRFConfig::param, param, price_base_multipliers, RAILTYPE_ELECTRIC, RAILTYPE_MAGLEV, railtype_map, RAILTYPE_MONO, RAILTYPE_RAIL, roadtype_map, ROADTYPE_ROAD, ROADTYPE_TRAM, traininfo_vehicle_pitch, traininfo_vehicle_width, and tramtype_map.
|
inline |
Get GRF Parameter with range checking.
| number | The parameter number/index. |
0 when the number is out of bounds. Definition at line 183 of file newgrf.h.
Referenced by ParamSet().
| std::vector<std::unique_ptr<struct AirportSpec> > GRFFile::airportspec |
| std::vector<std::unique_ptr<struct AirportTileSpec> > GRFFile::airtspec |
| std::vector<BadgeID> GRFFile::badge_list {} |
Badge translation table (local index -> global index).
Definition at line 150 of file newgrf.h.
Referenced by GetBadgeVariableResult().
| std::unordered_map<uint16_t, BadgeID> GRFFile::badge_map {} |
| EnumIndexArray<CanalProperties, CanalFeature, CanalFeature::End> GRFFile::canal_local_properties {} |
| std::vector<CargoLabel> GRFFile::cargo_list {} |
Cargo translation table (local ID -> label).
Definition at line 147 of file newgrf.h.
Referenced by CalculateRefitMasks(), GetCargoTranslation(), GetCargoTranslationTable(), and GlobalVarChangeInfo().
| bool GRFFile::cargo_list_is_fallback = false |
Set if cargo types have been created but a cargo list has not been installed.
Definition at line 168 of file newgrf.h.
Referenced by GetCargoTranslation().
| std::array<uint8_t, NUM_CARGO> GRFFile::cargo_map {} |
Inverse cargo translation table (CargoType -> local ID).
Definition at line 148 of file newgrf.h.
Referenced by CalculateRefitMasks(), GetAllCargoSuffixes(), GetCargoSuffix(), GetRefitCostFactor(), and IndustryTemporarilyRefusesCargo().
| std::string GRFFile::filename {} |
The filename.
Definition at line 127 of file newgrf.h.
Referenced by FinalisePriceBaseMultipliers(), GetFileByFilename(), GRFFile(), and IndustryProductionCallback().
| GrfSpecFeatures GRFFile::grf_features {} |
Bitset of GrfSpecFeature the grf uses.
Definition at line 170 of file newgrf.h.
Referenced by FinalisePriceBaseMultipliers().
| uint8_t GRFFile::grf_version = 0 |
GRF version (See https://newgrf-specs.tt-wiki.net/wiki/Version_numbers#GRF_version).
Definition at line 129 of file newgrf.h.
Referenced by CalculateRefitMasks(), CheckTrainAttachment(), CmdBuildObject(), CmdStartStopVehicle(), Train::ConsistChanged(), Convert8bitBooleanCallback(), ConvertBooleanCallback(), DoCreateNewIndustry(), GetCargoSubtypeText(), GetCargoSuffix(), GetCargoTranslation(), GetCargoTranslationTable(), GetGlobalVariable(), GetIndustryProbabilityCallback(), GetLoadAmount(), GetNextArticulatedPart(), GetRoadVehLength(), PerformIndustryTileSlopeCheck(), PerformStationTileSlopeCheck(), and Vehicle::UpdateVisualEffect().
| GrfID GRFFile::grfid {} |
The GRF ID.
Definition at line 128 of file newgrf.h.
Referenced by CalculateRefitMasks(), ConDumpCargoTypes(), ConDumpRailTypes(), ConDumpRoadTypes(), ConNewGRFProfile(), Convert8bitBooleanCallback(), ConvertBooleanCallback(), FinalisePriceBaseMultipliers(), GetErrorMessageFromLocationCallbackResult(), GetFileByGRFID(), GetGlobalVariable(), Engine::GetGRFID(), GetGRFStringWithTextStack(), GetHouseName(), GetNewEngine(), GetNewEngineID(), GetNewGRFAdditionalText(), GRFFile(), LoadTranslationTable(), and ProcessNewGRFStringControlCode().
| std::vector<std::unique_ptr<struct HouseSpec> > GRFFile::housespec |
| std::vector<std::unique_ptr<struct IndustryTileSpec> > GRFFile::indtspec |
| std::vector<std::unique_ptr<struct IndustrySpec> > GRFFile::industryspec |
| std::vector<GRFLabel> GRFFile::labels {} |
| std::unordered_map<GRFLanguage, LanguageMap> GRFFile::language_map {} |
Mappings related to the languages.
Definition at line 164 of file newgrf.h.
Referenced by LanguageMap::GetLanguageMap().
| uint16_t GRFFile::num_sounds = 0 |
Number of sounds.
Definition at line 132 of file newgrf.h.
Referenced by GetNewGRFSoundID(), and ImportGRFSound().
| std::vector<std::unique_ptr<struct ObjectSpec> > GRFFile::objectspec |
| std::vector<uint32_t> GRFFile::param {} |
| PriceMultipliers GRFFile::price_base_multipliers {} |
Price base multipliers as set by the grf.
Definition at line 171 of file newgrf.h.
Referenced by FinalisePriceBaseMultipliers(), GetPrice(), and GRFFile().
| std::vector<RailTypeLabel> GRFFile::railtype_list {} |
Railtype translation table.
Definition at line 153 of file newgrf.h.
Referenced by GetRailTypeTranslation(), GetReverseRailTypeTranslation(), and GlobalVarChangeInfo().
| std::array<RailType, RAILTYPE_END> GRFFile::railtype_map {} |
| std::vector<std::unique_ptr<struct RoadStopSpec> > GRFFile::roadstops |
| std::vector<RoadTypeLabel> GRFFile::roadtype_list {} |
Roadtype translation table (road).
Definition at line 156 of file newgrf.h.
Referenced by AfterLoadGRFs(), GetReverseRoadTypeTranslation(), GetRoadTypeTranslation(), and GlobalVarChangeInfo().
| std::array<RoadType, ROADTYPE_END> GRFFile::roadtype_map {} |
| uint GRFFile::sound_offset = 0 |
Index of first sound.
Definition at line 131 of file newgrf.h.
Referenced by GetNewGRFSoundID(), and ImportGRFSound().
| std::vector<std::unique_ptr<struct StationSpec> > GRFFile::stations |
| int GRFFile::traininfo_vehicle_pitch = 0 |
Vertical offset for drawing train images in depot GUI and vehicle details.
Definition at line 166 of file newgrf.h.
Referenced by DrawTrainDetails(), Train::GetDisplayImageWidth(), GetGlobalVariable(), and GRFFile().
| uint GRFFile::traininfo_vehicle_width = 0 |
Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details.
Definition at line 167 of file newgrf.h.
Referenced by Train::GetCursorImageOffset(), Train::GetDisplayImageWidth(), GetGlobalVariable(), GetTrainSpriteSize(), and GRFFile().
| std::vector<RoadTypeLabel> GRFFile::tramtype_list {} |
Roadtype translation table (tram).
Definition at line 159 of file newgrf.h.
Referenced by AfterLoadGRFs(), GetReverseRoadTypeTranslation(), GetRoadTypeTranslation(), and GlobalVarChangeInfo().
| std::array<RoadType, ROADTYPE_END> GRFFile::tramtype_map {} |