Add: INR currency (#8136)
[openttd-github.git] / src / misc.cpp
blobdcb04fa026689e210a2e43df091209608b86c9bf
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file misc.cpp Misc functions that shouldn't be here. */
10 #include "stdafx.h"
11 #include "landscape.h"
12 #include "news_func.h"
13 #include "ai/ai.hpp"
14 #include "ai/ai_gui.hpp"
15 #include "newgrf.h"
16 #include "newgrf_house.h"
17 #include "economy_func.h"
18 #include "date_func.h"
19 #include "texteff.hpp"
20 #include "gfx_func.h"
21 #include "gamelog.h"
22 #include "animated_tile_func.h"
23 #include "tilehighlight_func.h"
24 #include "network/network_func.h"
25 #include "window_func.h"
26 #include "core/pool_type.hpp"
27 #include "game/game.hpp"
28 #include "linkgraph/linkgraphschedule.h"
29 #include "station_kdtree.h"
30 #include "town_kdtree.h"
31 #include "viewport_kdtree.h"
32 #include "newgrf_profiling.h"
34 #include "safeguards.h"
37 extern TileIndex _cur_tileloop_tile;
38 extern void MakeNewgameSettingsLive();
40 void InitializeSound();
41 void InitializeMusic();
42 void InitializeVehicles();
43 void InitializeRailGui();
44 void InitializeRoadGui();
45 void InitializeAirportGui();
46 void InitializeDockGui();
47 void InitializeGraphGui();
48 void InitializeObjectGui();
49 void InitializeTownGui();
50 void InitializeIndustries();
51 void InitializeObjects();
52 void InitializeTrees();
53 void InitializeCompanies();
54 void InitializeCheats();
55 void InitializeNPF();
56 void InitializeOldNames();
58 void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settings)
60 /* Make sure there isn't any window that can influence anything
61 * related to the new game we're about to start/load. */
62 UnInitWindowSystem();
64 AllocateMap(size_x, size_y);
66 _pause_mode = PM_UNPAUSED;
67 _fast_forward = 0;
68 _tick_counter = 0;
69 _cur_tileloop_tile = 1;
70 _thd.redsq = INVALID_TILE;
71 if (reset_settings) MakeNewgameSettingsLive();
73 _newgrf_profilers.clear();
75 if (reset_date) {
76 SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0);
77 InitializeOldNames();
80 LinkGraphSchedule::Clear();
81 PoolBase::Clean(PT_NORMAL);
83 RebuildStationKdtree();
84 RebuildTownKdtree();
85 RebuildViewportKdtree();
87 ResetPersistentNewGRFData();
89 InitializeSound();
90 InitializeMusic();
92 InitializeVehicles();
94 InitNewsItemStructs();
95 InitializeLandscape();
96 InitializeRailGui();
97 InitializeRoadGui();
98 InitializeAirportGui();
99 InitializeDockGui();
100 InitializeGraphGui();
101 InitializeObjectGui();
102 InitializeTownGui();
103 InitializeAIGui();
104 InitializeTrees();
105 InitializeIndustries();
106 InitializeObjects();
107 InitializeBuildingCounts();
109 InitializeNPF();
111 InitializeCompanies();
112 AI::Initialize();
113 Game::Initialize();
114 InitializeCheats();
116 InitTextEffects();
117 NetworkInitChatMessage();
118 InitializeAnimatedTiles();
120 InitializeEconomy();
122 ResetObjectToPlace();
124 GamelogReset();
125 GamelogStartAction(GLAT_START);
126 GamelogRevision();
127 GamelogMode();
128 GamelogGRFAddList(_grfconfig);
129 GamelogStopAction();