(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.

This commit is contained in:
Darkvater
2006-04-22 13:17:13 +00:00
parent 28213ea9dc
commit e3280971b1
3 changed files with 84 additions and 30 deletions

View File

@@ -13,14 +13,13 @@ typedef struct GRFLabel {
struct GRFLabel *next;
} GRFLabel;
typedef struct GRFFile GRFFile;
struct GRFFile {
typedef struct GRFFile {
char *filename;
uint32 grfid;
uint16 flags;
uint16 sprite_offset;
SpriteID first_spriteset; ///< Holds the first spriteset's sprite offset.
GRFFile *next;
struct GRFFile *next;
/* A sprite group contains all sprites of a given vehicle (or multiple
* vehicles) when carrying given cargo. It consists of several sprite
@@ -48,10 +47,19 @@ struct GRFFile {
uint param_end; /// one more than the highest set parameter
GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array.
};
} GRFFile;
extern GRFFile *_first_grffile;
typedef struct GRFConfig {
const char *filename;
uint32 param[0x80];
byte num_params;
struct GRFConfig *next;
} GRFConfig;
extern GRFConfig *_first_grfconfig;
void LoadNewGRF(uint load_index, uint file_index);