summaryrefslogtreecommitdiff
path: root/src/date_type.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/date_type.h')
-rw-r--r--src/date_type.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/date_type.h b/src/date_type.h
index 67122b0b1..53e181239 100644
--- a/src/date_type.h
+++ b/src/date_type.h
@@ -11,7 +11,11 @@
* 1 tick is approximately 30 ms.
* 1 day is thus about 2 seconds (74 * 30 = 2220) on a machine that can run OpenTTD normally
*/
-#define DAY_TICKS 74
+enum {
+ DAY_TICKS = 74, ///< ticks per day
+ DAYS_IN_YEAR = 365, ///< days per year
+ DAYS_IN_LEAP_YEAR = 366, ///< sometimes, you need one day more...
+};
/*
* ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR and DAYS_TILL_ORIGINAL_BASE_YEAR are
@@ -31,7 +35,7 @@
* The offset in days from the '_date == 0' till
* 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
*/
-#define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
+#define DAYS_TILL_ORIGINAL_BASE_YEAR (DAYS_IN_YEAR * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
/* The absolute minimum & maximum years in OTTD */
#define MIN_YEAR 0