equal
deleted
inserted
replaced
23 #include "date_func.h" |
23 #include "date_func.h" |
24 #include "vehicle_func.h" |
24 #include "vehicle_func.h" |
25 #include "texteff.hpp" |
25 #include "texteff.hpp" |
26 #include "gfx_func.h" |
26 #include "gfx_func.h" |
27 #include "core/alloc_type.hpp" |
27 #include "core/alloc_type.hpp" |
|
28 #include "gamelog.h" |
28 #include "animated_tile_func.h" |
29 #include "animated_tile_func.h" |
29 #include "tilehighlight_func.h" |
30 #include "tilehighlight_func.h" |
30 #include "core/bitmath_func.hpp" |
31 #include "core/bitmath_func.hpp" |
31 |
32 |
32 #include "table/strings.h" |
33 #include "table/strings.h" |
53 void InitializePlayers(); |
54 void InitializePlayers(); |
54 void InitializeCheats(); |
55 void InitializeCheats(); |
55 void InitializeNPF(); |
56 void InitializeNPF(); |
56 void InitializeOldNames(); |
57 void InitializeOldNames(); |
57 |
58 |
58 void InitializeGame(int mode, uint size_x, uint size_y) |
59 void InitializeGame(uint size_x, uint size_y, bool reset_date) |
59 { |
60 { |
60 AllocateMap(size_x, size_y); |
61 AllocateMap(size_x, size_y); |
61 |
62 |
62 SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0); |
63 SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0); |
63 |
64 |
65 _fast_forward = 0; |
66 _fast_forward = 0; |
66 _tick_counter = 0; |
67 _tick_counter = 0; |
67 _realtime_tick = 0; |
68 _realtime_tick = 0; |
68 _date_fract = 0; |
69 _date_fract = 0; |
69 _cur_tileloop_tile = 0; |
70 _cur_tileloop_tile = 0; |
70 _settings = _settings_newgame; |
71 _settings_game = _settings_newgame; |
71 |
72 |
72 if ((mode & IG_DATE_RESET) == IG_DATE_RESET) { |
73 if (reset_date) { |
73 SetDate(ConvertYMDToDate(_settings.game_creation.starting_year, 0, 1)); |
74 SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1)); |
74 InitializeOldNames(); |
75 InitializeOldNames(); |
75 } |
76 } |
76 |
77 |
77 InitializeEngines(); |
78 InitializeEngines(); |
78 InitializeVehicles(); |
79 InitializeVehicles(); |
108 InitializeAnimatedTiles(); |
109 InitializeAnimatedTiles(); |
109 |
110 |
110 InitializeLandscapeVariables(false); |
111 InitializeLandscapeVariables(false); |
111 |
112 |
112 ResetObjectToPlace(); |
113 ResetObjectToPlace(); |
|
114 |
|
115 GamelogReset(); |
|
116 GamelogStartAction(GLAT_START); |
|
117 GamelogRevision(); |
|
118 GamelogMode(); |
|
119 GamelogGRFAddList(_grfconfig); |
|
120 GamelogStopAction(); |
113 } |
121 } |
114 |
122 |
115 |
123 |
116 /* Calculate constants that depend on the landscape type. */ |
124 /* Calculate constants that depend on the landscape type. */ |
117 void InitializeLandscapeVariables(bool only_constants) |
125 void InitializeLandscapeVariables(bool only_constants) |