|
@@ -193,37 +193,37 @@ struct GRFConfig : ZeroedMemoryAllocator
|
|
|
enum FindGRFConfigMode {
|
|
|
FGCM_EXACT, ///< Only find Grfs matching md5sum
|
|
|
FGCM_COMPATIBLE, ///< Find best compatible Grf wrt. desired_version
|
|
|
FGCM_NEWEST, ///< Find newest Grf
|
|
|
FGCM_NEWEST_VALID,///< Find newest Grf, ignoring Grfs with GCF_INVALID set
|
|
|
FGCM_ANY, ///< Use first found
|
|
|
};
|
|
|
|
|
|
extern GRFConfig *_all_grfs; ///< First item in list of all scanned NewGRFs
|
|
|
extern GRFConfig *_grfconfig; ///< First item in list of current GRF set up
|
|
|
extern GRFConfig *_grfconfig_newgame; ///< First item in list of default GRF set up
|
|
|
extern GRFConfig *_grfconfig_static; ///< First item in list of static GRF set up
|
|
|
extern uint _missing_extra_graphics; ///< Number of sprites provided by the fallback extra GRF, i.e. missing in the baseset.
|
|
|
|
|
|
/** Callback for NewGRF scanning. */
|
|
|
struct NewGRFScanCallback {
|
|
|
/** Make sure the right destructor gets called. */
|
|
|
virtual ~NewGRFScanCallback() {}
|
|
|
/** Called whenever the NewGRF scan completed. */
|
|
|
virtual void OnNewGRFsScanned() = 0;
|
|
|
};
|
|
|
|
|
|
size_t GRFGetSizeOfDataSection(FILE *f);
|
|
|
|
|
|
void ScanNewGRFFiles(NewGRFScanCallback *callback);
|
|
|
void CheckForMissingSprites();
|
|
|
const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const uint8 *md5sum = NULL, uint32 desired_version = 0);
|
|
|
GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask = 0xFFFFFFFF);
|
|
|
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only);
|
|
|
void AppendStaticGRFConfigs(GRFConfig **dst);
|
|
|
void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el);
|
|
|
void ClearGRFConfigList(GRFConfig **config);
|
|
|
void ResetGRFConfig(bool defaults);
|
|
|
GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig);
|
|
|
bool FillGRFDetails(GRFConfig *config, bool is_static, Subdirectory subdir = NEWGRF_DIR);
|
|
|
char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last);
|
|
|
|
|
|
/* In newgrf_gui.cpp */
|