OpenTTD
|
Implementation of the NewGRF class' functions. More...
Go to the source code of this file.
Macros | |
#define | DEFINE_NEWGRF_CLASS_METHOD(type) |
Helper for defining the class method's signatures. | |
#define | INSTANTIATE_NEWGRF_CLASS_METHODS(name, Tspec, Tid, Tmax) |
Force instantiation of the methods so we don't get linker errors. |
Functions | |
DEFINE_NEWGRF_CLASS_METHOD (void) | |
Reset the class, i.e. | |
DEFINE_NEWGRF_CLASS_METHOD (Tid) | |
Allocate a class with a given global class ID. | |
DEFINE_NEWGRF_CLASS_METHOD (uint) | |
Get the number of allocated classes. | |
DEFINE_NEWGRF_CLASS_METHOD (const Tspec *) | |
Get a spec from the class at a given index. | |
DEFINE_NEWGRF_CLASS_METHOD (int) | |
Translate a UI spec index into a spec index. |
Implementation of the NewGRF class' functions.
Definition in file newgrf_class_func.h.
#define DEFINE_NEWGRF_CLASS_METHOD | ( | type | ) |
Helper for defining the class method's signatures.
type | The type of the class. |
Definition at line 20 of file newgrf_class_func.h.
#define INSTANTIATE_NEWGRF_CLASS_METHODS | ( | name, | |
Tspec, | |||
Tid, | |||
Tmax | |||
) |
Force instantiation of the methods so we don't get linker errors.
Definition at line 218 of file newgrf_class_func.h.
DEFINE_NEWGRF_CLASS_METHOD | ( | void | ) |
Reset the class, i.e.
Assign a spec to one of the classes.
Insert a spec into the class.
Reset the classes, i.e.
clear everything.
spec | The spec to insert. |
spec | The spec to assign. |
Definition at line 29 of file newgrf_class_func.h.
References free().
DEFINE_NEWGRF_CLASS_METHOD | ( | Tid | ) |
Allocate a class with a given global class ID.
Get the nth-class with user available specs.
cls_id | The global class id, such as 'DFLT'. |
index | UI index of a class. |
Definition at line 57 of file newgrf_class_func.h.
References grfmsg().
DEFINE_NEWGRF_CLASS_METHOD | ( | uint | ) |
Get the number of allocated classes.
Get the number of classes available to the user.
Definition at line 115 of file newgrf_class_func.h.
DEFINE_NEWGRF_CLASS_METHOD | ( | const Tspec * | ) |
Get a spec from the class at a given index.
Retrieve a spec by GRF location.
index | The index where to find the spec. |
grfid | GRF ID of spec. |
local_id | Index within GRF file of spec. |
index | Pointer to return the index of the spec in its class. If NULL then not used. |
Definition at line 154 of file newgrf_class_func.h.
DEFINE_NEWGRF_CLASS_METHOD | ( | int | ) |
Translate a UI spec index into a spec index.
Translate a spec index into a UI spec index.
ui_index | UI index of the spec. |
index | index of the spec. |
Definition at line 165 of file newgrf_class_func.h.