|
@@ -21,93 +21,95 @@
|
|
|
#include "texteff.hpp"
|
|
|
#include "gfx_func.h"
|
|
|
#include "gamelog.h"
|
|
|
#include "animated_tile_func.h"
|
|
|
#include "tilehighlight_func.h"
|
|
|
#include "network/network_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "core/pool_type.hpp"
|
|
|
#include "game/game.hpp"
|
|
|
#include "linkgraph/linkgraphschedule.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
|
|
|
extern TileIndex _cur_tileloop_tile;
|
|
|
extern void MakeNewgameSettingsLive();
|
|
|
|
|
|
void InitializeSound();
|
|
|
void InitializeMusic();
|
|
|
void InitializeVehicles();
|
|
|
void InitializeRailGui();
|
|
|
void InitializeRoadGui();
|
|
|
void InitializeAirportGui();
|
|
|
void InitializeDockGui();
|
|
|
void InitializeGraphGui();
|
|
|
void InitializeObjectGui();
|
|
|
void InitializeIndustries();
|
|
|
void InitializeObjects();
|
|
|
void InitializeTrees();
|
|
|
void InitializeCompanies();
|
|
|
void InitializeCheats();
|
|
|
void InitializeNPF();
|
|
|
void InitializeOldNames();
|
|
|
|
|
|
void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settings)
|
|
|
{
|
|
|
/* Make sure there isn't any window that can influence anything
|
|
|
* related to the new game we're about to start/load. */
|
|
|
UnInitWindowSystem();
|
|
|
|
|
|
AllocateMap(size_x, size_y);
|
|
|
|
|
|
_pause_mode = PM_UNPAUSED;
|
|
|
_fast_forward = 0;
|
|
|
_tick_counter = 0;
|
|
|
_cur_tileloop_tile = 1;
|
|
|
_thd.redsq = INVALID_TILE;
|
|
|
if (reset_settings) MakeNewgameSettingsLive();
|
|
|
|
|
|
if (reset_date) {
|
|
|
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0);
|
|
|
InitializeOldNames();
|
|
|
}
|
|
|
|
|
|
LinkGraphSchedule::Clear();
|
|
|
PoolBase::Clean(PT_NORMAL);
|
|
|
|
|
|
ResetPersistentNewGRFData();
|
|
|
|
|
|
InitializeSound();
|
|
|
InitializeMusic();
|
|
|
|
|
|
InitializeVehicles();
|
|
|
|
|
|
InitNewsItemStructs();
|
|
|
InitializeLandscape();
|
|
|
InitializeRailGui();
|
|
|
InitializeRoadGui();
|
|
|
InitializeAirportGui();
|
|
|
InitializeDockGui();
|
|
|
InitializeGraphGui();
|
|
|
InitializeObjectGui();
|
|
|
InitializeAIGui();
|
|
|
InitializeTrees();
|
|
|
InitializeIndustries();
|
|
|
InitializeObjects();
|
|
|
InitializeBuildingCounts();
|
|
|
|
|
|
InitializeNPF();
|
|
|
|
|
|
InitializeCompanies();
|
|
|
AI::Initialize();
|
|
|
Game::Initialize();
|
|
|
InitializeCheats();
|
|
|
|
|
|
InitTextEffects();
|
|
|
#ifdef ENABLE_NETWORK
|
|
|
NetworkInitChatMessage();
|
|
|
#endif /* ENABLE_NETWORK */
|
|
|
InitializeAnimatedTiles();
|
|
|
|
|
|
InitializeEconomy();
|
|
|
|
|
|
ResetObjectToPlace();
|
|
|
|