summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-15 07:42:25 +0000
committerrubidium <rubidium@openttd.org>2007-11-15 07:42:25 +0000
commitaf0616729a0fe8f514ec5ec431ad2acdbe46d051 (patch)
tree16f3e2ff6c7d1a27f793c7fea834b2625afd09ab /src/newgrf_config.cpp
parent9fcf6e7a43b51bc109749510118d36428ced0b67 (diff)
downloadopenttd-af0616729a0fe8f514ec5ec431ad2acdbe46d051.tar.xz
(svn r11433) -Fix: starting OpenTTD with DOS files made it look weird out of the box.
-Change: make extra sprites (the ones not in the TTD GRFs) replaceable using Action 5. -Feature: make replacing contiguous subsets of sprites in for some types possible in Action 5. Note to GRF authors: when you replaced OpenTTD sprites that are not from the TTD GRF files using Action A, your GRF will not have the intended result anymore as the sprite numbers have changed. You should replace the Action A with an Action 5 from now on.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 169da02b7..18235e4ad 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -69,7 +69,7 @@ bool FillGRFDetails(GRFConfig *config, bool is_static)
LoadNewGRFFile(config, CONFIG_SLOT, GLS_FILESCAN);
/* Skip if the grfid is 0 (not read) or 0xFFFFFFFF (ttdp system grf) */
- if (config->grfid == 0 || config->grfid == 0xFFFFFFFF) return false;
+ if (config->grfid == 0 || config->grfid == 0xFFFFFFFF || config->IsOpenTTDBaseGRF()) return false;
if (is_static) {
/* Perform a 'safety scan' for static GRFs */
@@ -522,6 +522,18 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last)
return dst;
}
+/** Base GRF ID for OpenTTD's base graphics GRFs. */
+static const uint32 OPENTTD_GRAPHICS_BASE_GRF_ID = BSWAP32(0xFF4F5400);
+
+/**
+ * Checks whether this GRF is a OpenTTD base graphic GRF.
+ * @return true if and only if it is a base GRF.
+ */
+bool GRFConfig::IsOpenTTDBaseGRF() const
+{
+ return (this->grfid & 0x00FFFFFF) == OPENTTD_GRAPHICS_BASE_GRF_ID;
+}
+
static const SaveLoad _grfconfig_desc[] = {
SLE_STR(GRFConfig, filename, SLE_STR, 0x40),