summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-03-06 19:33:28 +0000
committermaedhros <maedhros@openttd.org>2007-03-06 19:33:28 +0000
commit1c7df202c649b4dad5fe5e5f53fb33191a440724 (patch)
treedd3c567c0980606c17509a28df3ceea5975adb03 /src/newgrf_config.cpp
parent429c41ea51d142a7e99d20beba7bcd2ce99d747c (diff)
downloadopenttd-1c7df202c649b4dad5fe5e5f53fb33191a440724.tar.xz
(svn r9031) -Codechange: Introduce grfconfig->status, and use it for states that are
mutually exclusive. At the same time, add an INITIALISED state which makes it possible to check if a grf is not yet active but will be later on during the GLS_ACTIVATION loading stage.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index ccd212055..c994f20d6 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -60,7 +60,7 @@ static bool CalcGRFMD5Sum(GRFConfig *config)
bool FillGRFDetails(GRFConfig *config, bool is_static)
{
if (!FioCheckFileExists(config->filename)) {
- SETBIT(config->flags, GCF_NOT_FOUND);
+ config->status = GCS_NOT_FOUND;
return false;
}
@@ -210,14 +210,14 @@ void ResetGRFConfig(bool defaults)
/** Check if all GRFs in the GRF config from a savegame can be loaded.
* @return will return any of the following 3 values:<br>
* <ul>
- * <li> GCF_ACTIVATED: No problems occured, all GRF files were found and loaded
- * <li> GCF_COMPATIBLE: For one or more GRF's no exact match was found, but a
+ * <li> GLC_ALL_GOOD: No problems occured, all GRF files were found and loaded
+ * <li> GLC_COMPATIBLE: For one or more GRF's no exact match was found, but a
* compatible GRF with the same grfid was found and used instead
- * <li> GCF_NOT_FOUND: For one or more GRF's no match was found at all
+ * <li> GLC_NOT_FOUND: For one or more GRF's no match was found at all
* </ul> */
-GCF_Flags IsGoodGRFConfigList(void)
+GRFListCompatibility IsGoodGRFConfigList(void)
{
- GCF_Flags res = GCF_ACTIVATED;
+ GRFListCompatibility res = GLC_ALL_GOOD;
for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
const GRFConfig *f = FindGRFConfig(c->grfid, c->md5sum);
@@ -233,7 +233,7 @@ GCF_Flags IsGoodGRFConfigList(void)
SETBIT(c->flags, GCF_COMPATIBLE);
/* Non-found has precedence over compatibility load */
- if (res != GCF_NOT_FOUND) res = GCF_COMPATIBLE;
+ if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;
goto compatible_grf;
}
@@ -241,8 +241,8 @@ GCF_Flags IsGoodGRFConfigList(void)
md5sumToString(buf, lastof(buf), c->md5sum);
DEBUG(grf, 0, "NewGRF %08X (%s) not found; checksum %s", BSWAP32(c->grfid), c->filename, buf);
- SETBIT(c->flags, GCF_NOT_FOUND);
- res = GCF_NOT_FOUND;
+ c->status = GCS_NOT_FOUND;
+ res = GLC_NOT_FOUND;
} else {
compatible_grf:
DEBUG(grf, 1, "Loading GRF %08X from %s", BSWAP32(f->grfid), f->filename);