summaryrefslogtreecommitdiff
path: root/src/newgrf_config.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-10-17 12:12:13 +0000
committerfrosch <frosch@openttd.org>2010-10-17 12:12:13 +0000
commit3972c790c2cba8c4c01ac6536e8675808f6e1c4d (patch)
tree09e55bb7f156c3cd331ee37683595583d88a2625 /src/newgrf_config.h
parent918da8432ae709e002448c947550674e1f4ae278 (diff)
downloadopenttd-3972c790c2cba8c4c01ac6536e8675808f6e1c4d.tar.xz
(svn r20957) -Codechange: Add another parameter to FindGRFConfig() to define search restrictions.
Diffstat (limited to 'src/newgrf_config.h')
-rw-r--r--src/newgrf_config.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/newgrf_config.h b/src/newgrf_config.h
index e8b6bc86a..085791282 100644
--- a/src/newgrf_config.h
+++ b/src/newgrf_config.h
@@ -164,6 +164,14 @@ struct GRFConfig : ZeroedMemoryAllocator {
void SetSuitablePalette();
};
+/** Method to find GRFs using FindGRFConfig */
+enum FindGRFConfigMode {
+ FGCM_EXACT, ///< Only find Grfs matching md5sum
+ FGCM_COMPATIBLE, ///< Find best compatible
+ FGCM_NEWEST, ///< Find newest Grf
+ 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
@@ -171,7 +179,7 @@ extern GRFConfig *_grfconfig_static; ///< First item in list of static GRF set
void ScanNewGRFFiles();
void CheckForMissingSprites();
-const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum = NULL);
+const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const uint8 *md5sum = NULL);
GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask = 0xFFFFFFFF);
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only);
void AppendStaticGRFConfigs(GRFConfig **dst);