Reduce header inclusion

* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
This commit is contained in:
Michał Janiszewski 2018-03-13 13:14:02 +01:00 committed by GitHub
parent bf580625f8
commit 764520076f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 92 additions and 92 deletions

View File

@ -22,6 +22,7 @@
#include "input/Input.h"
#include "input/KeyboardShortcuts.h"
#include "WindowManager.h"
#include "windows/Window.h"
using namespace OpenRCT2::Ui;

View File

@ -16,7 +16,6 @@
#pragma once
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <array>

View File

@ -19,6 +19,7 @@
#include <openrct2/OpenRCT2.h>
#include <openrct2/ParkImporter.h>
#include <openrct2/scenario/ScenarioSources.h>
#include <openrct2/scenario/ScenarioRepository.h>
#include <openrct2/title/TitleScreen.h>
#include <openrct2/title/TitleSequence.h>
#include <openrct2/title/TitleSequenceManager.h>

View File

@ -16,13 +16,8 @@
#include "Cheats.h"
#include "config/Config.h"
#include "Editor.h"
#include "Game.h"
#include "interface/Window.h"
#include "localisation/Localisation.h"
#include "management/Finance.h"
#include "network/network.h"
#include "ride/Station.h"
#include "util/Util.h"
#include "world/Climate.h"
#include "world/Footpath.h"

View File

@ -20,11 +20,10 @@
#include "CmdlineSprite.h"
#include "drawing/Drawing.h"
#include "Imaging.h"
#include "localisation/Localisation.h"
#include "localisation/Language.h"
#include "OpenRCT2.h"
#include "platform/platform.h"
#include "util/Util.h"
#include "png.h"
#define MODE_DEFAULT 0
#define MODE_CLOSEST 1

View File

@ -57,6 +57,7 @@
#include "interface/Chat.h"
#include "interface/Console.h"
#include "interface/themes.h"
#include "interface/Viewport.h"
#include "Intro.h"
#include "localisation/Date.h"
#include "localisation/Language.h"
@ -64,9 +65,7 @@
#include "network/http.h"
#include "network/network.h"
#include "network/twitch.h"
#include "object/ObjectList.h"
#include "platform/platform.h"
#include "rct1/RCT1.h"
#include "util/Util.h"
using namespace OpenRCT2;

View File

