Changeset - r26832:a6bd9039c80b
src/ai/ai_instance.cpp
Show inline comments
 
@@ -77,13 +77,12 @@ void AIInstance::Died()
 
	}
 
}
 

	
 
void AIInstance::LoadDummyScript()
 
{
 
	ScriptAllocatorScope alloc_scope(this->engine);
 
	extern void Script_CreateDummy(HSQUIRRELVM vm, StringID string, const char *type);
 
	Script_CreateDummy(this->engine->GetVM(), STR_ERROR_AI_NO_AI_FOUND, "AI");
 
}
 

	
 
int AIInstance::GetSetting(const char *name)
 
{
 
	return AIConfig::GetConfig(_current_company)->GetSetting(name);
src/ai/ai_scanner.cpp
Show inline comments
 
@@ -32,13 +32,12 @@ void AIScannerInfo::Initialize()
 
	ScriptScanner::Initialize("AIScanner");
 

	
 
	ScriptAllocatorScope alloc_scope(this->engine);
 

	
 
	/* Create the dummy AI */
 
	this->main_script = "%_dummy";
 
	extern void Script_CreateDummyInfo(HSQUIRRELVM vm, const char *type, const char *dir);
 
	Script_CreateDummyInfo(this->engine->GetVM(), "AI", "ai");
 
}
 

	
 
void AIScannerInfo::SetDummyAI(class AIInfo *info)
 
{
 
	this->info_dummy = info;
src/aircraft.h
Show inline comments
 
@@ -136,8 +136,9 @@ struct Aircraft FINAL : public Specializ
 
	}
 
};
 

	
 
void GetRotorImage(const Aircraft *v, EngineImageType image_type, VehicleSpriteSeq *result);
 

	
 
Station *GetTargetAirportIfValid(const Aircraft *v);
 
void HandleMissingAircraftOrders(Aircraft *v);
 

	
 
#endif /* AIRCRAFT_H */
src/base_media_func.h
Show inline comments
 
@@ -12,12 +12,14 @@
 

	
 
#include "base_media_base.h"
 
#include "debug.h"
 
#include "ini_type.h"
 
#include "string_func.h"
 

	
 
extern void CheckExternalFiles();
 

	
 
/**
 
 * Try to read a single piece of metadata and return false if it doesn't exist.
 
 * @param name the name of the item to fetch.
 
 */
 
#define fetch_metadata(name) \
 
	item = metadata->GetItem(name, false); \
 
@@ -224,14 +226,12 @@ bool BaseMedia<Tbase_set>::AddFile(const
 
 * @param name of the set to use
 
 * @return true if it could be loaded
 
 */
 
template <class Tbase_set>
 
/* static */ bool BaseMedia<Tbase_set>::SetSet(const std::string &name)
 
{
 
	extern void CheckExternalFiles();
 

	
 
	if (name.empty()) {
 
		if (!BaseMedia<Tbase_set>::DetermineBestSet()) return false;
 
		CheckExternalFiles();
 
		return true;
 
	}
 

	
src/company_cmd.cpp
Show inline comments
 
@@ -39,12 +39,13 @@
 

	
 
#include "table/strings.h"
 

	
 
#include "safeguards.h"
 

	
 
void ClearEnginesHiddenFlagOfCompany(CompanyID cid);
 
void UpdateObjectColours(const Company *c);
 

	
 
CompanyID _local_company;   ///< Company controlled by the human player at this client. Can also be #COMPANY_SPECTATOR.
 
CompanyID _current_company; ///< Company currently doing an action.
 
Colours _company_colours[MAX_COMPANIES];  ///< NOSAVE: can be determined from company structs.
 
CompanyManagerFace _company_manager_face; ///< for company manager face storage in openttd.cfg
 
uint _next_competitor_start;              ///< the number of ticks before the next AI is started
 
@@ -1026,13 +1027,12 @@ CommandCost CmdSetCompanyColour(DoComman
 

	
 
		/* Company colour data is indirectly cached. */
 
		for (Vehicle *v : Vehicle::Iterate()) {
 
			if (v->owner == _current_company) v->InvalidateNewGRFCache();
 
		}
 

	
 
		extern void UpdateObjectColours(const Company *c);
 
		UpdateObjectColours(c);
 
	}
 
	return CommandCost();
 
}
 

	
 
/**
src/console_cmds.cpp
Show inline comments
 
@@ -1066,12 +1066,15 @@ DEF_CONSOLE_CMD(ConReturn)
 
}
 

	
 
/*****************************
 
 *  default console commands
 
 ******************************/
 
extern bool CloseConsoleLogIfActive();
 
extern const std::vector<GRFFile *> &GetAllGRFFiles();
 
extern void ConPrintFramerate(); // framerate_gui.cpp
 
extern void ShowFramerateWindow();
 

	
 
DEF_CONSOLE_CMD(ConScript)
 
{
 
	extern FILE *_iconsole_output_file;
 

	
 
	if (argc == 0) {
 
@@ -2210,13 +2213,12 @@ DEF_CONSOLE_CMD(ConNewGRFProfile)
 
		IConsolePrint(CC_HELP, "  End profiling and write the collected data to CSV files.");
 
		IConsolePrint(CC_HELP, "Usage: 'newgrf_profile abort':");
 
		IConsolePrint(CC_HELP, "  End profiling and discard all collected data.");
 
		return true;
 
	}
 

	
 
	extern const std::vector<GRFFile *> &GetAllGRFFiles();
 
	const std::vector<GRFFile *> &files = GetAllGRFFiles();
 

	
 
	/* "list" sub-command */
 
	if (argc == 1 || strncasecmp(argv[1], "lis", 3) == 0) {
 
		IConsolePrint(CC_INFO, "Loaded GRF files:");
 
		int i = 1;
 
@@ -2335,27 +2337,23 @@ static void IConsoleDebugLibRegister()
 
	IConsole::AliasRegister("dbg_echo2",      "echo %!");
 
}
 
#endif
 

	
 
DEF_CONSOLE_CMD(ConFramerate)
 
{
 
	extern void ConPrintFramerate(); // framerate_gui.cpp
 

	
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "Show frame rate and game speed information.");
 
		return true;
 
	}
 

	
 
	ConPrintFramerate();
 
	return true;
 
}
 

	
 
