summaryrefslogtreecommitdiff
path: root/src/newgrf.h
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2012-01-01 16:38:38 +0000
committertruebrain <truebrain@openttd.org>2012-01-01 16:38:38 +0000
commitda460f6928851dee007fab7637c75a242398370c (patch)
tree064767bec947435064f00584c97d9e13518b6aca /src/newgrf.h
parent3b2ecfab010426d2dac7918e6e32463d6b9e47f2 (diff)
downloadopenttd-da460f6928851dee007fab7637c75a242398370c.tar.xz
(svn r23703) -Codechange: allow a compiler to inline a wrapper function, avoiding creation of a function stack, massively increasing its speed, for a function that is called often
Diffstat (limited to 'src/newgrf.h')
-rw-r--r--src/newgrf.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/newgrf.h b/src/newgrf.h
index 6137654ab..74a95f8b8 100644
--- a/src/newgrf.h
+++ b/src/newgrf.h
@@ -15,6 +15,7 @@
#include "cargotype.h"
#include "rail_type.h"
#include "fileio_type.h"
+#include "core/bitmath_func.hpp"
/**
* List of different canal 'features'.
@@ -162,6 +163,17 @@ struct GRFLoadedFeatures {
ShoreReplacement shore; ///< It which way shore sprites were replaced.
};
+/**
+ * Check for grf miscelaneous bits
+ * @param bit The bit to check.
+ * @return Whether the bit is set.
+ */
+static inline bool HasGrfMiscBit(GrfMiscBit bit)
+{
+ extern byte _misc_grf_features;
+ return HasBit(_misc_grf_features, bit);
+}
+
/* Indicates which are the newgrf features currently loaded ingame */
extern GRFLoadedFeatures _loaded_newgrf_features;
@@ -173,7 +185,6 @@ void ResetPersistentNewGRFData();
void CDECL grfmsg(int severity, const char *str, ...) WARN_FORMAT(2, 3);
-bool HasGrfMiscBit(GrfMiscBit bit);
bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile);
StringID MapGRFStringID(uint32 grfid, StringID str);