summaryrefslogtreecommitdiff
path: root/date.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-20 12:39:17 +0000
committerrubidium <rubidium@openttd.org>2006-08-20 12:39:17 +0000
commite159ada7a2a0367c99e94ee07b1d439e7ffacc0b (patch)
tree33714b71b0f9fc1c73fccdd4b1ed25321adc99fa /date.h
parent5fb6c9e1cc073ad96d62efc423e87d79d38d435a (diff)
downloadopenttd-e159ada7a2a0367c99e94ee07b1d439e7ffacc0b.tar.xz
(svn r5975) -Cleanup: use ORIGINAL_BASE_YEAR & ORIGINAL_MAX_YEAR where the functions really depend on the original date format.
-Cleanup: use DAYS_TILL_ORIGINAL_BASE_YEAR where the date variables are in the old date format and conversions are needed. -Cleanup: replace one (forgotten) instance of uint16 with Date.
Diffstat (limited to 'date.h')
-rw-r--r--date.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/date.h b/date.h
index 8ca64ece2..1b5288599 100644
--- a/date.h
+++ b/date.h
@@ -8,7 +8,28 @@
*/
#define DAY_TICKS 74
+/*
+ * ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR and DAYS_TILL_ORIGINAL_BASE_YEAR are
+ * primarily used for loading newgrf and savegame data and returning some
+ * newgrf (callback) functions that were in the original (TTD) inherited
+ * format, where '_date == 0' meant that it was 1920-01-01.
+ */
+
+/** The minimum starting year/base year of the original TTD */
+#define ORIGINAL_BASE_YEAR 1920
+/** The maximum year of the original TTD */
+#define ORIGINAL_MAX_YEAR 2090
+
+/**
+ * The offset in days from the '_date == 0' till
+ * 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
+ */
+#define DAYS_TILL_ORIGINAL_BASE_YEAR 0
+
+/* Temporary value to make transition to full past 2090 easier/more clear */
#define BASE_YEAR 1920
+
+/* The absolute minimum & maximum years in OTTD */
#define MIN_YEAR 1920
#define MAX_YEAR 2090