OpenTTD Source  20240917-master-g9ab0a47812
GRFFile Struct Reference

Dynamic data of a loaded NewGRF. More...

#include <newgrf.h>

Inheritance diagram for GRFFile:
ZeroedMemoryAllocator

Public Member Functions

 GRFFile (const struct GRFConfig *config)
 Constructor for GRFFile. More...
 
uint32_t GetParam (uint number) const
 Get GRF Parameter with range checking.
 
- Public Member Functions inherited from ZeroedMemoryAllocator
void * operator new (size_t size)
 Memory allocator for a single class instance. More...
 
void * operator new[] (size_t size)
 Memory allocator for an array of class instances. More...
 
void operator delete (void *ptr)
 Memory release for a single class instance. More...
 
void operator delete[] (void *ptr)
 Memory release for an array of class instances. More...
 

Data Fields

std::string filename
 
uint32_t grfid
 
uint8_t grf_version
 
uint sound_offset
 
uint16_t num_sounds
 
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::array< uint32_t, 0x80 > param
 
uint param_end
 one more than the highest set parameter
 
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 (CargoID -> local ID)
 
std::vector< RailTypeLabel > railtype_list
 Railtype translation table.
 
RailType railtype_map [RAILTYPE_END]
 
std::vector< RoadTypeLabel > roadtype_list
 Roadtype translation table (road)
 
RoadType roadtype_map [ROADTYPE_END]
 
std::vector< RoadTypeLabel > tramtype_list
 Roadtype translation table (tram)
 
RoadType tramtype_map [ROADTYPE_END]
 
CanalProperties canal_local_properties [CF_END]
 Canal properties as set by this NewGRF.
 
std::unordered_map< uint8_t, LanguageMaplanguage_map
 Mappings related to the languages.
 
int traininfo_vehicle_pitch
 Vertical offset for drawing 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_t grf_features
 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 108 of file newgrf.h.

Constructor & Destructor Documentation

◆ GRFFile()

GRFFile::GRFFile ( const struct GRFConfig config)

Constructor for GRFFile.

Parameters
configGRFConfig to copy name, grfid and parameters from.

Definition at line 8933 of file newgrf.cpp.

References GRFConfig::filename, GRFIdentifier::grfid, GRFConfig::ident, traininfo_vehicle_pitch, and traininfo_vehicle_width.


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