Replace day length scaled tick macros with global variables.
This is to avoid needing to expensively re-calculate them all the time. Instead update them by incrementing.
This commit is contained in:
@@ -33,9 +33,6 @@ static const int DAY_TICKS = 74; ///< ticks per day
|
||||
static const int DAYS_IN_YEAR = 365; ///< days per year
|
||||
static const int DAYS_IN_LEAP_YEAR = 366; ///< sometimes, you need one day more...
|
||||
|
||||
#define CURRENT_SCALED_TICKS (((((DateTicksScaled)_date * DAY_TICKS) + _date_fract) * _settings_game.economy.day_length_factor) + _tick_skip_counter)
|
||||
#define SCALED_TICK_COUNTER ((((uint32)_tick_counter) * _settings_game.economy.day_length_factor) + _tick_skip_counter)
|
||||
|
||||
#define DATE_UNIT_SIZE (_settings_client.gui.time_in_minutes ? _settings_client.gui.ticks_per_minute : (DAY_TICKS * _settings_game.economy.day_length_factor))
|
||||
|
||||
static const int STATION_RATING_TICKS = 185; ///< cycle duration for updating station rating
|
||||
@@ -115,7 +112,7 @@ static const Year MAX_YEAR = 5000000;
|
||||
#define MINUTES_DATE(day, hour, minute) ((day * 1440) + (hour * 60) + minute)
|
||||
|
||||
/** Get the current date in minutes */
|
||||
#define CURRENT_MINUTE (CURRENT_SCALED_TICKS / _settings_client.gui.ticks_per_minute)
|
||||
#define CURRENT_MINUTE (_scaled_date_ticks / _settings_client.gui.ticks_per_minute)
|
||||
|
||||
/**
|
||||
* Data structure to convert between Date and triplet (year, month, and day).
|
||||
|
Reference in New Issue
Block a user