Codechange: Move calendar date functions inside TimerGameCalendar (#10753)

This commit is contained in:
Tyler Trahan
2023-05-04 09:14:12 -04:00
committed by GitHub
parent 7669aac865
commit 6501f84b4a
43 changed files with 224 additions and 281 deletions

View File

@@ -22,7 +22,6 @@
#include "../clear_map.h"
#include "../vehicle_func.h"
#include "../string_func.h"
#include "../date_func.h"
#include "../roadveh.h"
#include "../roadveh_cmd.h"
#include "../train.h"
@@ -59,6 +58,7 @@
#include "../ship.h"
#include "../water.h"
#include "../timer/timer.h"
#include "../timer/timer_game_calendar.h"
#include "../timer/timer_game_tick.h"
#include "saveload_internal.h"

View File

@@ -12,7 +12,6 @@
#include "saveload.h"
#include "compat/misc_sl_compat.h"
#include "../date_func.h"
#include "../timer/timer_game_calendar.h"
#include "../zoom_func.h"
#include "../window_gui.h"
@@ -21,6 +20,7 @@
#include "../gfx_func.h"
#include "../core/random_func.hpp"
#include "../fios.h"
#include "../date_type.h"
#include "../timer/timer.h"
#include "../timer/timer_game_tick.h"

View File

@@ -20,7 +20,7 @@
#include "../subsidy_base.h"
#include "../debug.h"
#include "../depot_base.h"
#include "../date_func.h"
#include "../timer/timer_game_calendar.h"
#include "../timer/timer_game_calendar.h"
#include "../vehicle_func.h"
#include "../effectvehicle_base.h"
@@ -400,7 +400,7 @@ static bool FixTTOEngines()
for (uint i = 0; i < lengthof(_orig_aircraft_vehicle_info); i++, j++) new (GetTempDataEngine(j)) Engine(VEH_AIRCRAFT, i);
}
TimerGameCalendar::Date aging_date = std::min(TimerGameCalendar::date + DAYS_TILL_ORIGINAL_BASE_YEAR, ConvertYMDToDate(2050, 0, 1));
TimerGameCalendar::Date aging_date = std::min(TimerGameCalendar::date + DAYS_TILL_ORIGINAL_BASE_YEAR, TimerGameCalendar::ConvertYMDToDate(2050, 0, 1));
for (EngineID i = 0; i < 256; i++) {
int oi = ttd_to_tto[i];
@@ -847,8 +847,8 @@ static bool LoadOldIndustry(LoadgameState *ls, int num)
if (i->type > 0x06) i->type++; // Printing Works were added
if (i->type == 0x0A) i->type = 0x12; // Iron Ore Mine has different ID
YearMonthDay ymd;
ConvertDateToYMD(TimerGameCalendar::date, &ymd);
TimerGameCalendar::YearMonthDay ymd;
TimerGameCalendar::ConvertDateToYMD(TimerGameCalendar::date, &ymd);
i->last_prod_year = ymd.year;
i->random_colour = RemapTTOColour(i->random_colour);

View File

@@ -31,7 +31,7 @@
#include "../core/endian_func.hpp"
#include "../vehicle_base.h"
#include "../company_func.h"
#include "../date_func.h"
#include "../timer/timer_game_calendar.h"
#include "../autoreplace_base.h"
#include "../roadstop_base.h"
#include "../linkgraph/linkgraph.h"