date.h
changeset 4326 c2ae4dbc1074
parent 4322 0bee6d9bc452
child 4329 9759d5c52010
equal deleted inserted replaced
4325:6564f3c88b84 4326:c2ae4dbc1074
    22 
    22 
    23 /**
    23 /**
    24  * The offset in days from the '_date == 0' till
    24  * The offset in days from the '_date == 0' till
    25  * 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
    25  * 'ConvertYMDToDate(ORIGINAL_BASE_YEAR, 0, 1)'
    26  */
    26  */
    27 #define DAYS_TILL_ORIGINAL_BASE_YEAR 0
    27 #define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400)
    28 
    28 
    29 /* Temporary value to make transition to full past 2090 easier/more clear */
    29 /* Temporary value to make transition to full past 2090 easier/more clear */
    30 #define BASE_YEAR 1920
    30 #define BASE_YEAR 0
    31 
    31 
    32 /* The absolute minimum & maximum years in OTTD */
    32 /* The absolute minimum & maximum years in OTTD */
    33 #define MIN_YEAR 1920
    33 #define MIN_YEAR 0
    34 #define MAX_YEAR 2090
    34 /* MAX_YEAR, nicely rounded value of the number of years that can
       
    35  * be encoded in a single 32 bits date, about 2^31 / 366 years. */
       
    36 #define MAX_YEAR 5000000
    35 
    37 
    36 /* Year and Date are defined elsewhere */
    38 /* Year and Date are defined elsewhere */
    37 typedef uint8  Month;
    39 typedef uint8  Month;
    38 typedef uint8  Day;
    40 typedef uint8  Day;
    39 typedef uint16 DateFract;
    41 typedef uint16 DateFract;