summaryrefslogtreecommitdiff
path: root/src/rev.cpp.in
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-21 14:59:05 +0000
committerrubidium <rubidium@openttd.org>2007-10-21 14:59:05 +0000
commitf4775d06bb53f927ad05c7e6344a4e839c884c44 (patch)
tree2808064f7264f726364aadc0c5869eb17d794970 /src/rev.cpp.in
parent93303cffc453d8cd99b4a1e00645c072e7f7fae3 (diff)
downloadopenttd-f4775d06bb53f927ad05c7e6344a4e839c884c44.tar.xz
(svn r11330) -Add: OTTD version checking for NewGRFs. This allows NewGRFs to do something different for different versions of OpenTTD, like disabling it for too low versions or loading different graphics.
Diffstat (limited to 'src/rev.cpp.in')
-rw-r--r--src/rev.cpp.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/rev.cpp.in b/src/rev.cpp.in
index badec3c0d..0db42ac60 100644
--- a/src/rev.cpp.in
+++ b/src/rev.cpp.in
@@ -1,4 +1,44 @@
+/* $Id$ */
+
+/** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
+
+#include "stdafx.h"
+
+/**
+ * The text version of OpenTTD's revision.
+ * This will be either "<major>.<minor>.<build>[-RC<rc>]",
+ * "r<revision number>[M][-<branch>]" or "norev000".
+ *
+ * The major, minor and build are the numbers that describe releases of
+ * OpenTTD (like 0.5.3). "-RC" is used to flag release candidates.
+ *
+ * The revision number is fairly straight forward. The M is to show that
+ * the binary is made from modified source code. The branch shows the
+ * branch the revision is of and will not be there when it is trunk.
+ *
+ * norev000 is for non-releases that are made on systems without
+ * subversion or sources that are not a checkout of subversion.
+ */
extern const char _openttd_revision[] = "@@VERSION@@";
+
+/**
+ * The NewGRF revision of OTTD:
+ * bits meaning.
+ * 28-31 major version
+ * 24-27 minor version
+ * 20-23 build
+ * 19 1 if it is a release, 0 if it is not.
+ * 0-18 revision number; 0 for releases and when the revision is unknown.
+ *
+ * The 19th bit is there so the development/betas/alpha, etc. leading to a
+ * final release will always have a lower version number than the released
+ * version, thus making comparisions on specific revisions easy.
+ */
+uint32 _openttd_newgrf_version = 0 << 28 | 6 << 24 | 0 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
+
#ifdef __MORPHOS__
+/**
+ * Variable used by MorphOS to show the version.
+ */
extern const char morphos_versions_tag[] = "\\0$VER: OpenTTD @@VERSION@@ (@@DATE@@) OpenTTD Team [MorphOS, PowerPC]";
#endif