summaryrefslogtreecommitdiff
path: root/date.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-20 18:40:57 +0000
committerrubidium <rubidium@openttd.org>2006-08-20 18:40:57 +0000
commit6fb092aa7a574ccfc1baebeddadc26868318ad1f (patch)
tree146ad5e3c72a49bcc04fae58e750b972f063d8c2 /date.h
parenta87a2c26ec50bb4de1c1142259e667d2a831968f (diff)
downloadopenttd-6fb092aa7a574ccfc1baebeddadc26868318ad1f.tar.xz
(svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
The game date subsystem now allows someone to start in the year 0 and continue up to the year 5 000 000. However, you currently cannot build anything before 1920 as there is no newgrf support for dates before 1920 or after 2090 yet.
Diffstat (limited to 'date.h')
-rw-r--r--date.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/date.h b/date.h
index 1b5288599..58f952a19 100644
--- a/date.h
+++ b/date.h
@@ -24,14 +24,16 @@
* The offset in days from the '_date == 0' till
* 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
*/
-#define DAYS_TILL_ORIGINAL_BASE_YEAR 0
+#define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
/* Temporary value to make transition to full past 2090 easier/more clear */
-#define BASE_YEAR 1920
+#define BASE_YEAR 0
/* The absolute minimum & maximum years in OTTD */
-#define MIN_YEAR 1920
-#define MAX_YEAR 2090
+#define MIN_YEAR 0
+/* MAX_YEAR, nicely rounded value of the number of years that can
+ * be encoded in a single 32 bits date, about 2^31 / 366 years. */
+#define MAX_YEAR 5000000
/* Year and Date are defined elsewhere */
typedef uint8 Month;