diff options
author | rubidium <rubidium@openttd.org> | 2011-08-21 12:49:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-08-21 12:49:51 +0000 |
commit | d7593d881564183ceed5a99fc73154e89c3aa7e3 (patch) | |
tree | 18909ea024499bded5d75aef465a19d49c828b92 /src/newgrf_config.h | |
parent | e99aec39ef3a4c5f92cbfe6f40442499c836731e (diff) | |
download | openttd-d7593d881564183ceed5a99fc73154e89c3aa7e3.tar.xz |
(svn r22790) -Codechange: add callback for when NewGRF scanning is complete
Diffstat (limited to 'src/newgrf_config.h')
-rw-r--r-- | src/newgrf_config.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/newgrf_config.h b/src/newgrf_config.h index f06614848..2561af158 100644 --- a/src/newgrf_config.h +++ b/src/newgrf_config.h @@ -188,7 +188,15 @@ extern GRFConfig *_grfconfig; ///< First item in list of current GRF set 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 -void ScanNewGRFFiles(); +/** 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; +}; + +void ScanNewGRFFiles(NewGRFScanCallback *callback = NULL); void CheckForMissingSprites(); const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const uint8 *md5sum = NULL, uint32 desired_version = 0); GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask = 0xFFFFFFFF); |