equal
deleted
inserted
replaced
82 static inline uint32 GetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) |
82 static inline uint32 GetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) |
83 { |
83 { |
84 /* Return common variables */ |
84 /* Return common variables */ |
85 switch (variable) { |
85 switch (variable) { |
86 case 0x00: return max(_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0); |
86 case 0x00: return max(_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0); |
87 case 0x01: return clamp(_cur_year, ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR) - ORIGINAL_BASE_YEAR; |
87 case 0x01: return Clamp(_cur_year, ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR) - ORIGINAL_BASE_YEAR; |
88 case 0x02: return _cur_month; |
88 case 0x02: return _cur_month; |
89 case 0x03: return _opt.landscape; |
89 case 0x03: return _opt.landscape; |
90 case 0x09: return _date_fract; |
90 case 0x09: return _date_fract; |
91 case 0x0A: return _tick_counter; |
91 case 0x0A: return _tick_counter; |
92 case 0x0C: return object->callback; |
92 case 0x0C: return object->callback; |