Files @ r16729:482bfc615285
Branch filter:

Location: cpp/openttd-patchpack/source/src/misc.cpp - annotation

rubidium
(svn r21472) -Fix [FS#4298] (r21459-ish): make sure the query window is only opened once per parent window / callback.
r5584:545d748cc681
r5584:545d748cc681
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r12768:980ae0491352
r9111:983de9c5a848
r6201:2e76eb9a1d7a
r5584:545d748cc681
r6453:b0b56773284a
r8763:c2c776621d56
r10696:8dfe83e30d01
r14825:a1801b3f007f
r6332:7393965b5322
r6643:fa000ce7441e
r8119:8fdb3a371896
r8140:9424f012f6a2
r8144:1432edd15267
r8224:194097dc7288
r9457:ecfeb802c57a
r9005:e59c0b10c56a
r9127:933c13888121
r9898:bbef3303e005
r10911:571c959dc9ed
r8224:194097dc7288
r5584:545d748cc681
r8973:bd926d7578a7
r10696:8dfe83e30d01
r5584:545d748cc681
r12674:8254ab83ecad
r14055:e4168a875df8
r6247:96e840dbefcc
r6247:96e840dbefcc
r10127:f89df6b20b16
r6247:96e840dbefcc
r15847:4a3cf48b2f40
r6247:96e840dbefcc
r6247:96e840dbefcc
r6247:96e840dbefcc
r6247:96e840dbefcc
r6247:96e840dbefcc
r15972:6463015373ad
r6247:96e840dbefcc
r15797:444e01a3fa29
r6247:96e840dbefcc
r12287:e460d5b47431
r6247:96e840dbefcc
r6247:96e840dbefcc
r6247:96e840dbefcc
r12215:7e5ec1b6625d
r7010:fd8e3ec6f727
r10207:a1fc2f2a33db
r8965:16f6e5e9ed36
r6247:96e840dbefcc
r8987:5af9a103757a
r5584:545d748cc681
r12635:3d67c34135d4
r5584:545d748cc681
r10911:571c959dc9ed
r10911:571c959dc9ed
r10911:571c959dc9ed
r10911:571c959dc9ed
r5584:545d748cc681
r5584:545d748cc681
r11847:235c011992a8
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r10816:2ed0dff886de
r12635:3d67c34135d4
r5584:545d748cc681
r15897:d700bcc8403e
r15897:d700bcc8403e
r15897:d700bcc8403e
r15897:d700bcc8403e
r15897:d700bcc8403e
r12674:8254ab83ecad
r14055:e4168a875df8
r12674:8254ab83ecad
r10127:f89df6b20b16
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r15847:4a3cf48b2f40
r6643:fa000ce7441e
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r15972:6463015373ad
r14789:ae5ae13ad9ae
r5584:545d748cc681
r12287:e460d5b47431
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r12215:7e5ec1b6625d
r7010:fd8e3ec6f727
r5584:545d748cc681
r15797:444e01a3fa29
r6332:7393965b5322
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r10207:a1fc2f2a33db
r10696:8dfe83e30d01
r5584:545d748cc681
r5584:545d748cc681
r5584:545d748cc681
r9898:bbef3303e005
r9898:bbef3303e005
r9898:bbef3303e005
r5584:545d748cc681
r5584:545d748cc681
r12930:ae0ddab1903d
r5584:545d748cc681
r5584:545d748cc681
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r9457:ecfeb802c57a
r5584:545d748cc681
/* $Id$ */

/*
 * This file is part of OpenTTD.
 * 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.
 * 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.
 * 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/>.
 */

/** @file misc.cpp Misc functions that shouldn't be here. */

#include "stdafx.h"
#include "landscape.h"
#include "news_func.h"
#include "ai/ai.hpp"
#include "ai/ai_gui.hpp"
#include "newgrf_house.h"
#include "group.h"
#include "economy_func.h"
#include "date_func.h"
#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"


extern TileIndex _cur_tileloop_tile;
extern void MakeNewgameSettingsLive();

void InitializeSound();
void InitializeMusic();
void InitializeVehicles();
void InitializeDepots();
void InitializeEngineRenews();
void InitializeOrders();
void InitializeOrderBackups();
void InitializeClearLand();
void InitializeRailGui();
void InitializeRoadGui();
void InitializeAirportGui();
void InitializeDockGui();
void InitializeObjectGui();
void InitializeIndustries();
void InitializeObjects();
void InitializeTowns();
void InitializeSubsidies();
void InitializeTrees();
void InitializeSigns();
void InitializeStations();
void InitializeRoadStops();
void InitializeCargoPackets();
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 = 0;
	_thd.redsq = INVALID_TILE;
	if (reset_settings) MakeNewgameSettingsLive();

	if (reset_date) {
		SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0);
		InitializeOldNames();
	}

	InitializeSound();
	InitializeMusic();

	InitializeEngineRenews();
	InitializeVehicles();
	InitializeDepots();
	InitializeOrders();
	InitializeOrderBackups();
	InitializeGroup();

	InitNewsItemStructs();
	InitializeLandscape();
	InitializeClearLand();
	InitializeRailGui();
	InitializeRoadGui();
	InitializeAirportGui();
	InitializeDockGui();
	InitializeObjectGui();
	InitializeAIGui();
	InitializeTowns();
	InitializeSubsidies();
	InitializeTrees();
	InitializeSigns();
	InitializeStations();
	InitializeRoadStops();
	InitializeCargoPackets();
	InitializeIndustries();
	InitializeObjects();
	InitializeBuildingCounts();

	InitializeNPF();

	InitializeCompanies();
	AI::Initialize();
	InitializeCheats();

	InitTextEffects();
#ifdef ENABLE_NETWORK
	NetworkInitChatMessage();
#endif /* ENABLE_NETWORK */
	InitializeAnimatedTiles();

	InitializeEconomy();

	ResetObjectToPlace();

	GamelogReset();
	GamelogStartAction(GLAT_START);
	GamelogRevision();
	GamelogMode();
	GamelogGRFAddList(_grfconfig);
	GamelogStopAction();
}