Information about GRF, used in the game and (part of it) in savegames. More...
#include <newgrf_config.h>
Public Member Functions | |
| GRFConfig (const char *filename=NULL) | |
| Create a new GRFConfig. | |
| GRFConfig (const GRFConfig &config) | |
| Create a new GRFConfig that is a deep copy of an existing config. | |
| ~GRFConfig () | |
| Cleanup a GRFConfig object. | |
| bool | IsOpenTTDBaseGRF () const |
| Checks whether this GRF is a OpenTTD base graphic GRF. | |
| const char * | GetTextfile (TextfileType type) const |
| Search a textfile file next to this NewGRF. | |
| const char * | GetName () const |
| Get the name of this grf. | |
| const char * | GetDescription () const |
| Get the grf info. | |
| const char * | GetURL () const |
| Get the grf url. | |
| void | SetParameterDefaults () |
| Set the default value for all parameters as specified by action14. | |
| void | SetSuitablePalette () |
| Set the palette of this GRFConfig to something suitable. | |
Data Fields | |
| GRFIdentifier | ident |
| grfid and md5sum to uniquely identify newgrfs | |
| uint8 | original_md5sum [16] |
| MD5 checksum of original file if only a 'compatible' file was loaded. | |
| char * | filename |
| Filename - either with or without full path. | |
| GRFTextWrapper * | name |
| NOSAVE: GRF name (Action 0x08). | |
| GRFTextWrapper * | info |
| NOSAVE: GRF info (author, copyright, ...) (Action 0x08). | |
| GRFTextWrapper * | url |
| NOSAVE: URL belonging to this GRF. | |
| GRFError * | error |
| NOSAVE: Error/Warning during GRF loading (Action 0x0B). | |
| uint32 | version |
| NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown. | |
| uint32 | min_loadable_version |
| NOSAVE: Minimum compatible version a NewGRF can define. | |
| uint8 | flags |
| NOSAVE: GCF_Flags, bitset. | |
| GRFStatus | status |
| NOSAVE: GRFStatus, enum. | |
| uint32 | grf_bugs |
| NOSAVE: bugs in this GRF in this run,. | |
| uint32 | param [0x80] |
| GRF parameters. | |
| uint8 | num_params |
| Number of used parameters. | |
| uint8 | num_valid_params |
| NOSAVE: Number of valid parameters (action 0x14). | |
| uint8 | palette |
| GRFPalette, bitset. | |
| SmallVector< GRFParameterInfo *, 4 > | param_info |
| NOSAVE: extra information about the parameters. | |
| bool | has_param_defaults |
| NOSAVE: did this newgrf specify any defaults for it's parameters. | |
| struct GRFConfig * | next |
| NOSAVE: Next item in the linked list. | |
Information about GRF, used in the game and (part of it) in savegames.
Definition at line 150 of file newgrf_config.h.
| GRFConfig::GRFConfig | ( | const char * | filename = NULL |
) |
| GRFConfig::GRFConfig | ( | const GRFConfig & | config | ) |
Create a new GRFConfig that is a deep copy of an existing config.
| config | The GRFConfig object to make a copy of. |
Definition at line 61 of file newgrf_config.cpp.
References SmallVector< T, S >::Append(), error, filename, info, SmallVector< T, S >::Length(), lengthof, name, original_md5sum, param, param_info, and url.
| GRFConfig::~GRFConfig | ( | ) |
Cleanup a GRFConfig object.
Definition at line 94 of file newgrf_config.cpp.
References error, filename, flags, free(), GCF_COPY, HasBit(), info, SmallVector< T, S >::Length(), name, param_info, and url.
| const char * GRFConfig::GetDescription | ( | ) | const |
Get the grf info.
Definition at line 123 of file newgrf_config.cpp.
References GetGRFStringFromGRFText(), info, and GRFTextWrapper::text.
| const char * GRFConfig::GetName | ( | ) | const |
Get the name of this grf.
In case the name isn't known the filename is returned.
Definition at line 113 of file newgrf_config.cpp.
References filename, GetGRFStringFromGRFText(), name, and StrEmpty().
Referenced by GRFFileScanner::AddFile(), DisableStaticNewGRFInfluencingNonStaticNewGRFs(), ErrorUnknownCallbackResult(), GRFSorter(), ServerNetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(), ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE(), ShowMissingContentWindow(), and ShowNewGrfVehicleError().
| const char * GRFConfig::GetTextfile | ( | TextfileType | type | ) | const |
Search a textfile file next to this NewGRF.
| type | The type of the textfile to search for. |
NULL otherwise. Definition at line 880 of file newgrf_config.cpp.
References filename, and NEWGRF_DIR.
Referenced by NewGRFWindow::OnInvalidateData().
| const char * GRFConfig::GetURL | ( | ) | const |
Get the grf url.
Definition at line 132 of file newgrf_config.cpp.
References GetGRFStringFromGRFText(), GRFTextWrapper::text, and url.
Referenced by NewGRFWindow::OnInvalidateData().
| bool GRFConfig::IsOpenTTDBaseGRF | ( | ) | const |
Checks whether this GRF is a OpenTTD base graphic GRF.
Definition at line 870 of file newgrf_config.cpp.
References GRFIdentifier::grfid, ident, and OPENTTD_GRAPHICS_BASE_GRF_ID.
Referenced by FillGRFDetails(), LoadNewGRFFile(), and NewGRFWindow::OnInvalidateData().
| void GRFConfig::SetParameterDefaults | ( | ) |
Set the default value for all parameters as specified by action14.
Definition at line 138 of file newgrf_config.cpp.
References has_param_defaults, SmallVector< T, S >::Length(), lengthof, num_params, param, and param_info.
Referenced by NewGRFParametersWindow::OnClick().
| void GRFConfig::SetSuitablePalette | ( | ) |
Set the palette of this GRFConfig to something suitable.
That is either the setting coming from the NewGRF or the globally used palette.
Definition at line 156 of file newgrf_config.cpp.
References _settings_client, GRFP_GRF_DOS, GRFP_GRF_MASK, GRFP_GRF_WINDOWS, GRFP_USE_BIT, GRFP_USE_DOS, GRFP_USE_WINDOWS, ClientSettings::gui, GUISettings::newgrf_default_palette, PAL_WINDOWS, palette, and SB().
Referenced by FillGRFDetails().
| uint32 GRFConfig::grf_bugs |
NOSAVE: bugs in this GRF in this run,.
Definition at line 167 of file newgrf_config.h.
Referenced by ErrorUnknownCallbackResult(), ShowNewGrfVehicleError(), and VehicleLengthChanged().
1.7.1