DEF_CONSOLE_CMD(ConFramerateWindow)
 
{
 
	extern void ShowFramerateWindow();
 

	
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "Open the frame rate window.");
 
		return true;
 
	}
 

	
 
	if (_network_dedicated) {
src/core/pool_func.hpp
Show inline comments
 
@@ -11,12 +11,14 @@
 
#define POOL_FUNC_HPP
 

	
 
#include "alloc_func.hpp"
 
#include "mem_func.hpp"
 
#include "pool_type.hpp"
 

	
 
extern void NORETURN SlErrorCorruptFmt(const char *format, ...) WARN_FORMAT(1, 2);
 

	
 
/**
 
 * Helper for defining the method's signature.
 
 * @param type The return type of the method.
 
 */
 
#define DEFINE_POOL_METHOD(type) \
 
	template <class Titem, typename Tindex, size_t Tgrowth_step, size_t Tmax_size, PoolType Tpool_type, bool Tcache, bool Tzero> \
 
@@ -151,14 +153,12 @@ DEFINE_POOL_METHOD(void *)::GetNew(size_
 
 * @param index index of item
 
 * @return pointer to allocated item
 
 * @note SlErrorCorruptFmt() on failure! (index out of range or already used)
 
 */
 
DEFINE_POOL_METHOD(void *)::GetNew(size_t size, size_t index)
 
{
 
	extern void NORETURN SlErrorCorruptFmt(const char *format, ...);
 

	
 
	if (index >= Tmax_size) {
 
		SlErrorCorruptFmt("%s index " PRINTF_SIZE " out of range (" PRINTF_SIZE ")", this->name, index, Tmax_size);
 
	}
 

	
 
	if (index >= this->size) this->ResizeFor(index);
 

	
src/depot_func.h
Show inline comments
 
@@ -11,12 +11,13 @@
 
#define DEPOT_FUNC_H
 

	
 
#include "vehicle_type.h"
 
#include "slope_func.h"
 

	
 
void ShowDepotWindow(TileIndex tile, VehicleType type);
 
void InitDepotWindowBlockSizes();
 

	
 
void DeleteDepotHighlightOfVehicle(const Vehicle *v);
 

	
 
/**
 
 * Find out if the slope of the tile is suitable to build a depot of given direction
 
 * @param direction The direction in which the depot's exit points
src/error.h
Show inline comments
 
@@ -7,12 +7,13 @@
 

	
 
/** @file error.h Functions related to errors. */
 

	
 
#ifndef ERROR_H
 
#define ERROR_H
 

	
 
#include <list>
 
#include "strings_type.h"
 
#include "company_type.h"
 
#include "core/geometry_type.hpp"
 
#include "guitimer_func.h"
 

	
 
struct GRFFile;
 
@@ -54,12 +55,16 @@ public:
 
	void SetDParamStr(uint n, const char *str);
 
	void SetDParamStr(uint n, const std::string &str);
 

	
 
	void CopyOutDParams();
 
};
 

	
 
/** Define a queue with errors. */
 
typedef std::list<ErrorMessageData> ErrorList;
 

	
 
void ScheduleErrorMessage(ErrorList &datas);
 
void ScheduleErrorMessage(const ErrorMessageData &data);
 

	
 
void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x = 0, int y = 0, const GRFFile *textref_stack_grffile = nullptr, uint textref_stack_size = 0, const uint32 *textref_stack = nullptr);
 
bool HideActiveErrorMessage();
 

	
 
void ClearErrorMessages();
src/error_gui.cpp
Show inline comments
 
@@ -171,16 +171,14 @@ void ErrorMessageData::SetDParamStr(uint
 
 */
 
void ErrorMessageData::SetDParamStr(uint n, const std::string &str)
 
{
 
	this->SetDParamStr(n, str.c_str());
 
}
 

	
 
/** Define a queue with errors. */
 
typedef std::list<ErrorMessageData> ErrorList;
 
/** The actual queue with errors. */
 
ErrorList _error_list;
 
static ErrorList _error_list;
 
/** Whether the window system is initialized or not. */
 
bool _window_system_initialized = false;
 

	
 
/** Window class for displaying an error message window. */
 
struct ErrmsgWindow : public Window, ErrorMessageData {
 
private:
src/fileio.cpp
Show inline comments
 
@@ -66,12 +66,14 @@ std::vector<Searchpath> _valid_searchpat
 
std::array<TarList, NUM_SUBDIRS> _tar_list;
 
TarFileList _tar_filelist[NUM_SUBDIRS];
 

	
 
typedef std::map<std::string, std::string> TarLinkList;
 
static TarLinkList _tar_linklist[NUM_SUBDIRS]; ///< List of directory links
 

	
 
extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
 

	
 
/**
 
 * Checks whether the given search path is a valid search path
 
 * @param sp the search path to check
 
 * @return true if the search path is valid
 
 */
 
static bool IsValidSearchPath(Searchpath sp)
 
@@ -1151,14 +1153,12 @@ static bool MatchesExtension(const char 
 
 * @param path            full path we're currently at
 
 * @param basepath_length from where in the path are we 'based' on the search path
 
 * @param recursive       whether to recursively search the sub directories
 
 */
 
static uint ScanPath(FileScanner *fs, const char *extension, const char *path, size_t basepath_length, bool recursive)
 
{
 
	extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
 

	
 
	uint num = 0;
 
	struct stat sb;
 
	struct dirent *dirent;
 
	DIR *dir;
 

	
 
	if (path == nullptr || (dir = ttd_opendir(path)) == nullptr) return 0;
src/fios.h
Show inline comments
 
@@ -122,12 +122,15 @@ StringID FiosGetDescText(const char **pa
 
bool FiosDelete(const char *name);
 
std::string FiosMakeHeightmapName(const char *name);
 
std::string FiosMakeSavegameName(const char *name);
 

	
 
FiosType FiosGetSavegameListCallback(SaveLoadOperation fop, const std::string &file, const char *ext, char *title, const char *last);
 

	
 
void ScanScenarios();
 
const char *FindScenario(const ContentInfo *ci, bool md5sum);
 

	
 
/**
 
 * A savegame name automatically numbered.
 
 */
 
struct FiosNumberedSaveName {
 
	FiosNumberedSaveName(const std::string &prefix);
 
	std::string Filename();
src/fontcache.cpp
Show inline comments
 
@@ -118,12 +118,21 @@ void SetFont(FontSize fontsize, const st
 
	UpdateAllVirtCoords();
 
	ReInitAllWindows(true);
 

	
 
	if (_save_config) SaveToConfig();
 
}
 

	
 
#ifdef WITH_FREETYPE
 
extern void LoadFreeTypeFont(FontSize fs);
 
extern void UninitFreeType();
 
#elif defined(_WIN32)
 
extern void LoadWin32Font(FontSize fs);
 
#elif defined(WITH_COCOA)
 
extern void LoadCoreTextFont(FontSize fs);
 
#endif
 

	
 
/**
 
 * (Re)initialize the font cache related things, i.e. load the non-sprite fonts.
 
 * @param monospace Whether to initialise the monospace or regular fonts.
 
 */
 
void InitFontCache(bool monospace)
 
{
 
@@ -131,19 +140,16 @@ void InitFontCache(bool monospace)
 
		if (monospace != (fs == FS_MONO)) continue;
 

	
 
		FontCache *fc = FontCache::Get(fs);
 
		if (fc->HasParent()) delete fc;
 

	
 
#ifdef WITH_FREETYPE
 
		extern void LoadFreeTypeFont(FontSize fs);
 
		LoadFreeTypeFont(fs);
 
#elif defined(_WIN32)
 
		extern void LoadWin32Font(FontSize fs);
 
		LoadWin32Font(fs);
 
#elif defined(WITH_COCOA)
 
		extern void LoadCoreTextFont(FontSize fs);
 
		LoadCoreTextFont(fs);
 
#endif
 
	}
 
}
 

	
 
/**
 
@@ -154,13 +160,12 @@ void UninitFontCache()
 
	for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
 
		FontCache *fc = FontCache::Get(fs);
 
		if (fc->HasParent()) delete fc;
 
	}
 

	
 
#ifdef WITH_FREETYPE
 
	extern void UninitFreeType();
 
	UninitFreeType();
 
#endif /* WITH_FREETYPE */
 
}
 

	
 
/**
 
 * Should any of the active fonts be anti-aliased?
src/framerate_type.h
Show inline comments
 
@@ -118,8 +118,9 @@ public:
 
	PerformanceAccumulator(PerformanceElement elem);
 
	~PerformanceAccumulator();
 
	static void Reset(PerformanceElement elem);
 
};
 

	
 
void ShowFramerateWindow();
 
void ProcessPendingPerformanceMeasurements();
 

	
 
#endif /* FRAMERATE_TYPE_H */
src/industry_gui.cpp
Show inline comments
 
@@ -68,12 +68,13 @@ enum CargoSuffixDisplay {
 
/** Transfer storage of cargo suffix information. */
 
struct CargoSuffix {
 
	CargoSuffixDisplay display; ///< How to display the cargo and text.
 
	char text[512];             ///< Cargo suffix text.
 
};
 

	
 
extern void GenerateIndustries();
 
static void ShowIndustryCargoesWindow(IndustryType id);
 

	
 
/**
 
 * Gets the string to display after the cargo name (using callback 37)
 
 * @param cargo the cargo for which the suffix is requested, meaning depends on presence of flag 18 in prop 1A
 
 * @param cst the cargo suffix type (for which window is it requested). @see CargoSuffixType
 
@@ -595,13 +596,12 @@ public:
 
	{
 
		if (!confirmed) return;
 

	
 
		if (Town::GetNumItems() == 0) {
 
			ShowErrorMessage(STR_ERROR_CAN_T_GENERATE_INDUSTRIES, STR_ERROR_MUST_FOUND_TOWN_FIRST, WL_INFO);
 
		} else {
 
			extern void GenerateIndustries();
 
			Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
 
			BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
 
			GenerateIndustries();
 
			BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
 
			old_generating_world.Restore();
 
		}
src/network/core/tcp_content.cpp
Show inline comments
 
@@ -82,13 +82,12 @@ const char *ContentInfo::GetTextfile(Tex
 
			break;
 
		case CONTENT_TYPE_BASE_MUSIC:
 
			tmp = TryGetBaseSetFile(this, true, BaseMusic::GetAvailableSets());
 
			break;
 
		case CONTENT_TYPE_SCENARIO:
 
		case CONTENT_TYPE_HEIGHTMAP:
 
			extern const char *FindScenario(const ContentInfo *ci, bool md5sum);
 
			tmp = FindScenario(this, true);
 
			break;
 
	}
 
	if (tmp == nullptr) return nullptr;
 
	return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
 
}
src/network/core/tcp_game.cpp
Show inline comments
 
@@ -39,13 +39,12 @@ NetworkGameSocketHandler::NetworkGameSoc
 
 * @return the new status
 
 */
 
NetworkRecvStatus NetworkGameSocketHandler::CloseConnection(bool error)
 
{
 
	/* Clients drop back to the main menu */
 
	if (!_network_server && _networking) {
 
		extern void ClientNetworkEmergencySave(); // from network_client.cpp
 
		ClientNetworkEmergencySave();
 
		_switch_mode = SM_MENU;
 
		_networking = false;
 
		ShowErrorMessage(STR_NETWORK_ERROR_LOSTCONNECTION, INVALID_STRING_ID, WL_CRITICAL);
 

	
 
		return this->CloseConnection(NETWORK_RECV_STATUS_CLIENT_QUIT);
src/network/network.cpp
Show inline comments
 
@@ -82,15 +82,12 @@ CompanyMask _network_company_passworded;
 

	
 
static_assert((int)NETWORK_COMPANY_NAME_LENGTH == MAX_LENGTH_COMPANY_NAME_CHARS * MAX_CHAR_LENGTH);
 

	
 
/** The amount of clients connected */
 
byte _network_clients_connected = 0;
 

	
 
/* Some externs / forwards */
 
extern void StateGameLoop();
 

	
 
/**
 
 * Return whether there is any client connected or trying to connect at all.
 
 * @return whether we have any client activity
 
 */
 
bool HasClients()
 
{
src/network/network_client.cpp
Show inline comments
 
@@ -261,13 +261,12 @@ void ClientNetworkGameSocketHandler::Cli
 
/* static */ bool ClientNetworkGameSocketHandler::GameLoop()
 
{
 
	_frame_counter++;
 

	
 
	NetworkExecuteLocalCommandQueue();
 

	
 
	extern void StateGameLoop();
 
	StateGameLoop();
 

	
 
	/* Check if we are in sync! */
 
	if (_sync_frame != 0) {
 
		if (_sync_frame == _frame_counter) {
 
#ifdef NETWORK_SEND_DOUBLE_SEED
src/network/network_content_gui.cpp
Show inline comments
 
@@ -18,12 +18,13 @@
 
#include "../openttd.h"
 
#include "../sortlist_type.h"
 
#include "../stringfilter_type.h"
 
#include "../querystring_gui.h"
 
#include "../core/geometry_func.hpp"
 
#include "../textfile_gui.h"
 
#include "../fios.h"
 
#include "network_content_gui.h"
 

	
 

	
 
#include "table/strings.h"
 
#include "../table/sprites.h"
 

	
 
@@ -260,13 +261,12 @@ public:
 
				case CONTENT_TYPE_NEWGRF:
 
					RequestNewGRFScan();
 
					break;
 

	
 
				case CONTENT_TYPE_SCENARIO:
 
				case CONTENT_TYPE_HEIGHTMAP:
 
					extern void ScanScenarios();
 
					ScanScenarios();
 
					InvalidateWindowData(WC_SAVELOAD, 0, 0);
 
					break;
 

	
 
				default:
 
					break;
 
@@ -341,14 +341,12 @@ class NetworkContentListWindow : public 
 

	
 
	static char content_type_strs[CONTENT_TYPE_END][64]; ///< Cached strings for all content types.
 

	
 
	/** Search external websites for content */
 
	void OpenExternalSearch()
 
	{
 
		extern void OpenBrowser(const char *url);
 

	
 
		char url[1024];
 
		const char *last = lastof(url);
 

	
 
		char *pos = strecpy(url, "https://grfsearch.openttd.org/?", last);
 

	
 
		if (this->auto_select) {
 
@@ -851,13 +849,12 @@ public:
 
			case WID_NCL_CANCEL:
 
				this->Close();
 
				break;
 

	
 
			case WID_NCL_OPEN_URL:
 
				if (this->selected != nullptr) {
 
					extern void OpenBrowser(const char *url);
 
					OpenBrowser(this->selected->url.c_str());
 
				}
 
				break;
 

	
 
			case WID_NCL_DOWNLOAD:
 
				if (BringWindowToFrontById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD) == nullptr) new NetworkContentDownloadStatusWindow();
src/network/network_func.h
Show inline comments
 
@@ -82,12 +82,13 @@ void NetworkServerSendExternalChat(const
 

	
 
void NetworkServerKickClient(ClientID client_id, const std::string &reason);
 
uint NetworkServerKickOrBanIP(ClientID client_id, bool ban, const std::string &reason);
 
uint NetworkServerKickOrBanIP(const std::string &ip, bool ban, const std::string &reason);
 

	
 
void NetworkInitChatMessage();
 
void NetworkReInitChatBoxSize();
 
void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message);
 
void NetworkUndrawChatMessage();
 
void NetworkChatMessageLoop();
 

	
 
void NetworkAfterNewGRFScan();
 

	
src/network/network_internal.h
Show inline comments
 
@@ -135,7 +135,9 @@ bool NetworkMakeClientNameUnique(std::st
 
std::string GenerateCompanyPasswordHash(const std::string &password, const std::string &password_server_id, uint32 password_game_seed);
 

	
 
std::string_view ParseCompanyFromConnectionString(const std::string &connection_string, CompanyID *company_id);
 
NetworkAddress ParseConnectionString(const std::string &connection_string, uint16 default_port);
 
std::string NormalizeConnectionString(const std::string &connection_string, uint16 default_port);
 

	
 
void ClientNetworkEmergencySave();
 

	
 
#endif /* NETWORK_INTERNAL_H */
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -20,12 +20,13 @@
 
#include "table/strings.h"
 
#include "table/airporttiles.h"
 
#include "newgrf_animation_base.h"
 

	
 
#include "safeguards.h"
 

	
 
extern uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile);
 

	
 
AirportTileSpec AirportTileSpec::tiles[NUM_AIRPORTTILES];
 

	
 
AirportTileOverrideManager _airporttile_mngr(NEW_AIRPORTTILE_OFFSET, NUM_AIRPORTTILES, INVALID_AIRPORTTILE);
 

	
 
/**
 
@@ -159,14 +160,12 @@ static uint32 GetAirportTileIDAtOffset(T
 
}
 

	
 
/* virtual */ uint32 AirportTileScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const
 
{
 
	assert(this->st != nullptr);
 

	
 
	extern uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile);
 

	
 
	switch (variable) {
 
		/* Terrain type */
 
		case 0x41: return GetTerrainType(this->tile);
 

	
 
		/* Current town zone of the tile in the nearest town */
 
		case 0x42: return GetTownRadiusGroup(ClosestTownFromTile(this->tile, UINT_MAX), this->tile);
src/newgrf_airporttiles.h
Show inline comments
 
@@ -79,13 +79,12 @@ struct AirportTileSpec {
 
private:
 
	static AirportTileSpec tiles[NUM_AIRPORTTILES];
 

	
 
	friend void AirportTileOverrideManager::SetEntitySpec(const AirportTileSpec *airpts);
 
};
 

	
 
StationGfx GetTranslatedAirportTileID(StationGfx gfx);
 
void AnimateAirportTile(TileIndex tile);
 
void AirportTileAnimationTrigger(Station *st, TileIndex tile, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
 
void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
 
bool DrawNewAirportTile(TileInfo *ti, Station *st, StationGfx gfx, const AirportTileSpec *airts);
 

	
 
#endif /* NEWGRF_AIRPORTTILES_H */
src/newgrf_engine.h
Show inline comments
 
@@ -118,7 +118,9 @@ void TriggerVehicle(Vehicle *veh, Vehicl
 

	
 
void AlterVehicleListOrder(EngineID engine, uint target);
 
void CommitVehicleListOrderChanges();
 

	
 
EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id);
 

	
 
void FillNewGRFVehicleCache(const Vehicle *v);
 

	
 
#endif /* NEWGRF_ENGINE_H */
src/newgrf_generic.h
Show inline comments
 
@@ -45,18 +45,18 @@ static const IndustryType IT_AI_UNKNOWN 
 
static const IndustryType IT_AI_TOWN    = 0xFF; ///< The AI actually wants to transport to/from a town, not an industry.
 

	
 
void ResetGenericCallbacks();
 
void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group);
 

	
 
uint16 GetAiPurchaseCallbackResult(uint8 feature, CargoID cargo_type, uint8 default_selection, IndustryType src_industry, IndustryType dst_industry, uint8 distance, AIConstructionEvent event, uint8 count, uint8 station_size, const GRFFile **file);
 
void AmbientSoundEffectCallback(TileIndex tile);
 

	
 
/** Play an ambient sound effect for an empty tile. */
 
static inline void AmbientSoundEffect(TileIndex tile)
 
{
 
	/* Only run callback if enabled. */
 
	if (!HasGrfMiscBit(GMB_AMBIENT_SOUND_CALLBACK)) return;
 

	
 
	extern void AmbientSoundEffectCallback(TileIndex tile);
 
	AmbientSoundEffectCallback(tile);
 
}
 

	
 
#endif /* NEWGRF_GENERIC_H */
src/newgrf_gui.cpp
Show inline comments
 
@@ -947,13 +947,12 @@ struct NewGRFWindow : public Window, New
 
				break;
 
			}
 

	
 
			case WID_NS_OPEN_URL: {
 
				const GRFConfig *c = (this->avail_sel == nullptr) ? this->active_sel : this->avail_sel;
 

	
 
				extern void OpenBrowser(const char *url);
 
				OpenBrowser(c->GetURL());
 
				break;
 
			}
 

	
 
			case WID_NS_PRESET_SAVE:
 
				ShowSavePresetWindow((this->preset == -1) ? nullptr : this->grf_presets[this->preset].c_str());
src/openttd.cpp
Show inline comments
 
@@ -86,13 +86,16 @@ void IncreaseDate();
 
void DoPaletteAnimations();
 
void MusicLoop();
 
void ResetMusic();
 
void CallWindowGameTickEvent();
 
bool HandleBootstrap();
 

	
 
extern void AfterLoadCompanyStats();
 
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
 
extern void OSOpenBrowser(const char *url);
 
extern void RebuildTownCaches();
 
extern void ShowOSErrorBox(const char *buf, bool system);
 
extern std::string _config_file;
 

	
 
bool _save_config = false;
 
bool _request_newgrf_scan = false;
 
NewGRFScanCallback *_request_newgrf_scan_callback = nullptr;
 
@@ -399,13 +402,12 @@ void MakeNewgameSettingsLive()
 

	
 
void OpenBrowser(const char *url)
 
{
 
	/* Make sure we only accept urls that are sure to open a browser. */
 
	if (strstr(url, "http://") != url && strstr(url, "https://") != url) return;
 

	
 
	extern void OSOpenBrowser(const char *url);
 
	OSOpenBrowser(url);
 
}
 

	
 
/** Callback structure of statements to be executed after the NewGRF scan. */
 
struct AfterNewGRFScan : NewGRFScanCallback {
 
	Year startyear = INVALID_YEAR;              ///< The start year.
 
@@ -1158,13 +1160,12 @@ static void CheckCaches()
 
	/* Check the town caches. */
 
	std::vector<TownCache> old_town_caches;
 
	for (const Town *t : Town::Iterate()) {
 
		old_town_caches.push_back(t->cache);
 
	}
 

	
 
	extern void RebuildTownCaches();
 
	RebuildTownCaches();
 
	RebuildSubsidisedSourceAndDestinationCache();
 

	
 
	uint i = 0;
 
	for (Town *t : Town::Iterate()) {
 
		if (MemCmpT(old_town_caches.data() + i, &t->cache) != 0) {
 
@@ -1174,13 +1175,12 @@ static void CheckCaches()
 
	}
 

	
 
	/* Check company infrastructure cache. */
 
	std::vector<CompanyInfrastructure> old_infrastructure;
 
	for (const Company *c : Company::Iterate()) old_infrastructure.push_back(c->infrastructure);
 

	
 
	extern void AfterLoadCompanyStats();
 
	AfterLoadCompanyStats();
 

	
 
	i = 0;
 
	for (const Company *c : Company::Iterate()) {
 
		if (MemCmpT(old_infrastructure.data() + i, &c->infrastructure) != 0) {
 
			Debug(desync, 2, "infrastructure cache mismatch: company {}", c->index);
 
@@ -1195,13 +1195,12 @@ static void CheckCaches()
 
		assert(rs->GetEntry(DIAGDIR_NE) != rs->GetEntry(DIAGDIR_NW));
 
		rs->GetEntry(DIAGDIR_NE)->CheckIntegrity(rs);
 
		rs->GetEntry(DIAGDIR_NW)->CheckIntegrity(rs);
 
	}
 

	
 
	for (Vehicle *v : Vehicle::Iterate()) {
 
		extern void FillNewGRFVehicleCache(const Vehicle *v);
 
		if (v != v->First() || v->vehstatus & VS_CRASHED || !v->IsPrimaryVehicle()) continue;
 

	
 
		uint length = 0;
 
		for (const Vehicle *u = v; u != nullptr; u = u->Next()) length++;
 

	
 
		NewGRFCache        *grf_cache = CallocT<NewGRFCache>(length);
src/openttd.h
Show inline comments
 
@@ -76,13 +76,16 @@ DECLARE_ENUM_AS_BIT_SET(PauseMode)
 
extern PauseMode _pause_mode;
 

	
 
void AskExitGame();
 
void AskExitToGameMenu();
 

	
 
int openttd_main(int argc, char *argv[]);
 
void StateGameLoop();
 
void HandleExitGameRequest();
 

	
 
void SwitchToMode(SwitchMode new_mode);
 

	
 
bool RequestNewGRFScan(struct NewGRFScanCallback *callback = nullptr);
 

	
 
void OpenBrowser(const char *url);
 

	
 
#endif /* OPENTTD_H */
src/order_cmd.cpp
Show inline comments
 
@@ -1993,13 +1993,12 @@ bool UpdateOrderDest(Vehicle *v, const O
 
					if (v->type == VEH_TRAIN && closestDepot.reverse) Command<CMD_REVERSE_TRAIN_DIRECTION>::Do(DC_EXEC, v->index, false);
 

	
 
					if (v->type == VEH_AIRCRAFT) {
 
						Aircraft *a = Aircraft::From(v);
 
						if (a->state == FLYING && a->targetairport != closestDepot.destination) {
 
							/* The aircraft is now heading for a different hangar than the next in the orders */
 
							extern void AircraftNextAirportPos_and_Order(Aircraft *a);
 
							AircraftNextAirportPos_and_Order(a);
 
						}
 
					}
 
					return true;
 
				}
 

	
 
@@ -2135,13 +2134,12 @@ bool ProcessOrders(Vehicle *v)
 
	}
 

	
 
	/* If no order, do nothing. */
 
	if (order == nullptr || (v->type == VEH_AIRCRAFT && !CheckForValidOrders(v))) {
 
		if (v->type == VEH_AIRCRAFT) {
 
			/* Aircraft do something vastly different here, so handle separately */
 
			extern void HandleMissingAircraftOrders(Aircraft *v);
 
			HandleMissingAircraftOrders(Aircraft::From(v));
 
			return false;
 
		}
 

	
 
		v->current_order.Free();
 
		v->SetDestTile(0);
src/roadveh_cmd.h
Show inline comments
 
@@ -12,12 +12,14 @@
 

	
 
#include "command_type.h"
 
#include "engine_type.h"
 
#include "vehicle_type.h"
 

	
 
bool RoadVehLeaveDepot(RoadVehicle *v, bool first);
 
bool IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *prev);
 
bool RoadVehiclesAreBuilt();
 

	
 
CommandCost CmdBuildRoadVehicle(DoCommandFlag flags, TileIndex tile, const Engine *e, Vehicle **v);
 

	
 
CommandCost CmdTurnRoadVeh(DoCommandFlag flags, VehicleID veh_id);
 

	
 
DEF_CMD_TRAIT(CMD_TURN_ROADVEH, CmdTurnRoadVeh, 0, CMDT_VEHICLE_MANAGEMENT)
src/saveload/afterload.cpp
Show inline comments
 
@@ -2938,13 +2938,12 @@ bool AfterLoadGame()
 
				}
 
			}
 
			while (cur_skip > skip_frames[0]) {
 
				RoadVehicle *u = v;
 
				RoadVehicle *prev = nullptr;
 
				for (uint sf : skip_frames) {
 
					extern bool IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *prev);
 
					if (sf >= cur_skip) IndividualRoadVehicleController(u, prev);
 

	
 
					prev = u;
 
					u = u->Next();
 
				}
 
				cur_skip--;
src/saveload/saveload.cpp
Show inline comments
 
@@ -364,12 +364,14 @@ void NORETURN SlError(StringID string, c
 
 */
 
void NORETURN SlErrorCorrupt(const char *msg)
 
{
 
	SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME, msg);
 
}
 

	
 
void NORETURN SlErrorCorruptFmt(const char *format, ...) WARN_FORMAT(1, 2);
 

	
 
/**
 
 * Issue an SlErrorCorrupt with a format string.
 
 * @param format format string
 
 * @param ... arguments to format string
 
 * @note This function does never return as it throws an exception to
 
 *       break out of all the saveload code.
src/saveload/saveload.h
Show inline comments
 
@@ -1131,13 +1131,12 @@ void SlGlobList(const SaveLoadTable &slt
 
void SlCopy(void *object, size_t length, VarType conv);
 
std::vector<SaveLoad> SlTableHeader(const SaveLoadTable &slt);
 
std::vector<SaveLoad> SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct);
 
void SlObject(void *object, const SaveLoadTable &slt);
 
void NORETURN SlError(StringID string, const char *extra_msg = nullptr);
 
void NORETURN SlErrorCorrupt(const char *msg);
 
void NORETURN SlErrorCorruptFmt(const char *format, ...) WARN_FORMAT(1, 2);
 

	
 
bool SaveloadCrashWithMissingNewGRFs();
 

	
 
/**
 
 * Read in bytes from the file/data structure but don't do
 
 * anything with them, discarding them in effect
src/script/api/script_airport.cpp
Show inline comments
 
@@ -125,15 +125,12 @@
 
	return (AirportType)::Station::Get(station_id)->airport.type;
 
}
 

	
 

	
 
/* static */ int ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type)
 
{
 
	extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it, uint &mindist);
 
	extern uint8 GetAirportNoiseLevelForDistance(const AirportSpec *as, uint distance);
 

	
 
	if (!::IsValidTile(tile)) return -1;
 
	if (!IsAirportInformationAvailable(type)) return -1;
 

	
 
	const AirportSpec *as = ::AirportSpec::Get(type);
 
	if (!as->IsWithinMapBounds(0, tile)) return -1;
 

	
 
@@ -146,14 +143,12 @@
 

	
 
	return 1;
 
}
 

	
 
/* static */ TownID ScriptAirport::GetNearestTown(TileIndex tile, AirportType type)
 
{
 
	extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it, uint &mindist);
 

	
 
	if (!::IsValidTile(tile)) return INVALID_TOWN;
 
	if (!IsAirportInformationAvailable(type)) return INVALID_TOWN;
 

	
 
	const AirportSpec *as = AirportSpec::Get(type);
 
	if (!as->IsWithinMapBounds(0, tile)) return INVALID_TOWN;
 

	
src/script/script_info.hpp
Show inline comments
 
@@ -161,7 +161,10 @@ private:
 
	int version;                  ///< Version of the script.
 
	const char *url;              ///< URL of the script.
 

	
 
	class ScriptScanner *scanner; ///< ScriptScanner object that was used to scan this script info.
 
};
 

	
 
void Script_CreateDummyInfo(HSQUIRRELVM vm, const char *type, const char *dir);
 
void Script_CreateDummy(HSQUIRRELVM vm, StringID string, const char *type);
 

	
 
#endif /* SCRIPT_INFO_HPP */
src/script/script_instance.cpp
Show inline comments
 
@@ -9,12 +9,13 @@
 

	
 
#include "../stdafx.h"
 
#include "../debug.h"
 
#include "../saveload/saveload.h"
 

	
 
#include "../script/squirrel_class.hpp"
 
#include "../script/squirrel_std.hpp"
 

	
 
#include "script_fatalerror.hpp"
 
#include "script_storage.hpp"
 
#include "script_info.hpp"
 
#include "script_instance.hpp"
 

	
 
@@ -107,13 +108,12 @@ void ScriptInstance::Initialize(const ch
 
		this->Died();
 
	}
 
}
 

	
 
void ScriptInstance::RegisterAPI()
 
{
 
	extern void squirrel_register_std(Squirrel *engine);
 
	squirrel_register_std(this->engine);
 
}
 

	
 
bool ScriptInstance::LoadCompatibilityScripts(const char *api_version, Subdirectory dir)
 
{
 
	char script_name[32];
src/settings.cpp
Show inline comments
 
@@ -55,13 +55,12 @@ GameSettings _settings_game;     ///< Ga
 
GameSettings _settings_newgame;  ///< Game settings for new games (updated from the intro screen).
 
VehicleDefaultSettings _old_vds; ///< Used for loading default vehicles settings from old savegames.
 
std::string _config_file; ///< Configuration file of OpenTTD.
 
std::string _private_file; ///< Private configuration file of OpenTTD.
 
std::string _secrets_file; ///< Secrets configuration file of OpenTTD.
 

	
 
typedef std::list<ErrorMessageData> ErrorList;
 
static ErrorList _settings_error_list; ///< Errors while loading minimal settings.
 

	
 
/**
 
 * List of all the generic setting tables.
 
 *
 
 * There are a few tables that are special and not processed like the rest:
 
@@ -1247,13 +1246,12 @@ void LoadFromConfig(bool startup)
 
		HandleOldDiffCustom(false);
 

	
 
		ValidateSettings();
 
		DebugReconsiderSendRemoteMessages();
 

	
 
		/* Display scheduled errors */
 
		extern void ScheduleErrorMessage(ErrorList &datas);
 
		ScheduleErrorMessage(_settings_error_list);
 
		if (FindWindowById(WC_ERRMSG, 0) == nullptr) ShowFirstError();
 
	}
 
}
 

	
 
/** Save the values to the configuration file */
src/settings_table.cpp
Show inline comments
 
@@ -39,13 +39,15 @@
 
#include "ai/ai_config.hpp"
 
#include "ai/ai.hpp"
 
#include "game/game_config.hpp"
 
#include "ship.h"
 
#include "smallmap_gui.h"
 
#include "roadveh.h"
 
#include "roadveh_cmd.h"
 
#include "vehicle_func.h"
 
#include "viewport_func.h"
 
#include "void_map.h"
 

	
 
#include "table/strings.h"
 
#include "table/settings.h"
 

	
 
#include "safeguards.h"
 
@@ -255,13 +257,12 @@ static void TownFoundingChanged(int32 ne
 
		InvalidateWindowData(WC_FOUND_TOWN, 0);
 
	}
 
}
 

	
 
static void ZoomMinMaxChanged(int32 new_value)
 
{
 
	extern void ConstrainAllViewportsZoom();
 
	ConstrainAllViewportsZoom();
 
	GfxClearSpriteCache();
 
	if (_settings_client.gui.zoom_min > _gui_zoom) {
 
		/* Restrict GUI zoom if it is no longer available. */
 
		_gui_zoom = _settings_client.gui.zoom_min;
 
		UpdateCursorSize();
 
@@ -320,13 +321,12 @@ static void MaxNoAIsChange(int32 new_val
 
 * Check whether the road side may be changed.
 
 * @param new_value unused
 
 * @return true if the road side may be changed.
 
 */
 
static bool CheckRoadSide(int32 &new_value)
 
{
 
	extern bool RoadVehiclesAreBuilt();
 
	return _game_mode == GM_MENU || !RoadVehiclesAreBuilt();
 
}
 

	
 
/**
 
 * Conversion callback for _gameopt_settings_game.landscape
 
 * It converts (or try) between old values and the new ones,
src/station_cmd.h
Show inline comments
 
@@ -12,12 +12,15 @@
 

	
 
#include "command_type.h"
 
#include "station_type.h"
 

	
 
enum StationClassID : byte;
 

	
 
extern Town *AirportGetNearestTown(const struct AirportSpec *as, const TileIterator &it, uint &mindist);
 
extern uint8 GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint distance);
 

	
 
CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool allow_adjacent);
 
CommandCost CmdBuildDock(DoCommandFlag flags, TileIndex tile, StationID station_to_join, bool adjacent);
 
CommandCost CmdBuildRailStation(DoCommandFlag flags, TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent);
 
CommandCost CmdRemoveFromRailStation(DoCommandFlag flags, TileIndex start, TileIndex end, bool keep_rail);
 
CommandCost CmdBuildRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, StationID station_to_join, bool adjacent);
 
CommandCost CmdRemoveRoadStop(DoCommandFlag flags, TileIndex tile, uint8 width, uint8 height, RoadStopType stop_type, bool remove_road);
src/station_map.h
Show inline comments
 
@@ -232,22 +232,23 @@ static inline bool IsStandardRoadStopTil
 
 */
 
static inline bool IsDriveThroughStopTile(TileIndex t)
 
{
 
	return IsRoadStopTile(t) && GetStationGfx(t) >= GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
 
}
 

	
 
StationGfx GetTranslatedAirportTileID(StationGfx gfx);
 

	
 
/**
 
 * Get the station graphics of this airport tile
 
 * @param t the tile to query
 
 * @pre IsAirport(t)
 
 * @return the station graphics
 
 */
 
static inline StationGfx GetAirportGfx(TileIndex t)
 
{
 
	assert(IsAirport(t));
 
	extern StationGfx GetTranslatedAirportTileID(StationGfx gfx);
 
	return GetTranslatedAirportTileID(GetStationGfx(t));
 
}
 

	
 
/**
 
 * Gets the direction the road stop entrance points towards.
 
 * @param t the tile of the road stop
src/vehicle.cpp
Show inline comments
 
@@ -868,13 +868,12 @@ void Vehicle::PreDestructor()
 
	InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type), 0);
 

	
 
	this->cargo.Truncate();
 
	DeleteVehicleOrders(this);
 
	DeleteDepotHighlightOfVehicle(this);
 

	
 
	extern void StopGlobalFollowVehicle(const Vehicle *v);
 
	StopGlobalFollowVehicle(this);
 

	
 
	ReleaseDisastersTargetingVehicle(this->index);
 
}
 

	
 
Vehicle::~Vehicle()
 
@@ -2446,13 +2445,12 @@ CommandCost Vehicle::SendToDepot(DoComma
 
		}
 

	
 
		if (this->type == VEH_AIRCRAFT) {
 
			Aircraft *a = Aircraft::From(this);
 
			if (a->state == FLYING && a->targetairport != closestDepot.destination) {
 
				/* The aircraft is now heading for a different hangar than the next in the orders */
 
				extern void AircraftNextAirportPos_and_Order(Aircraft *a);
 
				AircraftNextAirportPos_and_Order(a);
 
			}
 
		}
 
	}
 

	
 
	return CommandCost();
src/vehicle_gui.h
Show inline comments
 
@@ -109,11 +109,12 @@ void ShowVehicleViewWindow(const Vehicle
 
bool VehicleClicked(const Vehicle *v);
 
bool VehicleClicked(VehicleList::const_iterator begin, VehicleList::const_iterator end);
 
bool VehicleClicked(const GUIVehicleGroup &vehgroup);
 
void StartStopVehicle(const Vehicle *v, bool texteffect);
 

	
 
Vehicle *CheckClickOnVehicle(const struct Viewport *vp, int x, int y);
 
void StopGlobalFollowVehicle(const Vehicle *v);
 

	
 
void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip);
 
void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type);
 

	
 
#endif /* VEHICLE_GUI_H */
src/viewport_func.h
Show inline comments
 
@@ -28,12 +28,13 @@ Point GetTileBelowCursor();
 
void UpdateViewportPosition(Window *w);
 

	
 
bool MarkAllViewportsDirty(int left, int top, int right, int bottom);
 

	
 
bool DoZoomInOutWindow(ZoomStateChange how, Window *w);
 
void ZoomInOrOutToCursorWindow(bool in, Window * w);
 
void ConstrainAllViewportsZoom();
 
Point GetTileZoomCenterWindow(bool in, Window * w);
 
void FixTitleGameZoom(int zoom_adjust = 0);
 
void HandleZoomMessage(Window *w, const Viewport *vp, byte widget_zoom_in, byte widget_zoom_out);
 

	
 
/**
 
 * Zoom a viewport as far as possible in the given direction.
src/window.cpp
Show inline comments
 
@@ -15,12 +15,13 @@
 
#include "console_gui.h"
 
#include "viewport_func.h"
 
#include "progress.h"
 
#include "blitter/factory.hpp"
 
#include "zoom_func.h"
 
#include "vehicle_base.h"
 
#include "depot_func.h"
 
#include "window_func.h"
 
#include "tilehighlight_func.h"
 
#include "network/network.h"
 
#include "querystring_gui.h"
 
#include "widgets/dropdown_func.h"
 
#include "strings_func.h"
 
@@ -3087,13 +3088,12 @@ void UpdateWindows()
 

	
 
	last_time = std::chrono::steady_clock::now();
 

	
 
	PerformanceMeasurer framerate(PFE_DRAWING);
 
	PerformanceAccumulator::Reset(PFE_DRAWWORLD);
 

	
 
	extern void ProcessPendingPerformanceMeasurements();
 
	ProcessPendingPerformanceMeasurements();
 

	
 
	CallWindowRealtimeTickEvent(delta_ms);
 

	
 
	static GUITimer network_message_timer = GUITimer(1);
 
	if (network_message_timer.Elapsed(delta_ms)) {
 
@@ -3383,25 +3383,23 @@ void ReInitWindow(Window *w, bool zoom_c
 
void ReInitAllWindows(bool zoom_changed)
 
{
 
	SetupWidgetDimensions();
 
	NWidgetLeaf::InvalidateDimensionCache(); // Reset cached sizes of several widgets.
 
	NWidgetScrollbar::InvalidateDimensionCache();
 

	
 
	extern void InitDepotWindowBlockSizes();
 
	InitDepotWindowBlockSizes();
 

	
 
	/* When _gui_zoom has changed, we need to resize toolbar and statusbar first,
 
	 * so EnsureVisibleCaption uses the updated size information. */
 
	ReInitWindow(FindWindowById(WC_MAIN_TOOLBAR, 0), zoom_changed);
 
	ReInitWindow(FindWindowById(WC_STATUS_BAR, 0), zoom_changed);
 
	for (Window *w : Window::Iterate()) {
 
		if (w->window_class == WC_MAIN_TOOLBAR || w->window_class == WC_STATUS_BAR) continue;
 
		ReInitWindow(w, zoom_changed);
 
	}
 

	
 
	void NetworkReInitChatBoxSize();
 
	NetworkReInitChatBoxSize();
 

	
 
	/* Make sure essential parts of all windows are visible */
 
	RelocateAllWindows(_screen.width, _screen.height);
 
	MarkWholeScreenDirty();
 
}
0 comments (0 inline, 0 general)