Go to the documentation of this file.
44 enum GrfLoadingStage {
57 GMB_DESERT_TREES_FIELDS = 0,
58 GMB_DESERT_PAVED_ROADS = 1,
59 GMB_FIELD_BOUNDING_BOX = 2,
61 GMB_AMBIENT_SOUND_CALLBACK = 4,
62 GMB_CATENARY_ON_3RD_TRACK = 5,
63 GMB_SECOND_ROCKY_TILE_SET = 6,
95 static const uint32 INVALID_GRFID = 0xFFFFFFFF;
156 assert(this->param_end <=
lengthof(this->param));
157 return (number < this->
param_end) ? this->param[number] : 0;
198 void LoadNewGRF(uint load_index, uint file_index, uint num_baseset);
203 void CDECL
grfmsg(
int severity,
const char *str, ...) WARN_FORMAT(2, 3);
struct LanguageMap * language_map
Mappings related to the languages.
std::vector< RoadTypeLabel > roadtype_list
Roadtype translation table (road)
void ReloadNewGRFData()
Reload all NewGRF files during a running game.
Allow incrementing of ObjectClassID variables.
uint8 callback_mask
Bitmask of canal callbacks that have to be called.
PriceMultipliers price_base_multipliers
Price base multipliers as set by the grf.
void CDECL grfmsg(int severity, const char *str,...)
DEBUG() function dedicated to newGRF debugging messages Function is essentially the same as DEBUG(grf...
void LoadNewGRF(uint load_index, uint file_index, uint num_baseset)
Load all the NewGRFs.
uint32 grf_features
Bitset of GrfSpecFeature the grf uses.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
@ ROADTYPE_END
Used for iterations.
void CDECL bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile)
Reads a variable common to VarAction2 and Action7/9/D.
@ GMB_TRAIN_WIDTH_32_PIXELS
Use 32 pixels per train vehicle in depot gui and vehicle details. Never set in the global variable;.
@ GSF_INVALID
An invalid spec feature.
uint64 used_liveries
Bitmask of LiveryScheme used by the defined engines.
uint32 GetParam(uint number) const
Get GRF Parameter with range checking.
Defines the data structure for an airport.
void ShowNewGRFError()
Show the first NewGRF error we can find.
int traininfo_vehicle_pitch
Vertical offset for drawing train images in depot GUI and vehicle details.
Defines the data structure of each individual tile of an airport.
void ResetPersistentNewGRFData()
Reset NewGRF data which is stored persistently in savegames.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
bool has_2CC
Set if any vehicle is loaded which uses 2cc (two company colours).
@ SHORE_REPLACE_NONE
No shore sprites were replaced.
ShoreReplacement shore
In which way shore sprites were replaced.
void ResetNewGRFData()
Reset all NewGRF loaded data.
RailType
Enumeration for all possible railtypes.
std::vector< RoadTypeLabel > tramtype_list
Roadtype translation table (tram)
static bool HasGrfMiscBit(GrfMiscBit bit)
Check for grf miscellaneous bits.
Information about GRF, used in the game and (part of it) in savegames.
@ GSF_FAKE_TOWNS
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
@ SHORE_REPLACE_ONLY_NEW
Only corner-shores were loaded by Action5 (openttd(w/d).grf only).
Base class that provides memory initialization on dynamically created objects.
@ GSF_FAKE_END
End of the fake features.
@ SHORE_REPLACE_ACTION_5
Shore sprites were replaced by Action5.
GRFLabel * label
Pointer to the first label. This is a linked list, not an array.
uint param_end
one more than the highest set parameter
uint traininfo_vehicle_width
Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details.
RoadType
The different roadtypes we support.
GRFLoadedFeatures _loaded_newgrf_features
Indicates which are the newgrf features currently loaded ingame.
Defines the data structure for constructing industry.
CanalProperties canal_local_properties[CF_END]
Canal properties as set by this NewGRF.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
GRFFile(const struct GRFConfig *config)
Constructor for GRFFile.
Mapping of language data between a NewGRF and OpenTTD.
StringID MapGRFStringID(uint32 grfid, StringID str)
Used when setting an object's property to map to the GRF's strings while taking in consideration the ...
TramReplacement tram
In which way tram depots were replaced.
@ SHORE_REPLACE_ACTION_A
Shore sprites were replaced by ActionA (using grass tiles for the corner-shores).
@ TRAMWAY_REPLACE_DEPOT_WITH_TRACK
Electrified depot graphics with tram track were loaded.
@ RAILTYPE_END
Used for iterations.
uint8 flags
Flags controlling display.
@ TRAMWAY_REPLACE_DEPOT_NONE
No tram depot graphics were loaded.
@ TRAMWAY_REPLACE_DEPOT_NO_TRACK
Electrified depot graphics without tram track were loaded.
@ NUM_CARGO
Maximal number of cargo types in a game.
uint8 cargo_map[NUM_CARGO]
Inverse cargo translation table (CargoID -> local ID)
Subdirectory
The different kinds of subdirectories OpenTTD uses.
std::vector< CargoLabel > cargo_list
Cargo translation table (local ID -> label)
#define lengthof(x)
Return the length of an fixed size array.
void LoadNewGRFFile(struct GRFConfig *config, uint file_index, GrfLoadingStage stage, Subdirectory subdir)
Load a particular NewGRF.
byte _misc_grf_features
Miscellaneous GRF features, set by Action 0x0D, parameter 0x9E.
Canal properties local to the NewGRF.
Defines the data structure of each individual tile of an industry.
std::vector< RailTypeLabel > railtype_list
Railtype translation table.
byte GetGRFContainerVersion()
Get the container version of the currently opened GRF file.
Dynamic data of a loaded NewGRF.
CanalFeature
List of different canal 'features'.