(svn r20958) -Add: the concept of min-loadable-version to NewGRFs when choosing compatbile NewGRFs. (planetmaker)

This commit is contained in:
frosch
2010-10-17 12:12:52 +00:00
parent 3972c790c2
commit e805919fe9
2 changed files with 9 additions and 4 deletions

View File

@@ -143,6 +143,7 @@ struct GRFConfig : ZeroedMemoryAllocator {
GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B)
uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown
uint32 min_loadable_version; ///< NOSAVE: Minimum compatible version a NewGRF can define
uint8 flags; ///< NOSAVE: GCF_Flags, bitset
GRFStatus status; ///< NOSAVE: GRFStatus, enum
uint32 grf_bugs; ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs
@@ -167,7 +168,7 @@ struct GRFConfig : ZeroedMemoryAllocator {
/** Method to find GRFs using FindGRFConfig */
enum FindGRFConfigMode {
FGCM_EXACT, ///< Only find Grfs matching md5sum
FGCM_COMPATIBLE, ///< Find best compatible
FGCM_COMPATIBLE, ///< Find best compatible Grf wrt. desired_version
FGCM_NEWEST, ///< Find newest Grf
FGCM_ANY, ///< Use first found
};
@@ -179,7 +180,7 @@ extern GRFConfig *_grfconfig_static; ///< First item in list of static GRF set
void ScanNewGRFFiles();
void CheckForMissingSprites();
const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const uint8 *md5sum = NULL);
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);