2006-12-04 08:30:04 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef NEWGRF_CONFIG_H
|
|
|
|
#define NEWGRF_CONFIG_H
|
|
|
|
|
|
|
|
/* GRF config bit flags */
|
|
|
|
enum {
|
|
|
|
GCF_DISABLED,
|
|
|
|
GCF_NOT_FOUND,
|
|
|
|
GCF_ACTIVATED,
|
2006-12-12 19:38:41 +00:00
|
|
|
GCF_SYSTEM,
|
|
|
|
GCF_UNSAFE,
|
|
|
|
GCF_STATIC,
|
2006-12-18 12:26:55 +00:00
|
|
|
GCF_COPY, ///< The data is copied from a grf in _all_grfs
|
2006-12-04 08:30:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct GRFConfig {
|
|
|
|
char *filename;
|
|
|
|
char *name;
|
|
|
|
char *info;
|
|
|
|
uint32 grfid;
|
|
|
|
|
|
|
|
uint8 flags;
|
|
|
|
uint8 md5sum[16];
|
|
|
|
uint32 param[0x80];
|
|
|
|
uint8 num_params;
|
|
|
|
|
|
|
|
struct GRFConfig *next;
|
|
|
|
} GRFConfig;
|
|
|
|
|
|
|
|
/* First item in list of all scanned NewGRFs */
|
|
|
|
extern GRFConfig *_all_grfs;
|
|
|
|
|
|
|
|
/* First item in list of current GRF set up */
|
|
|
|
extern GRFConfig *_grfconfig;
|
|
|
|
|
|
|
|
/* First item in list of default GRF set up */
|
|
|
|
extern GRFConfig *_grfconfig_newgame;
|
|
|
|
|
2006-12-12 19:38:41 +00:00
|
|
|
/* First item in list of static GRF set up */
|
|
|
|
extern GRFConfig *_grfconfig_static;
|
|
|
|
|
2006-12-04 08:30:04 +00:00
|
|
|
void ScanNewGRFFiles(void);
|
|
|
|
const GRFConfig *FindGRFConfig(uint32 grfid, uint8 *md5sum);
|
2006-12-14 15:14:29 +00:00
|
|
|
GRFConfig *GetGRFConfig(uint32 grfid);
|
2006-12-20 20:43:52 +00:00
|
|
|
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src);
|
2006-12-27 18:25:17 +00:00
|
|
|
void AppendStaticGRFConfigs(GRFConfig **dst);
|
2006-12-20 20:43:52 +00:00
|
|
|
void ClearGRFConfig(GRFConfig **config);
|
2006-12-20 21:17:33 +00:00
|
|
|
void ClearGRFConfigList(GRFConfig **config);
|
2006-12-04 08:30:04 +00:00
|
|
|
void ResetGRFConfig(bool defaults);
|
|
|
|
bool IsGoodGRFConfigList(void);
|
2006-12-12 19:38:41 +00:00
|
|
|
bool FillGRFDetails(GRFConfig *config, bool is_static);
|
2006-12-10 11:29:14 +00:00
|
|
|
char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last);
|
2006-12-04 08:30:04 +00:00
|
|
|
|
2006-12-04 14:27:54 +00:00
|
|
|
/* In newgrf_gui.c */
|
2006-12-21 10:29:16 +00:00
|
|
|
void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config);
|
2006-12-04 14:27:54 +00:00
|
|
|
|
2006-12-31 11:12:49 +00:00
|
|
|
#ifdef ENABLE_NETWORK
|
2006-12-18 12:26:55 +00:00
|
|
|
/* For communication about GRFs over the network */
|
|
|
|
#define UNKNOWN_GRF_NAME_PLACEHOLDER "<Unknown>"
|
|
|
|
char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create);
|
2006-12-31 11:12:49 +00:00
|
|
|
#endif /* ENABLE_NETWORK */
|
2006-12-18 12:26:55 +00:00
|
|
|
|
2006-12-04 08:30:04 +00:00
|
|
|
#endif /* NEWGRF_CONFIG_H */
|