summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-01-07 21:36:25 +0000
committerfrosch <frosch@openttd.org>2017-01-07 21:36:25 +0000
commita3b356e05782f8b53ef2e3a645eccd33a8c87c23 (patch)
tree0f02c58d9d835a6daa8d02b5457736dbc18c24a6
parent4df712589c0786295238f5b915cb1c53939a94c2 (diff)
downloadopenttd-a3b356e05782f8b53ef2e3a645eccd33a8c87c23.tar.xz
(svn r27725) -Codechange: Remove IsOpenTTDBaseGRF and test for GCF_CONFIG instead, which does the same in all use-cases.
-rw-r--r--src/newgrf.cpp3
-rw-r--r--src/newgrf.h1
-rw-r--r--src/newgrf_config.cpp9
-rw-r--r--src/newgrf_config.h2
4 files changed, 1 insertions, 14 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 8577cb40e..8d85b383d 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5621,7 +5621,7 @@ static void GraphicsNew(ByteReader *buf)
uint16 offset = HasBit(type, 7) ? buf->ReadExtendedByte() : 0;
ClrBit(type, 7); // Clear the high bit as that only indicates whether there is an offset.
- if ((type == 0x0D) && (num == 10) && _cur.grffile->is_ottdfile) {
+ if ((type == 0x0D) && (num == 10) && HasBit(_cur.grfconfig->flags, GCF_SYSTEM)) {
/* Special not-TTDP-compatible case used in openttd.grf
* Missing shore sprites and initialisation of SPR_SHORE_BASE */
grfmsg(2, "GraphicsNew: Loading 10 missing shore sprites from extra grf.");
@@ -8858,7 +8858,6 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage, S
if (_cur.grffile == NULL) usererror("File '%s' lost in cache.\n", filename);
if (stage == GLS_RESERVE && config->status != GCS_INITIALISED) return;
if (stage == GLS_ACTIVATION && !HasBit(config->flags, GCF_RESERVED)) return;
- _cur.grffile->is_ottdfile = config->IsOpenTTDBaseGRF();
}
if (file_index > LAST_GRF_SLOT) {
diff --git a/src/newgrf.h b/src/newgrf.h
index 752873a60..51b00da7c 100644
--- a/src/newgrf.h
+++ b/src/newgrf.h
@@ -103,7 +103,6 @@ struct GRFLabel {
/** Dynamic data of a loaded NewGRF */
struct GRFFile : ZeroedMemoryAllocator {
char *filename;
- bool is_ottdfile;
uint32 grfid;
byte grf_version;
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 0f6623f64..b970e0a80 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -916,15 +916,6 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last)
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->ident.grfid & 0x00FFFFFF) == OPENTTD_GRAPHICS_BASE_GRF_ID;
-}
-
-/**
* Search a textfile file next to this NewGRF.
* @param type The type of the textfile to search for.
* @return The filename for the textfile, \c NULL otherwise.
diff --git a/src/newgrf_config.h b/src/newgrf_config.h
index e19d8d608..73ab243cf 100644
--- a/src/newgrf_config.h
+++ b/src/newgrf_config.h
@@ -179,8 +179,6 @@ struct GRFConfig : ZeroedMemoryAllocator {
void CopyParams(const GRFConfig &src);
- bool IsOpenTTDBaseGRF() const;
-
const char *GetTextfile(TextfileType type) const;
const char *GetName() const;
const char *GetDescription() const;