@ -18,6 +18,9 @@
#include "common.h"
#include <string>
interface IStream;
class Intent;
struct rct_window;
using rct_windowclass = uint8;
@ -59,12 +62,6 @@ enum
CURSOR_PRESSED = CURSOR_DOWN | CURSOR_CHANGED,
};
#ifdef __cplusplus
#include <string>
interface IStream;
namespace OpenRCT2
{
interface IPlatformEnvironment;
@ -109,8 +106,6 @@ namespace OpenRCT2
IContext * GetContext();
}
#endif // __cplusplus
enum
{
// The game update inverval in milliseconds, (1000 / 40fps) = 25ms

View File

@ -14,7 +14,6 @@
*****************************************************************************/
#pragma endregion
#include <cassert>
#include <cstdarg>
#include <cstdio>
#include "Diagnostic.h"

View File

@ -29,13 +29,14 @@
#include "localisation/Localisation.h"
#include "management/NewsItem.h"
#include "object/ObjectManager.h"
#include "object/ObjectRepository.h"
#include "object/ObjectList.h"
#include "peep/Staff.h"
#include "rct1/RCT1.h"
#include "util/Util.h"
#include "windows/Intent.h"
#include "world/Climate.h"
#include "world/Entrance.h"
#include "world/Footpath.h"
#include "world/Scenery.h"
#include "interface/Window_internal.h"
namespace Editor

View File

@ -18,10 +18,6 @@
#define _EDITOR_H_
#include "common.h"
#include "object/Object.h"
#ifdef __cplusplus
#include "object/Object.h"
namespace Editor
{
@ -84,5 +80,3 @@ void editor_open_windows_for_current_step();
void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp);
#endif
#endif

View File

@ -16,8 +16,13 @@
#pragma once
// TODO: only used by handle_park_load_failure, extract to separate header
#include <string>
#include "common.h"
#include "scenario/Scenario.h"
struct ParkLoadResult;
struct rct_s6_data;
enum GAME_COMMAND
{

View File

@ -21,6 +21,7 @@
#include "core/FileStream.hpp"
#include "core/Guard.hpp"
#include "core/Memory.hpp"
#include "drawing/Drawing.h"
#include "Imaging.h"

View File

@ -18,9 +18,8 @@
#include "common.h"
#include "drawing/Drawing.h"
#ifdef __cplusplus
struct rct_drawpixelinfo;
struct rct_palette;
namespace Imaging
{
@ -29,9 +28,6 @@ namespace Imaging
bool PngWrite32bpp(sint32 width, sint32 height, const void * pixels, const utf8 * path);
}
#endif // __cplusplus
bool image_io_png_read(uint8 * * pixels, uint32 * width, uint32 * height, bool expand, const utf8 * path, sint32 * bitDepth);
bool image_io_png_write(const rct_drawpixelinfo * dpi, const rct_palette * palette, const utf8 * path);
bool image_io_png_write_32bpp(sint32 width, sint32 height, const void * pixels, const utf8 * path);

View File

@ -14,7 +14,6 @@
*****************************************************************************/
#pragma endregion
#include "audio/audio.h"
#include "Context.h"
#include "Input.h"
@ -85,4 +84,4 @@ void reset_tooltip_not_shown()
void input_reset_place_obj_modifier()
{
gInputPlaceObjectModifier = PLACE_OBJECT_MODIFIER_NONE;
}
}

View File

@ -17,7 +17,9 @@
#ifndef _INTRO_H_
#define _INTRO_H_
#include "drawing/Drawing.h"
#include "common.h"
struct rct_drawpixelinfo;
enum INTRO_STATE {
INTRO_STATE_NONE,

View File

@ -17,8 +17,6 @@
#pragma once
#include "common.h"
#include "core/Guard.hpp"
#ifndef DISABLE_NETWORK
#include <openssl/evp.h>

View File

@ -31,12 +31,12 @@ enum PARK_LOAD_ERROR
#include <string>
#include <vector>
#include "scenario/ScenarioRepository.h"
#include "core/String.hpp"
interface IObjectManager;
interface IObjectRepository;
interface IStream;
struct scenario_index_entry;
struct ParkLoadResult final
{

View File

@ -15,15 +15,12 @@
#pragma endregion
#include "config/Config.h"
#include "core/Console.hpp"
#include "core/Guard.hpp"
#include "core/Path.hpp"
#include "core/String.hpp"
#include "OpenRCT2.h"
#include "platform/platform.h"
#include "platform/Platform2.h"
#include "PlatformEnvironment.h"
#include "Version.h"
using namespace OpenRCT2;

View File

@ -23,6 +23,7 @@
#include "../localisation/Localisation.h"
#include "../network/network.h"
#include "../platform/platform.h"
#include "../scenario/Scenario.h"
#include "../world/Park.h"
#include "GameAction.h"

View File

@ -20,7 +20,6 @@
#include "../core/FileStream.hpp"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
#include "../core/Util.hpp"
#include "../localisation/StringIds.h"
#include "../OpenRCT2.h"
#include "../ui/UiContext.h"

View File

@ -14,15 +14,11 @@
*****************************************************************************/
#pragma endregion
#include "../core/Guard.hpp"
#include "../platform/platform.h"
#include "../OpenRCT2.h"
#include "../core/Console.hpp"
#include "../core/Math.hpp"
#include "../core/String.hpp"
#include "CommandLine.hpp"
#include "../OpenRCT2.h"
#pragma region CommandLineArgEnumerator

View File

@ -17,14 +17,12 @@
#include <memory>
#include "../common.h"
#include "../core/Console.hpp"
#include "../core/Guard.hpp"
#include "../core/Path.hpp"
#include "../FileClassifier.h"
#include "../ParkImporter.h"
#include "../rct2/S6Exporter.h"
#include "CommandLine.hpp"
#include "../Game.h"
#include "../interface/Window.h"
#include "../OpenRCT2.h"

View File

@ -26,9 +26,9 @@
#include "../interface/Window.h"
#include "../network/network.h"
#include "../OpenRCT2.h"
#include "../PlatformEnvironment.h"
#include "../ui/UiContext.h"
#include "Config.h"
#include "ConfigEnum.hpp"
#include "IniReader.hpp"
#include "IniWriter.hpp"

View File

@ -17,7 +17,6 @@
#include <cctype>
#include <initializer_list>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#include "../common.h"

View File

@ -18,9 +18,9 @@
#include <string>
#include "../common.h"
#include "ConfigEnum.hpp"
interface IStream;
template <typename T> struct IConfigEnum;
interface IIniReader
{

View File

@ -18,9 +18,9 @@
#include <string>
#include "../common.h"
#include "ConfigEnum.hpp"
interface IStream;
template <typename T> struct IConfigEnum;
interface IIniWriter
{

View File

@ -24,9 +24,9 @@
#include "File.h"
#include "FileStream.hpp"
#include "String.hpp"
#include "../util/Util.h"
#include "../platform/platform.h"
#include "../util/Util.h"
namespace File
{

View File

@ -19,7 +19,6 @@
#include "../common.h"
#include "../interface/Colour.h"
#include "Font.h"
struct rct_g1_element {
uint8* offset; // 0x00

View File

@ -14,10 +14,10 @@
*****************************************************************************/
#pragma endregion
#include "../core/Guard.hpp"
#include "../core/Util.hpp"
#include "../localisation/ConversionTables.h"
#include "../localisation/Localisation.h"
#include "../localisation/FormatCodes.h"
#include "../localisation/Language.h"
#include "../sprites.h"
#include "Drawing.h"
#include "Font.h"

View File

@ -23,7 +23,6 @@
#include "../Game.h"
#include "../interface/Viewport.h"
#include "../interface/Window.h"
#include "../paint/tile_element/TileElement.h"
#include "../util/Util.h"
#include "../world/Climate.h"
#include "Drawing.h"

View File

@ -20,8 +20,10 @@
#ifdef __ENABLE_LIGHTFX__
#include "../common.h"
#include "../world/Map.h"
#include "Drawing.h"
struct LocationXY16;
struct rct_drawpixelinfo;
struct rct_palette;
enum LIGHTFX_LIGHT_TYPE {
LIGHTFX_LIGHT_TYPE_NONE = 0,

View File

@ -16,7 +16,6 @@
#include "../common.h"
#include "../interface/Colour.h"
#include "../platform/platform.h"
#include "Drawing.h"
/**

View File

@ -16,7 +16,6 @@
#include <algorithm>
#include "../config/Config.h"
#include "../interface/Colour.h"
#include "../interface/Viewport.h"
#include "../localisation/Localisation.h"
#include "../platform/platform.h"

View File

@ -14,6 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "Drawing.h"
#include "Text.h"
#include "../localisation/Localisation.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "../common.h"
#include "Drawing.h"
struct rct_drawpixelinfo;
enum class TextAlignment
{

View File

@ -18,9 +18,7 @@
#include "../config/Config.h"
#include "../Context.h"
#include "../ui/UiContext.h"
#include "../core/Guard.hpp"
#include "../core/Math.hpp"
#include "../core/Memory.hpp"
#include "../interface/Screenshot.h"
#include "IDrawingContext.h"
#include "IDrawingEngine.h"

View File

@ -18,13 +18,14 @@
#define _CHAT_H_
#include "../common.h"
#include "../drawing/Drawing.h"
#define CHAT_HISTORY_SIZE 10
#define CHAT_INPUT_SIZE 1024
#define CHAT_MAX_MESSAGE_LENGTH 200
#define CHAT_MAX_WINDOW_WIDTH 600
struct rct_drawpixelinfo;
enum CHAT_INPUT
{
CHAT_INPUT_NONE,

View File

@ -21,6 +21,7 @@
#include "../config/Config.h"
#include "../Context.h"
#include "../core/Guard.hpp"
#include "../core/Math.hpp"
#include "../core/String.hpp"
#include "../core/Util.hpp"

View File

@ -18,9 +18,10 @@
#define _CONSOLE_H_
#include "../common.h"
#include "../drawing/Drawing.h"
#include "../localisation/FormatCodes.h"
struct rct_drawpixelinfo;
enum CONSOLE_INPUT
{
CONSOLE_INPUT_NONE,

View File

@ -14,6 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "Fonts.h"
#include "FontFamilies.h"
#ifndef NO_TTF

View File

@ -22,7 +22,8 @@
#ifndef NO_TTF
#include <vector>
#include "Fonts.h"
struct TTFFontSetDescriptor;
using TTFontFamily = std::vector<TTFFontSetDescriptor *>;

View File

@ -17,11 +17,18 @@
#ifndef _VIEWPORT_H_
#define _VIEWPORT_H_
#include "../world/Map.h"
#include "../world/Sprite.h"
#include "../paint/Paint.h"
#include "Window.h"
struct paint_session;
struct paint_struct;
struct rct_drawpixelinfo;
struct rct_peep;
struct rct_tile_element;
struct rct_vehicle;
struct rct_window;
union paint_entry;
union rct_sprite;
enum {
VIEWPORT_FLAG_UNDERGROUND_INSIDE = (1 << 0),
VIEWPORT_FLAG_SEETHROUGH_RIDES = (1 << 1),

View File

@ -18,14 +18,11 @@
#define _WINDOW_H_
#include "../common.h"
#include "../drawing/Drawing.h"
#include "../management/Research.h"
#include "../peep/Peep.h"
#include "../ride/Ride.h"
#include "../ride/TrackDesign.h"
#include "../ride/Vehicle.h"
#include "../scenario/Scenario.h"
#include "../world/Park.h"
#include "../paint/Paint.h"
#include "Colour.h"
struct rct_window;

View File

@ -17,6 +17,8 @@
#ifndef _WINDOW2_H_
#define _WINDOW2_H_
struct rct_research_item;
/**
* Window structure
* size: 0x4C0

View File

@ -30,13 +30,14 @@
#include "../common.h"
#include "../config/Config.h"
#include "../core/Util.hpp"
#include "../management/Marketing.h"
#include "../Game.h"
#include "../util/Util.h"
#include "Date.h"
#include "Localisation.h"
#include "../core/Math.hpp"
#include "../core/Util.hpp"
#include "Date.h"
#include "../Game.h"
#include "Localisation.h"
#include "../management/Marketing.h"
#include "../ride/Ride.h"
#include "../util/Util.h"
char gCommonStringFormatBuffer[256];
uint8 gCommonFormatArgs[80];

View File

@ -44,6 +44,8 @@ enum {
#include "NetworkTypes.h"
struct GameAction;
struct rct_peep;
struct LocationXYZ16;
#ifndef DISABLE_NETWORK

View File

@ -17,9 +17,11 @@
#pragma once
#include "../common.h"
#include "../world/Map.h"
#include "../interface/Colour.h"
#include "../drawing/Drawing.h"
#include "../world/Location.hpp"
struct rct_tile_element;
#pragma pack(push, 1)
/* size 0x12 */

View File

@ -19,7 +19,6 @@
#include "../../common.h"
#include "../../sprites.h"
#include "../../world/Map.h"
enum
{

View File

@ -22,6 +22,7 @@
#include "../audio/audio.h"
#include "../Cheats.h"
#include "../config/Config.h"
#include "../core/Guard.hpp"
#include "../core/Math.hpp"
#include "../core/Util.hpp"
#include "../Game.h"

View File

@ -19,7 +19,7 @@
#include "../common.h"
#include "../rct12/RCT12.h"
#include "../world/Map.h"
#include "../world/Location.hpp"
#define PEEP_MAX_THOUGHTS 5
#define PEEP_THOUGHT_ITEM_NONE 255
@ -38,6 +38,8 @@
#define PEEP_MAX_ENERGY 128
#define PEEP_MAX_ENERGY_TARGET 255 // Oddly, this differs from max energy!
struct rct_tile_element;
enum PEEP_TYPE
{
PEEP_TYPE_GUEST,

View File

@ -23,7 +23,6 @@
#include "../rct12/RCT12.h"
#include "../ride/Ride.h"
#include "../world/Banner.h"
#include "../world/Map.h"
#include "../world/Sprite.h"
#include "../world/MapAnimation.h"

View File

@ -32,6 +32,7 @@
#include "../ParkImporter.h"
#include "../ride/Station.h"
#include "../scenario/ScenarioSources.h"
#include "../scenario/ScenarioRepository.h"
#include "Tables.h"
#include "../object/ObjectList.h"
@ -2904,4 +2905,4 @@ static sint32 GetWallType(rct_tile_element * tileElement, sint32 edge)
static uint8 GetWallColour(rct_tile_element * tileElement)
{
return ((tileElement->type & 0xC0) >> 3) | ((tileElement->properties.wall.type & 0xE0) >> 5);
}
}

View File

@ -21,6 +21,7 @@
#include "../ride/Vehicle.h"
#include "../common.h"
#include "../rct12/RCT12.h"
#include "../world/Location.hpp"
#define RCT2_MAX_STAFF 200
#define RCT2_MAX_BANNERS_IN_PARK 250

View File

@ -44,6 +44,7 @@
#include "../ride/Ride.h"
#include "../ride/RideRatings.h"
#include "../scenario/Scenario.h"
#include "../scenario/ScenarioRepository.h"
#include "../util/SawyerCoding.h"
#include "../world/Climate.h"
#include "../world/Entrance.h"

View File

@ -17,6 +17,8 @@
#include "../Game.h"
#include "Station.h"
#include "Track.h"
#include "../scenario/Scenario.h"
#include "../world/Sprite.h"
static void ride_update_station_blocksection(Ride * ride, sint32 stationIndex);
static void ride_update_station_bumpercar(Ride * ride, sint32 stationIndex);

View File

@ -17,7 +17,6 @@
#pragma once
#include "../common.h"
#include "../world/Map.h"
#include "Ride.h"
void ride_update_station(Ride * ride, sint32 stationIndex);
@ -34,4 +33,4 @@ void ride_clear_entrance_location(Ride * ride, const sint32 stationIndex);
void ride_clear_exit_location(Ride * ride, const sint32 stationIndex);
void ride_set_entrance_location(Ride * ride, const sint32 stationIndex, const TileCoordsXYZD location);
void ride_set_exit_location(Ride * ride, const sint32 stationIndex, const TileCoordsXYZD location);
void ride_set_exit_location(Ride * ride, const sint32 stationIndex, const TileCoordsXYZD location);

View File

@ -18,7 +18,7 @@
#define _VEHICLE_H_
#include "../common.h"
#include "../world/Map.h"
#include "../world/Location.hpp"
struct rct_vehicle_colour {
uint8 body_colour;

View File

@ -18,13 +18,14 @@
#define _PARK_H_
#include "../common.h"
#include "Map.h"
#define DECRYPT_MONEY(money) ((money32)rol32((money) ^ 0xF4EC9621, 13))
#define ENCRYPT_MONEY(money) ((money32)(ror32((money), 13) ^ 0xF4EC9621))
#define MAX_ENTRANCE_FEE MONEY(200,00)
struct rct_peep;
enum {
PARK_FLAGS_PARK_OPEN = (1 << 0),
PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT = (1 << 1),

View File

@ -17,6 +17,7 @@
#include <cmath>
#include "../audio/audio.h"
#include "../Cheats.h"
#include "../core/Guard.hpp"
#include "../core/Math.hpp"
#include "../Game.h"
#include "../interface/Viewport.h"

View File

@ -21,10 +21,13 @@
#include "../Cheats.h"
#include "../Game.h"
#include "../localisation/StringIds.h"
#include "../management/Finance.h"
#include "../ride/Track.h"
#include "../ride/TrackData.h"
#include "Banner.h"
#include "LargeScenery.h"
#include "Map.h"
#include "MapAnimation.h"
#include "Park.h"
#include "Scenery.h"
#include "SmallScenery.h"

View File

@ -7,6 +7,7 @@
#include <openrct2/core/String.hpp>
#include <openrct2/OpenRCT2.h>
#include <openrct2/ParkImporter.h>
#include <openrct2/ride/Ride.h>
#include "TestData.h"
#include <openrct2/platform/platform.h>

View File

@ -6,6 +6,7 @@
#include <openrct2/core/Path.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/OpenRCT2.h>
#include <openrct2/ride/Ride.h>
#include "TestData.h"
#include <openrct2/platform/platform.h>