diff --git a/src/openrct2-cli/Cli.cpp b/src/openrct2-cli/Cli.cpp index b6aed12d21..672bb47f87 100644 --- a/src/openrct2-cli/Cli.cpp +++ b/src/openrct2-cli/Cli.cpp @@ -17,10 +17,7 @@ #include #include -extern "C" -{ - #include -} +#include using namespace OpenRCT2; diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index c34b7498e9..80903072c0 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -21,12 +21,9 @@ #include #include "TextComposition.h" -extern "C" -{ - #include - #include - #include -} +#include +#include +#include #ifdef __MACOSX__ // macOS uses COMMAND rather than CTRL for many keyboard shortcuts diff --git a/src/openrct2-ui/Ui.cpp b/src/openrct2-ui/Ui.cpp index e49624494a..f9c00db3a8 100644 --- a/src/openrct2-ui/Ui.cpp +++ b/src/openrct2-ui/Ui.cpp @@ -23,10 +23,7 @@ #include "Ui.h" #include "UiContext.h" -extern "C" -{ - #include -} +#include using namespace OpenRCT2; using namespace OpenRCT2::Audio; diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index c86619493e..20a24d4614 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -40,13 +40,10 @@ #include "UiContext.h" #include "WindowManager.h" -extern "C" -{ - #include - #include - #include - #include -} +#include +#include +#include +#include using namespace OpenRCT2; using namespace OpenRCT2::Drawing; diff --git a/src/openrct2-ui/audio/AudioMixer.cpp b/src/openrct2-ui/audio/AudioMixer.cpp index f7d51a96ff..b762a63b43 100644 --- a/src/openrct2-ui/audio/AudioMixer.cpp +++ b/src/openrct2-ui/audio/AudioMixer.cpp @@ -30,13 +30,10 @@ #include "AudioContext.h" #include "AudioFormat.h" -extern "C" -{ - #include - #include - #include - #include -} +#include +#include +#include +#include namespace OpenRCT2 { namespace Audio { diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index fd89fd74b9..95749eb6fc 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -23,12 +23,9 @@ #include #include "DrawingEngines.h" -extern "C" -{ - #include - #include - #include -} +#include +#include +#include using namespace OpenRCT2; using namespace OpenRCT2::Drawing; diff --git a/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp index 6d5640d750..359712b8ae 100644 --- a/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp @@ -24,10 +24,7 @@ #include #include "DrawingEngines.h" -extern "C" -{ - #include -} +#include using namespace OpenRCT2; using namespace OpenRCT2::Drawing; diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 8f11075e1b..6007a5dee0 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -31,12 +31,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include #include "../DrawingEngines.h" #include "GLSLTypes.h" diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index f068e3e32f..cfaab921a7 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -24,10 +24,7 @@ #include #include "OpenGLShaderProgram.h" -extern "C" -{ - #include -} +#include OpenGLShader::OpenGLShader(const char * name, GLenum type) { diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index c4593812e2..aba9aa0381 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -21,10 +21,7 @@ #include #include "TextureCache.h" -extern "C" -{ - #include -} +#include TextureCache::~TextureCache() { diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index 467134fa38..fc3c5c4780 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -25,10 +25,7 @@ #include #include "KeyboardShortcuts.h" -extern "C" -{ - #include -} +#include using namespace OpenRCT2; using namespace OpenRCT2::Input; diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index caa036f32d..38e916b306 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -18,12 +18,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include #define WW 400 #define WH 350 diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 752f5bd0ef..72c5d6a779 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -20,12 +20,10 @@ #include #include -extern "C" { - #include - #include - #include - #include -} +#include +#include +#include +#include enum { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 40578a22f6..6c2eb87748 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -21,14 +21,12 @@ #include #include -extern "C" { - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include #define CHEATS_MONEY_DEFAULT MONEY(10000,00) #define CHEATS_MONEY_INCREMENT_DIV MONEY(5000,00) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 9f3290c9bc..ba65c24e25 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -18,12 +18,10 @@ #include #include -extern "C" { - #include - #include - #include - #include -} +#include +#include +#include +#include enum WINDOW_CLEAR_SCENERY_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 5d69cf4db0..472d718075 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -17,12 +17,10 @@ #include #include -extern "C" { - #include - #include - #include - #include -} +#include +#include +#include +#include enum WINDOW_CUSTOM_CURRENCY_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 2387330d6c..ae3bee36ea 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -17,13 +17,11 @@ #include #include -extern "C" { - #include +#include #include #include #include #include -} enum WINDOW_DEBUG_PAINT_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 830eae5818..cb09e23f68 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -21,17 +21,14 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include #pragma region Widgets diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 530aa06062..f5d265ff03 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -18,17 +18,14 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include #pragma region Widgets diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index fae6d34ef0..50cd64f27b 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -18,16 +18,13 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include #pragma region Widgets diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index c02848c5a0..5ccc9c7c14 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -17,19 +17,16 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum { PATH_CONSTRUCTION_MODE_LAND, diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index cd5a7dc43d..d89906c2e1 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -18,13 +18,10 @@ #include #include -extern "C" -{ - #include - #include - #include - #include -} +#include +#include +#include +#include enum WINDOW_LAND_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 66ad585334..57940ba367 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -18,15 +18,12 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include enum WINDOW_WATER_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index c9a0240525..2d5e2b033c 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -17,12 +17,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include rct_widget window_main_widgets[] = { { WWT_VIEWPORT, 0, 0x0000, -1, 0x0000, -1, 0xFFFFFFFE, 0xFFFF }, diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 3bf7762e8b..8cc8686771 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -18,16 +18,13 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include enum { WINDOW_MAPGEN_PAGE_BASE, diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 39ce902cdb..101f45e46b 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -18,14 +18,11 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include enum { WINDOW_MULTIPLAYER_PAGE_INFORMATION, diff --git a/src/openrct2-ui/windows/MusicCredits.cpp b/src/openrct2-ui/windows/MusicCredits.cpp index 84391c1cfe..c26cec8fd1 100644 --- a/src/openrct2-ui/windows/MusicCredits.cpp +++ b/src/openrct2-ui/windows/MusicCredits.cpp @@ -18,11 +18,8 @@ #include #include -extern "C" -{ - #include - #include -} +#include +#include enum WINDOW_MUSIC_CREDITS_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index f5af0e7623..4a0b773f8f 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -18,16 +18,13 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include enum WINDOW_NEWS_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 38e59c06ad..11a01a6c29 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -18,12 +18,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include enum { NOTIFICATION_CATEGORY_PARK, diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 3710906103..1ea0b17d3a 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -33,22 +33,19 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum WINDOW_OPTIONS_PAGE { WINDOW_OPTIONS_PAGE_DISPLAY, diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 6d9f1f0486..df008b620a 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -19,13 +19,10 @@ #include #include -extern "C" -{ - #include - #include - #include - #include -} +#include +#include +#include +#include enum WINDOW_SAVE_PROMPT_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 66438efeaf..bb6bc9ab7c 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -21,17 +21,14 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include #define WWIDTH_MIN 500 #define WHEIGHT_MIN 300 diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index e69c576616..6e0d8b7424 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -20,14 +20,11 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include static char _port[7]; static char _name[65]; diff --git a/src/openrct2-ui/windows/ShortcutKeyChange.cpp b/src/openrct2-ui/windows/ShortcutKeyChange.cpp index 9730c1fbd6..b32cffe7a5 100644 --- a/src/openrct2-ui/windows/ShortcutKeyChange.cpp +++ b/src/openrct2-ui/windows/ShortcutKeyChange.cpp @@ -18,12 +18,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include #define WW 250 #define WH 60 diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 151b2d3d78..c304759d73 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -18,11 +18,8 @@ #include #include "Window.h" -extern "C" -{ - #include - #include -} +#include +#include #define WW 420 #define WH 280 diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 6409d5a297..d22b517ba9 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -17,21 +17,18 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum { WINDOW_STAFF_LIST_TAB_HANDYMEN, diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index c03f4443cf..1a6ba32732 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -17,18 +17,15 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include +#include +#include enum { WINDOW_THEMES_TAB_SETTINGS, diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index dd467a9165..536c5d9c07 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -18,13 +18,10 @@ #include #include -extern "C" -{ - #include - #include - #include - #include -} +#include +#include +#include +#include enum WINDOW_TITLE_EXIT_WIDGET_IDX { WIDX_EXIT, diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 5ec96a3d21..f9e94049ac 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -16,12 +16,9 @@ #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include static rct_widget window_title_logo_widgets[] = { { WIDGETS_END }, diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 164e0ae1b9..edb8984839 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -19,16 +19,13 @@ #include #include -extern "C" -{ - #include - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include +#include enum { WIDX_START_NEW_GAME, diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index a5ab834e11..6df47664d6 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -18,12 +18,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include enum WINDOW_TITLE_OPTIONS_WIDGET_IDX { WIDX_OPTIONS, diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 9f1f45579e..ac225ba661 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -17,12 +17,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include enum WINDOW_VIEW_CLIPPING_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 10c9c50909..8ac95c0a08 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -16,15 +16,12 @@ #include -extern "C" -{ - #include - #include - #include - #include - #include - #include -} +#include +#include +#include +#include +#include +#include #define INITIAL_WIDTH 500 #define INITIAL_HEIGHT 350 diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 0d1d3cc08c..1011ff13f3 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -18,12 +18,9 @@ #include #include -extern "C" -{ - #include - #include - #include -} +#include +#include +#include enum WINDOW_WATER_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 253e76065d..3eb128b7b8 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -18,10 +18,7 @@ #include -extern "C" -{ - #include -} +#include rct_window * window_about_open(); rct_window * window_changelog_open(); diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d3e90f5cd1..bc142a988e 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -47,28 +47,25 @@ #include "ui/WindowManager.h" #include "Version.h" -extern "C" -{ - #include "audio/audio.h" - #include "config/Config.h" - #include "drawing/lightfx.h" - #include "editor.h" - #include "game.h" - #include "input.h" - #include "interface/chat.h" - #include "interface/console.h" - #include "interface/themes.h" - #include "intro.h" - #include "localisation/localisation.h" - #include "network/http.h" - #include "network/network.h" - #include "network/twitch.h" - #include "object_list.h" - #include "platform/platform.h" - #include "rct1.h" - #include "rct2/interop.h" - #include "util/util.h" -} +#include "audio/audio.h" +#include "config/Config.h" +#include "drawing/lightfx.h" +#include "editor.h" +#include "game.h" +#include "input.h" +#include "interface/chat.h" +#include "interface/console.h" +#include "interface/themes.h" +#include "intro.h" +#include "localisation/localisation.h" +#include "network/http.h" +#include "network/network.h" +#include "network/twitch.h" +#include "object_list.h" +#include "platform/platform.h" +#include "rct1.h" +#include "rct2/interop.h" +#include "util/util.h" using namespace OpenRCT2; using namespace OpenRCT2::Audio; diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 61769b1e92..4283666789 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -18,15 +18,8 @@ #include "common.h" +#include "interface/window.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "interface/window.h" -#ifdef __cplusplus -} -#endif typedef struct CursorState { diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index ead7a4d764..39a6f74658 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -19,11 +19,8 @@ #include "FileClassifier.h" #include "rct12/SawyerChunkReader.h" -extern "C" -{ - #include "scenario/scenario.h" - #include "util/sawyercoding.h" -} +#include "scenario/scenario.h" +#include "util/sawyercoding.h" static bool TryClassifyAsS6(IStream * stream, ClassifiedFileInfo * result); static bool TryClassifyAsS4(IStream * stream, ClassifiedFileInfo * result); diff --git a/src/openrct2/Imaging.h b/src/openrct2/Imaging.h index efd3cebc4a..68a9d79d9b 100644 --- a/src/openrct2/Imaging.h +++ b/src/openrct2/Imaging.h @@ -18,14 +18,7 @@ #include "common.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "drawing/drawing.h" -#ifdef __cplusplus -} -#endif +#include "drawing/drawing.h" #ifdef __cplusplus diff --git a/src/openrct2/OpenRCT2.cpp b/src/openrct2/OpenRCT2.cpp index 349c0d1d49..f347864fc9 100644 --- a/src/openrct2/OpenRCT2.cpp +++ b/src/openrct2/OpenRCT2.cpp @@ -19,11 +19,8 @@ #include "core/FileStream.hpp" #include "OpenRCT2.h" -extern "C" -{ - #include "audio/audio.h" - #include "platform/platform.h" -} +#include "audio/audio.h" +#include "platform/platform.h" extern "C" { diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index 814cd9f45a..d8beba57fa 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -18,14 +18,7 @@ #include "common.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "object.h" -#ifdef __cplusplus -} -#endif +#include "object.h" typedef enum PARK_LOAD_ERROR { diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index ba68fd93ff..c21f6c1810 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -24,10 +24,7 @@ #include "PlatformEnvironment.h" #include "Version.h" -extern "C" -{ - #include "platform/platform.h" -} +#include "platform/platform.h" using namespace OpenRCT2; diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index d0eeeae1fb..54b97dbeac 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include "common.h" @@ -81,3 +83,5 @@ namespace OpenRCT2 IPlatformEnvironment * CreatePlatformEnvironment(DIRBASE_VALUES basePaths); IPlatformEnvironment * CreatePlatformEnvironment(); } + +#endif diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index e40b40dbbc..55eda44ac5 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -22,6 +22,7 @@ #include OPENRCT2_BUILD_INFO_HEADER #endif +extern "C" { const char gVersionInfoFull[] = OPENRCT2_NAME ", v" OPENRCT2_VERSION #ifdef OPENRCT2_BRANCH @@ -37,3 +38,4 @@ const char gVersionInfoFull[] = " (DEBUG)" #endif ; +} diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index f470c3de38..9ce75d4abf 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -29,14 +29,11 @@ #include "AudioContext.h" #include "AudioMixer.h" -extern "C" -{ - #include "../interface/viewport.h" - #include "../intro.h" - #include "../localisation/language.h" - #include "../ride/ride.h" - #include "../util/util.h" -} +#include "../interface/viewport.h" +#include "../intro.h" +#include "../localisation/language.h" +#include "../ride/ride.h" +#include "../util/util.h" using namespace OpenRCT2::Audio; diff --git a/src/openrct2/audio/AudioChannel.h b/src/openrct2/audio/AudioChannel.h index 5b65fcd4c7..8685d72c51 100644 --- a/src/openrct2/audio/AudioChannel.h +++ b/src/openrct2/audio/AudioChannel.h @@ -18,6 +18,8 @@ #include "../common.h" +#ifdef __cplusplus + namespace OpenRCT2 { namespace Audio { interface IAudioSource; @@ -74,3 +76,5 @@ namespace OpenRCT2 { namespace Audio virtual size_t Read(void * dst, size_t len) abstract; }; } } + +#endif diff --git a/src/openrct2/audio/AudioContext.h b/src/openrct2/audio/AudioContext.h index a917015ed7..6fd04cbd9f 100644 --- a/src/openrct2/audio/AudioContext.h +++ b/src/openrct2/audio/AudioContext.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "../common.h" @@ -64,3 +66,5 @@ namespace OpenRCT2 IAudioContext * CreateDummyAudioContext(); } } + +#endif diff --git a/src/openrct2/audio/AudioSource.h b/src/openrct2/audio/AudioSource.h index 5302dab68e..2f09d16ed1 100644 --- a/src/openrct2/audio/AudioSource.h +++ b/src/openrct2/audio/AudioSource.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" #include "AudioMixer.h" @@ -38,3 +40,5 @@ namespace OpenRCT2 { namespace Audio IAudioSource * CreateNull(); } } } + +#endif diff --git a/src/openrct2/cheats.h b/src/openrct2/cheats.h index 41290b9c5c..a7d4f464f0 100644 --- a/src/openrct2/cheats.h +++ b/src/openrct2/cheats.h @@ -19,6 +19,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + extern bool gCheatsSandboxMode; extern bool gCheatsDisableClearanceChecks; extern bool gCheatsDisableSupportLimits; @@ -125,4 +129,8 @@ void cheats_reset(); const char* cheats_get_cheat_string(int cheat, int edx, int edi); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/cmdline/CommandLine.cpp b/src/openrct2/cmdline/CommandLine.cpp index df1f8a59e1..52d0737837 100644 --- a/src/openrct2/cmdline/CommandLine.cpp +++ b/src/openrct2/cmdline/CommandLine.cpp @@ -16,11 +16,8 @@ #include "../core/Guard.hpp" -extern "C" -{ - #include "../platform/platform.h" - #include "../OpenRCT2.h" -} +#include "../platform/platform.h" +#include "../OpenRCT2.h" #include "../core/Console.hpp" #include "../core/Math.hpp" diff --git a/src/openrct2/cmdline/CommandLine.hpp b/src/openrct2/cmdline/CommandLine.hpp index 51620f640a..8c45fb3c1f 100644 --- a/src/openrct2/cmdline/CommandLine.hpp +++ b/src/openrct2/cmdline/CommandLine.hpp @@ -16,11 +16,10 @@ #pragma once -extern "C" -{ - #include "../common.h" - #include "../cmdline_sprite.h" -} +#ifdef __cplusplus + +#include "../common.h" +#include "../cmdline_sprite.h" /** * Class for enumerating and retrieving values for a set of command line arguments. @@ -113,3 +112,5 @@ namespace CommandLine exitcode_t HandleCommandConvert(CommandLineArgEnumerator * enumerator); exitcode_t HandleCommandUri(CommandLineArgEnumerator * enumerator); } + +#endif diff --git a/src/openrct2/cmdline/ConvertCommand.cpp b/src/openrct2/cmdline/ConvertCommand.cpp index 31374dbe2f..72db62b3c4 100644 --- a/src/openrct2/cmdline/ConvertCommand.cpp +++ b/src/openrct2/cmdline/ConvertCommand.cpp @@ -25,12 +25,9 @@ #include "../rct2/S6Exporter.h" #include "CommandLine.hpp" -extern "C" -{ - #include "../game.h" - #include "../interface/window.h" - #include "../OpenRCT2.h" -} +#include "../game.h" +#include "../interface/window.h" +#include "../OpenRCT2.h" static void WriteConvertFromAndToMessage(uint32 sourceFileType, uint32 destinationFileType); static const utf8 * GetFileTypeFriendlyName(uint32 fileType); diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index c7cf5498dd..de0dba64eb 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -18,13 +18,10 @@ #include "../core/Guard.hpp" -extern "C" -{ - #include "../config/Config.h" - #include "../platform/crash.h" - #include "../platform/platform.h" - #include "../localisation/language.h" -} +#include "../config/Config.h" +#include "../platform/crash.h" +#include "../platform/platform.h" +#include "../localisation/language.h" #include "../core/Console.hpp" #include "../core/Memory.hpp" diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 239da9d547..c23ee0b6a0 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -136,7 +136,13 @@ typedef uint8 colour_t; #endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) #if !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700)) +#ifdef __cplusplus +extern "C" { +#endif char *strndup(const char *src, size_t size); +#ifdef __cplusplus +} +#endif #endif // !(POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) // BSD and macOS have MAP_ANON instead of MAP_ANONYMOUS diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 558670e04b..11210be7be 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -32,14 +32,11 @@ #include "IniReader.hpp" #include "IniWriter.hpp" -extern "C" -{ - #include "../localisation/currency.h" - #include "../localisation/date.h" - #include "../localisation/language.h" - #include "../platform/platform.h" - #include "../scenario/scenario.h" -} +#include "../localisation/currency.h" +#include "../localisation/date.h" +#include "../localisation/language.h" +#include "../platform/platform.h" +#include "../scenario/scenario.h" using namespace OpenRCT2; using namespace OpenRCT2::Ui; diff --git a/src/openrct2/config/IniWriter.cpp b/src/openrct2/config/IniWriter.cpp index ed6a775bdc..e3aed73d80 100644 --- a/src/openrct2/config/IniWriter.cpp +++ b/src/openrct2/config/IniWriter.cpp @@ -18,10 +18,7 @@ #include "../core/FileStream.hpp" #include "IniWriter.hpp" -extern "C" -{ - #include "../platform/platform.h" -} +#include "../platform/platform.h" class IniWriter final : public IIniWriter { diff --git a/src/openrct2/core/Console.cpp b/src/openrct2/core/Console.cpp index 2f7de0f5e8..3660509e3c 100644 --- a/src/openrct2/core/Console.cpp +++ b/src/openrct2/core/Console.cpp @@ -14,10 +14,7 @@ *****************************************************************************/ #pragma endregion -extern "C" -{ - #include "../platform/platform.h" -} +#include "../platform/platform.h" #include "Console.hpp" diff --git a/src/openrct2/core/File.cpp b/src/openrct2/core/File.cpp index ed43400c85..a06a0126b8 100644 --- a/src/openrct2/core/File.cpp +++ b/src/openrct2/core/File.cpp @@ -26,11 +26,8 @@ #include "FileStream.hpp" #include "String.hpp" -extern "C" -{ - #include "../platform/platform.h" - #include "../util/util.h" -} +#include "../platform/platform.h" +#include "../util/util.h" namespace File { diff --git a/src/openrct2/core/File.h b/src/openrct2/core/File.h index 2084be8608..f26a4710f6 100644 --- a/src/openrct2/core/File.h +++ b/src/openrct2/core/File.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "../common.h" @@ -31,3 +33,5 @@ namespace File std::vector ReadAllLines(const std::string &path); uint64 GetLastModified(const std::string &path); } + +#endif diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp index f2efeb689a..5fbc8a16a0 100644 --- a/src/openrct2/core/FileScanner.cpp +++ b/src/openrct2/core/FileScanner.cpp @@ -41,10 +41,7 @@ #include "Path.hpp" #include "String.hpp" -extern "C" -{ - #include "../platform/platform.h" -} +#include "../platform/platform.h" enum class DIRECTORY_CHILD_TYPE { diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index ce9afab192..52e7c432da 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" @@ -65,3 +67,5 @@ namespace Path */ void QueryDirectory(QueryDirectoryResult * result, const std::string &pattern); } + +#endif diff --git a/src/openrct2/core/FileStream.hpp b/src/openrct2/core/FileStream.hpp index 04142ffb65..02b2a37c0f 100644 --- a/src/openrct2/core/FileStream.hpp +++ b/src/openrct2/core/FileStream.hpp @@ -21,10 +21,7 @@ #include "Math.hpp" #include "String.hpp" -extern "C" -{ - #include "../localisation/language.h" -} +#include "../localisation/language.h" enum { diff --git a/src/openrct2/core/MemoryStream.h b/src/openrct2/core/MemoryStream.h index 89439e646a..7f03c04ce3 100644 --- a/src/openrct2/core/MemoryStream.h +++ b/src/openrct2/core/MemoryStream.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" #include "IStream.hpp" @@ -69,3 +71,5 @@ public: private: void EnsureCapacity(size_t capacity); }; + +#endif diff --git a/src/openrct2/core/Nullable.hpp b/src/openrct2/core/Nullable.hpp index 4732af9ebe..80f8671b3d 100644 --- a/src/openrct2/core/Nullable.hpp +++ b/src/openrct2/core/Nullable.hpp @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" template @@ -59,3 +61,5 @@ private: T _value; bool _hasValue; }; + +#endif diff --git a/src/openrct2/core/Path.cpp b/src/openrct2/core/Path.cpp index 2bb10b6622..1ab842861a 100644 --- a/src/openrct2/core/Path.cpp +++ b/src/openrct2/core/Path.cpp @@ -18,12 +18,9 @@ #include #endif -extern "C" -{ - #include "../platform/platform.h" - #include "../localisation/localisation.h" - #include "../util/util.h" -} +#include "../platform/platform.h" +#include "../localisation/localisation.h" +#include "../util/util.h" #include "File.h" #include "Math.hpp" diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index febc475c10..bdc11056ee 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -18,11 +18,8 @@ #include #include -extern "C" -{ - #include "../localisation/localisation.h" - #include "../util/util.h" -} +#include "../localisation/localisation.h" +#include "../util/util.h" #include "Math.hpp" #include "Memory.hpp" diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index 8d3e85efd0..1dbd68678d 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" /** @@ -55,3 +57,5 @@ namespace Zip IZipArchive * Open(const utf8 * path, ZIP_ACCESS zipAccess); IZipArchive * TryOpen(const utf8 * path, ZIP_ACCESS zipAccess); } + +#endif diff --git a/src/openrct2/diagnostic.h b/src/openrct2/diagnostic.h index daf8754a2f..f8f0d2d5c4 100644 --- a/src/openrct2/diagnostic.h +++ b/src/openrct2/diagnostic.h @@ -75,12 +75,12 @@ typedef enum { #define DEBUG_LEVEL_1 0 #endif // defined(DEBUG) -extern bool _log_levels[DIAGNOSTIC_LEVEL_COUNT]; - #ifdef __cplusplus extern "C" { #endif // __cplusplus +extern bool _log_levels[DIAGNOSTIC_LEVEL_COUNT]; + void diagnostic_log(DiagnosticLevel diagnosticLevel, const char *format, ...); void diagnostic_log_with_location(DiagnosticLevel diagnosticLevel, const char *file, const char *function, sint32 line, const char *format, ...); diff --git a/src/openrct2/drawing/DrawingFast.cpp b/src/openrct2/drawing/DrawingFast.cpp index 5b5c95f372..8f9437fad1 100644 --- a/src/openrct2/drawing/DrawingFast.cpp +++ b/src/openrct2/drawing/DrawingFast.cpp @@ -16,10 +16,7 @@ #pragma warning(disable : 4127) // conditional expression is constant -extern "C" -{ - #include "drawing.h" -} +#include "drawing.h" template static void FASTCALL DrawRLESprite2(const uint8* RESTRICT source_bits_pointer, diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index b440b01bf1..40640b5b5b 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" -extern "C" -{ - #include "drawing.h" -} +#include "drawing.h" namespace OpenRCT2 { namespace Drawing { @@ -43,3 +42,5 @@ namespace OpenRCT2 { namespace Drawing virtual void DrawGlyph(uint32 image, sint32 x, sint32 y, uint8 * palette) abstract; }; } } + +#endif diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index f019ade9d3..998c4d3109 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -21,10 +21,7 @@ #include "../core/Memory.hpp" #include "../OpenRCT2.h" -extern "C" -{ - #include "drawing.h" -} +#include "drawing.h" constexpr uint32 BASE_IMAGE_ID = 29294; constexpr uint32 MAX_IMAGES = 262144; diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index a498cfcd67..38fa519711 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -25,13 +25,10 @@ #include "IDrawingEngine.h" #include "NewDrawing.h" -extern "C" -{ - #include "../config/Config.h" - #include "../drawing/drawing.h" - #include "../localisation/string_ids.h" - #include "../platform/platform.h" -} +#include "../config/Config.h" +#include "../drawing/drawing.h" +#include "../localisation/string_ids.h" +#include "../platform/platform.h" using namespace OpenRCT2; using namespace OpenRCT2::Drawing; diff --git a/src/openrct2/drawing/NewDrawing.h b/src/openrct2/drawing/NewDrawing.h index 09effc0a34..0237f35780 100644 --- a/src/openrct2/drawing/NewDrawing.h +++ b/src/openrct2/drawing/NewDrawing.h @@ -16,13 +16,12 @@ #pragma once +#include "drawing.h" + #ifdef __cplusplus extern "C" { #endif - -#include "drawing.h" - extern rct_string_id DrawingEngineStringIds[3]; sint32 drawing_engine_get_type(); diff --git a/src/openrct2/drawing/Rain.cpp b/src/openrct2/drawing/Rain.cpp index a4361c6ebc..d9a46fe9b3 100644 --- a/src/openrct2/drawing/Rain.cpp +++ b/src/openrct2/drawing/Rain.cpp @@ -14,13 +14,10 @@ *****************************************************************************/ #pragma endregion -extern "C" -{ - #include "../interface/window.h" - #include "../world/Climate.h" - #include "drawing.h" - #include "../config/Config.h" -} +#include "../interface/window.h" +#include "../world/Climate.h" +#include "drawing.h" +#include "../config/Config.h" #include "IDrawingEngine.h" #include "Rain.h" diff --git a/src/openrct2/drawing/Rain.h b/src/openrct2/drawing/Rain.h index 97bfb60c91..3fbbc7c3ab 100644 --- a/src/openrct2/drawing/Rain.h +++ b/src/openrct2/drawing/Rain.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" namespace OpenRCT2 { namespace Drawing @@ -24,3 +26,5 @@ namespace OpenRCT2 { namespace Drawing } } void DrawRain(rct_drawpixelinfo * dpi, OpenRCT2::Drawing::IRainDrawer * rainDrawer); + +#endif diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 88953b4622..1644a6394e 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -26,16 +26,13 @@ #include "Rain.h" #include "X8DrawingEngine.h" -extern "C" -{ - #include "../game.h" - #include "../interface/viewport.h" - #include "../interface/window.h" - #include "../intro.h" - #include "../platform/platform.h" - #include "drawing.h" - #include "lightfx.h" -} +#include "../game.h" +#include "../interface/viewport.h" +#include "../interface/window.h" +#include "../intro.h" +#include "../platform/platform.h" +#include "drawing.h" +#include "lightfx.h" using namespace OpenRCT2; using namespace OpenRCT2::Drawing; diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index d9a0e52b55..6f4242f60e 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" #include "IDrawingContext.h" #include "IDrawingEngine.h" @@ -151,3 +153,5 @@ namespace OpenRCT2 }; } } + +#endif diff --git a/src/openrct2/drawing/drawing.h b/src/openrct2/drawing/drawing.h index 30a79012e5..28adf17bc2 100644 --- a/src/openrct2/drawing/drawing.h +++ b/src/openrct2/drawing/drawing.h @@ -256,6 +256,10 @@ typedef struct rct_size16 #define MAX_SCROLLING_TEXT_MODES 38 +#ifdef __cplusplus +extern "C" { +#endif + extern sint16 gCurrentFontSpriteBase; extern uint16 gCurrentFontFlags; @@ -369,6 +373,10 @@ sint32 scrolling_text_setup(paint_session * session, rct_string_id stringId, uin rct_size16 FASTCALL gfx_get_sprite_size(uint32 image_id); +#ifdef __cplusplus +} +#endif + #include "NewDrawing.h" #endif diff --git a/src/openrct2/drawing/font.h b/src/openrct2/drawing/font.h index 4b6180ab53..62f1b4b104 100644 --- a/src/openrct2/drawing/font.h +++ b/src/openrct2/drawing/font.h @@ -55,9 +55,20 @@ typedef struct TTFFontSetDescriptor { TTFFontDescriptor size[FONT_SIZE_COUNT]; } TTFFontSetDescriptor; +#ifdef __cplusplus +extern "C" { +#endif extern TTFFontSetDescriptor *gCurrentTTFFontSet; +#ifdef __cplusplus +} +#endif + #endif // NO_TTF +#ifdef __cplusplus +extern "C" { +#endif + void font_sprite_initialise_characters(); sint32 font_sprite_get_codepoint_offset(sint32 codepoint); sint32 font_sprite_get_codepoint_width(sint32 fontSpriteBase, sint32 codepoint); @@ -69,4 +80,8 @@ bool font_supports_string_sprite(const utf8 *text); bool font_supports_string_ttf(const utf8 *text, sint32 fontSize); bool font_supports_string(const utf8 *text, sint32 fontSize); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/drawing/lightfx.h b/src/openrct2/drawing/lightfx.h index 8ce397de1a..0c42c18e30 100644 --- a/src/openrct2/drawing/lightfx.h +++ b/src/openrct2/drawing/lightfx.h @@ -45,6 +45,10 @@ enum LIGHTFX_LIGHT_QUALIFIER { LIGHTFX_LIGHT_QUALIFIER_MAP = 0x2 }; +#ifdef __cplusplus +extern "C" { +#endif + void lightfx_init(); void lightfx_update_buffers(rct_drawpixelinfo*); @@ -75,6 +79,10 @@ void lightfx_render_to_texture( uint32 * palette, uint32 * lightPalette); +#ifdef __cplusplus +} +#endif + #endif // __ENABLE_LIGHTFX__ #endif diff --git a/src/openrct2/drawing/ttf.h b/src/openrct2/drawing/ttf.h index ea04cfe628..adc3046134 100644 --- a/src/openrct2/drawing/ttf.h +++ b/src/openrct2/drawing/ttf.h @@ -18,9 +18,17 @@ #include "font.h" +#ifdef __cplusplus +extern "C" { +#endif + bool ttf_initialise(); void ttf_dispose(); +#ifdef __cplusplus +} +#endif + #ifndef NO_TTF typedef struct TTFSurface { @@ -30,6 +38,10 @@ typedef struct TTFSurface { sint32 pitch; } TTFSurface; +#ifdef __cplusplus +extern "C" { +#endif + TTFFontDescriptor * ttf_get_font_from_sprite_base(uint16 spriteBase); TTFSurface * ttf_surface_cache_get_or_add(TTF_Font * font, const utf8 * text); uint32 ttf_getwidth_cache_get_or_add(TTF_Font * font, const utf8 * text); @@ -45,4 +57,8 @@ TTFSurface * TTF_RenderUTF8_Solid(TTF_Font *font, const char *text, uint32 colou void TTF_CloseFont(TTF_Font *font); void TTF_Quit(void); +#ifdef __cplusplus +} +#endif + #endif // NO_TTF diff --git a/src/openrct2/editor.h b/src/openrct2/editor.h index 898b409116..ffbf7bfc1a 100644 --- a/src/openrct2/editor.h +++ b/src/openrct2/editor.h @@ -55,6 +55,10 @@ enum EDIT_SCENARIOOPTIONS_SETGUESTGENERATIONHIGHERDIFFICULTLEVEL, }; +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 * gEditorSelectedObjects[OBJECT_ENTRY_GROUP_COUNT]; void editor_load(); @@ -72,4 +76,8 @@ bool editor_check_object_group_at_least_one_selected(sint32 objectType); void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/game.h b/src/openrct2/game.h index f8609c793d..1ecf724cbd 100644 --- a/src/openrct2/game.h +++ b/src/openrct2/game.h @@ -124,6 +124,10 @@ typedef void (GAME_COMMAND_POINTER)(sint32* eax, sint32* ebx, sint32* ecx, sint3 typedef void (GAME_COMMAND_CALLBACK_POINTER)(sint32 eax, sint32 ebx, sint32 ecx, sint32 edx, sint32 esi, sint32 edi, sint32 ebp); +#ifdef __cplusplus +extern "C" { +#endif + extern GAME_COMMAND_CALLBACK_POINTER* game_command_callback; sint32 game_command_callback_get_index(GAME_COMMAND_CALLBACK_POINTER* callback); GAME_COMMAND_CALLBACK_POINTER* game_command_callback_get_callback(sint32 index); @@ -189,4 +193,8 @@ void game_convert_strings_to_rct2(rct_s6_data *s6); void game_fix_save_vars(); void game_init_all(sint32 mapSize); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/input.h b/src/openrct2/input.h index 47c125f496..985979a612 100644 --- a/src/openrct2/input.h +++ b/src/openrct2/input.h @@ -76,6 +76,10 @@ typedef struct widget_ref { rct_widgetindex widget_index; } widget_ref; +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 gInputPlaceObjectModifier; extern sint32 gInputDragLastX; @@ -115,4 +119,8 @@ void reset_tooltip_not_shown(); void input_reset_place_obj_modifier(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/Fonts.cpp b/src/openrct2/interface/Fonts.cpp index 151f04da41..e10a06f127 100644 --- a/src/openrct2/interface/Fonts.cpp +++ b/src/openrct2/interface/Fonts.cpp @@ -20,12 +20,9 @@ #include "../localisation/LanguagePack.h" #include "Fonts.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../drawing/ttf.h" - #include "../localisation/language.h" -} +#include "../drawing/drawing.h" +#include "../drawing/ttf.h" +#include "../localisation/language.h" #ifndef NO_TTF static TTFFontSetDescriptor TTFFontMSGothic = { { diff --git a/src/openrct2/interface/Fonts.h b/src/openrct2/interface/Fonts.h index 0fe68a86ee..f40d83f2ba 100644 --- a/src/openrct2/interface/Fonts.h +++ b/src/openrct2/interface/Fonts.h @@ -17,16 +17,8 @@ #ifndef OPENRCT2_FONTS_H #define OPENRCT2_FONTS_H -#ifdef __cplusplus -extern "C" { -#endif - #include "../drawing/font.h" -#ifdef __cplusplus -} -#endif - void TryLoadFonts(); #endif // OPENRCT2_FONTS_H diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 29e9a1ba4c..b3e1e9e5cc 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -23,17 +23,14 @@ #include "../OpenRCT2.h" #include "Screenshot.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../game.h" - #include "../intro.h" - #include "../localisation/localisation.h" - #include "../platform/platform.h" - #include "../util/util.h" - #include "../windows/error.h" - #include "viewport.h" -} +#include "../drawing/drawing.h" +#include "../game.h" +#include "../intro.h" +#include "../localisation/localisation.h" +#include "../platform/platform.h" +#include "../util/util.h" +#include "../windows/error.h" +#include "viewport.h" using namespace OpenRCT2; diff --git a/src/openrct2/interface/Screenshot.h b/src/openrct2/interface/Screenshot.h index 02f7d9cf96..0fbcc3b6a1 100644 --- a/src/openrct2/interface/Screenshot.h +++ b/src/openrct2/interface/Screenshot.h @@ -16,12 +16,12 @@ #pragma once +#include "../drawing/drawing.h" + #ifdef __cplusplus extern "C" { #endif - #include "../drawing/drawing.h" - extern uint8 gScreenshotCountdown; void screenshot_check(); diff --git a/src/openrct2/interface/Theme.cpp b/src/openrct2/interface/Theme.cpp index 908e3771e2..ee834b8146 100644 --- a/src/openrct2/interface/Theme.cpp +++ b/src/openrct2/interface/Theme.cpp @@ -19,14 +19,11 @@ #include #include -extern "C" -{ - #include "../common.h" - #include "../config/Config.h" - #include "../platform/platform.h" - #include "themes.h" - #include "window.h" -} +#include "../common.h" +#include "../config/Config.h" +#include "../platform/platform.h" +#include "themes.h" +#include "window.h" #include "../core/Json.hpp" #include "../core/Math.hpp" diff --git a/src/openrct2/interface/chat.h b/src/openrct2/interface/chat.h index 946dbd7c56..b0d66241d9 100644 --- a/src/openrct2/interface/chat.h +++ b/src/openrct2/interface/chat.h @@ -32,6 +32,10 @@ typedef enum CHAT_INPUT CHAT_INPUT_CLOSE, } CHAT_INPUT; +#ifdef __cplusplus +extern "C" { +#endif + extern bool gChatOpen; void chat_open(); @@ -48,4 +52,8 @@ void chat_input(CHAT_INPUT input); sint32 chat_string_wrapped_get_height(void *args, sint32 width); sint32 chat_history_draw_string(rct_drawpixelinfo *dpi, void *args, sint32 x, sint32 y, sint32 width); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/colour.h b/src/openrct2/interface/colour.h index e89c4a352b..38e402434c 100644 --- a/src/openrct2/interface/colour.h +++ b/src/openrct2/interface/colour.h @@ -136,8 +136,16 @@ typedef struct rct_colour_map { uint8 colour_11; } rct_colour_map; +#ifdef __cplusplus +extern "C" { +#endif + extern rct_colour_map ColourMapA[COLOUR_COUNT]; void colours_init_maps(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/console.h b/src/openrct2/interface/console.h index b2bdec71ce..76dd0afaec 100644 --- a/src/openrct2/interface/console.h +++ b/src/openrct2/interface/console.h @@ -31,6 +31,10 @@ typedef enum CONSOLE_INPUT CONSOLE_INPUT_SCROLL_NEXT, } CONSOLE_INPUT; +#ifdef __cplusplus +extern "C" { +#endif + extern bool gConsoleOpen; void console_open(); @@ -53,4 +57,8 @@ void console_clear_line(); void console_refresh_caret(); void console_scroll(sint32 delta); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/graph.h b/src/openrct2/interface/graph.h index f060754768..f7f1edf4f9 100644 --- a/src/openrct2/interface/graph.h +++ b/src/openrct2/interface/graph.h @@ -20,7 +20,15 @@ #include "../common.h" #include "../drawing/drawing.h" +#ifdef __cplusplus +extern "C" { +#endif + void graph_draw_uint8(rct_drawpixelinfo *dpi, uint8 *history, sint32 count, sint32 baseX, sint32 baseY); void graph_draw_money32(rct_drawpixelinfo *dpi, money32 *history, sint32 count, sint32 baseX, sint32 baseY, sint32 modifier, sint32 offset); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/land_tool.h b/src/openrct2/interface/land_tool.h index 23204fc4cf..759b3616c4 100644 --- a/src/openrct2/interface/land_tool.h +++ b/src/openrct2/interface/land_tool.h @@ -18,12 +18,17 @@ #include "../common.h" #include "../sprites.h" +#include "window.h" #define MINIMUM_TOOL_SIZE 1 #define MAXIMUM_TOOL_SIZE 64 // The highest tool size to have a sprite. Bigger tool sizes simply display a number. #define MAX_TOOL_SIZE_WITH_SPRITE 7 +#ifdef __cplusplus +extern "C" { +#endif + extern uint16 gLandToolSize; extern money32 gLandToolRaiseCost; extern money32 gLandToolLowerCost; @@ -35,3 +40,7 @@ extern money32 gWaterToolLowerCost; uint32 land_tool_size_to_sprite_index(uint16 size); void land_tool_show_surface_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentSurfaceType); void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uint8 currentEdgeType); + +#ifdef __cplusplus +} +#endif diff --git a/src/openrct2/interface/themes.h b/src/openrct2/interface/themes.h index f215a54a88..2f9e34fea0 100644 --- a/src/openrct2/interface/themes.h +++ b/src/openrct2/interface/themes.h @@ -28,6 +28,10 @@ enum { UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR = 1 << 4, }; +#ifdef __cplusplus +extern "C" { +#endif + void colour_scheme_update(rct_window *window); void colour_scheme_update_all(); void colour_scheme_update_by_class(rct_window *window, rct_windowclass classification); @@ -52,4 +56,8 @@ void theme_delete(); uint8 theme_desc_get_num_colours(rct_windowclass wc); rct_string_id theme_desc_get_name(rct_windowclass wc); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/viewport.h b/src/openrct2/interface/viewport.h index ad14c52554..8d6aee2f80 100644 --- a/src/openrct2/interface/viewport.h +++ b/src/openrct2/interface/viewport.h @@ -89,6 +89,10 @@ typedef struct viewport_interaction_info { #define MAX_VIEWPORT_COUNT WINDOW_LIMIT_MAX +#ifdef __cplusplus +extern "C" { +#endif + /** * A reference counter for whether something is forcing the grid lines to show. When the counter * is decremented to 0, the grid lines are hidden. @@ -166,4 +170,8 @@ sint16 get_height_marker_offset(); void viewport_set_saved_view(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/widget.h b/src/openrct2/interface/widget.h index a6c3fde3c3..687a7aaf81 100644 --- a/src/openrct2/interface/widget.h +++ b/src/openrct2/interface/widget.h @@ -59,6 +59,11 @@ enum { SCROLL_BOTH = SCROLL_HORIZONTAL | SCROLL_VERTICAL }; + +#ifdef __cplusplus +extern "C" { +#endif + void widget_scroll_update_thumbs(rct_window *w, rct_widgetindex widget_index); void widget_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widgetindex widgetIndex); @@ -72,4 +77,9 @@ void widget_scroll_get_part(rct_window *w, rct_widget* widget, sint32 x, sint32 void widget_set_enabled(rct_window *w, rct_widgetindex widgetIndex, bool enabled); void widget_set_checkbox_value(rct_window *w, rct_widgetindex widgetIndex, sint32 value); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/interface/window.h b/src/openrct2/interface/window.h index 3861184959..a4a33285cb 100644 --- a/src/openrct2/interface/window.h +++ b/src/openrct2/interface/window.h @@ -38,6 +38,10 @@ typedef struct scenario_index_entry scenario_index_entry; #define TEXT_INPUT_SIZE 1024 #define TOP_TOOLBAR_HEIGHT 27 +#ifdef __cplusplus +extern "C" { +#endif + extern uint16 TextInputDescriptionArgs[4]; extern char gTextBoxInput[TEXT_INPUT_SIZE]; extern sint32 gMaxTextBoxInputLength; @@ -835,4 +839,9 @@ void window_ride_construction_keyboard_shortcut_demolish_current(); bool sub_6CA2DF(sint32 *trackType, sint32 *trackDirection, sint32 *rideIndex, sint32 *_liftHillAndAlternativeState, sint32 *x, sint32 *y, sint32 *z, sint32 *properties); money32 place_provisional_track_piece(sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 liftHillAndAlternativeState, sint32 x, sint32 y, sint32 z); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/intro.h b/src/openrct2/intro.h index 254f1e7345..f18d96b693 100644 --- a/src/openrct2/intro.h +++ b/src/openrct2/intro.h @@ -34,9 +34,17 @@ enum INTRO_STATE { INTRO_STATE_FINISH = 255, }; +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 gIntroState; void intro_update(); void intro_draw(rct_drawpixelinfo *dpi); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/localisation/Language.cpp b/src/openrct2/localisation/Language.cpp index 1509ef9531..8a0e904eea 100644 --- a/src/openrct2/localisation/Language.cpp +++ b/src/openrct2/localisation/Language.cpp @@ -24,11 +24,11 @@ #include "../object/ObjectManager.h" #include "LanguagePack.h" -extern "C" { - #include "../platform/platform.h" #include "localisation.h" +extern "C" { + sint32 gCurrentLanguage = LANGUAGE_UNDEFINED; bool gUseTrueTypeFont = false; diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index 15420b65f8..ad6b1fee01 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -17,11 +17,8 @@ #include #include -extern "C" -{ - #include "../common.h" - #include "localisation.h" -} +#include "../common.h" +#include "localisation.h" #include "../core/FileStream.hpp" #include "../core/Math.hpp" diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index c108575b84..a304ca07b1 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" enum @@ -56,3 +58,5 @@ namespace LanguagePackFactory ILanguagePack * FromFile(uint16 id, const utf8 * path); ILanguagePack * FromText(uint16 id, const utf8 * text); } + +#endif diff --git a/src/openrct2/localisation/currency.h b/src/openrct2/localisation/currency.h index 4c876f854e..c51ee69115 100644 --- a/src/openrct2/localisation/currency.h +++ b/src/openrct2/localisation/currency.h @@ -63,6 +63,10 @@ typedef struct currency_descriptor { rct_string_id stringId; } currency_descriptor; +#ifdef __cplusplus +extern "C" { +#endif + // List of currency formats extern currency_descriptor CurrencyDescriptors[CURRENCY_END]; @@ -72,4 +76,8 @@ extern currency_descriptor CurrencyDescriptors[CURRENCY_END]; */ void currency_load_custom_currency_config(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/localisation/date.h b/src/openrct2/localisation/date.h index 9866b25bd7..c64d25049e 100644 --- a/src/openrct2/localisation/date.h +++ b/src/openrct2/localisation/date.h @@ -45,6 +45,10 @@ typedef struct openrct_timeofday { uint8 hour; } openrct_timeofday; +#ifdef __cplusplus +extern "C" { +#endif + extern const sint16 days_in_month[MONTH_COUNT]; extern const rct_string_id DateFormatStringIds[]; extern const rct_string_id DateFormatStringFormatIds[]; @@ -60,4 +64,8 @@ sint32 date_get_total_months(sint32 month, sint32 year); void date_reset(); void date_update_real_time_of_day(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/localisation/format_codes.h b/src/openrct2/localisation/format_codes.h index 10940387fc..0f591917c4 100644 --- a/src/openrct2/localisation/format_codes.h +++ b/src/openrct2/localisation/format_codes.h @@ -17,9 +17,17 @@ #ifndef _FORMAT_CODES_H_ #define _FORMAT_CODES_H_ +#ifdef __cplusplus +extern "C" { +#endif + uint32 format_get_code(const char *token); const char *format_get_token(uint32 code); +#ifdef __cplusplus +} +#endif + enum { // Font format codes diff --git a/src/openrct2/localisation/language.h b/src/openrct2/localisation/language.h index 05735d83a2..1e76a06113 100644 --- a/src/openrct2/localisation/language.h +++ b/src/openrct2/localisation/language.h @@ -59,6 +59,10 @@ typedef struct language_descriptor { uint8 rct2_original_id; } language_descriptor; +#ifdef __cplusplus +extern "C" { +#endif + extern const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT]; extern sint32 gCurrentLanguage; @@ -90,4 +94,8 @@ rct_string_id language_allocate_object_string(const utf8 * target); void language_free_object_string(rct_string_id stringId); rct_string_id language_get_object_override_string_id(const char * identifier, uint8 index); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/localisation/localisation.h b/src/openrct2/localisation/localisation.h index b1a3830b26..f33a6e6eb1 100644 --- a/src/openrct2/localisation/localisation.h +++ b/src/openrct2/localisation/localisation.h @@ -24,6 +24,10 @@ #include "string_ids.h" #include "../management/marketing.h" +#ifdef __cplusplus +extern "C" { +#endif + bool utf8_is_format_code(sint32 codepoint); bool utf8_is_colour_code(sint32 codepoint); bool utf8_should_use_sprite_for_codepoint(sint32 codepoint); @@ -87,6 +91,10 @@ extern const rct_string_id DateDayNames[31]; extern const rct_string_id DateGameMonthNames[MONTH_COUNT]; extern const rct_string_id DateGameShortMonthNames[MONTH_COUNT]; +#ifdef __cplusplus +} +#endif + static inline void set_format_arg_body(uint8 *args, size_t offset, uintptr_t value, size_t size) { memcpy(args + offset, &value, size); diff --git a/src/openrct2/localisation/user.h b/src/openrct2/localisation/user.h index 5fe3ce3535..bd7beaf168 100644 --- a/src/openrct2/localisation/user.h +++ b/src/openrct2/localisation/user.h @@ -14,4 +14,9 @@ *****************************************************************************/ #pragma endregion +#ifndef USER_H +#define USER_H + void reset_user_strings(); + +#endif // USER_H \ No newline at end of file diff --git a/src/openrct2/management/finance.h b/src/openrct2/management/finance.h index c9dba0c5a5..931ac3a071 100644 --- a/src/openrct2/management/finance.h +++ b/src/openrct2/management/finance.h @@ -42,6 +42,10 @@ enum { #define EXPENDITURE_TABLE_MONTH_COUNT 16 #define EXPENDITURE_TABLE_TOTAL_COUNT (EXPENDITURE_TABLE_MONTH_COUNT * RCT_EXPENDITURE_TYPE_COUNT) +#ifdef __cplusplus +extern "C" { +#endif + extern const money32 research_cost_table[4]; extern const money32 wage_table[4]; @@ -88,4 +92,8 @@ void game_command_set_current_loan(sint32* eax, sint32* ebx, sint32* ecx, sint32 money32 finance_get_last_month_shop_profit(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/management/marketing.h b/src/openrct2/management/marketing.h index ecaa9c51ba..16d4d5e1d1 100644 --- a/src/openrct2/management/marketing.h +++ b/src/openrct2/management/marketing.h @@ -40,6 +40,10 @@ enum{ #define CAMPAIGN_ACTIVE_FLAG (1 << 7) +#ifdef __cplusplus +extern "C" { +#endif + extern const money16 AdvertisingCampaignPricePerWeek[ADVERTISING_CAMPAIGN_COUNT]; extern uint8 gMarketingCampaignDaysLeft[20]; extern uint8 gMarketingCampaignRideIndex[22]; @@ -52,4 +56,8 @@ void marketing_start_campaign(sint32 type, sint32 rideOrItem, sint32 numWeeks); void game_command_start_campaign(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp); bool marketing_is_campaign_type_applicable(sint32 campaignType); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/management/news_item.h b/src/openrct2/management/news_item.h index 66b8b117d7..0ac80bf95a 100644 --- a/src/openrct2/management/news_item.h +++ b/src/openrct2/management/news_item.h @@ -41,8 +41,6 @@ enum { NEWS_FLAG_HAS_BUTTON = 1 << 0, }; -extern const uint8 news_type_properties[10]; - /** * A single news item / message. */ @@ -58,6 +56,12 @@ typedef struct NewsItem { #define MAX_NEWS_ITEMS 61 +#ifdef __cplusplus +extern "C" { +#endif + +extern const uint8 news_type_properties[10]; + extern NewsItem gNewsItems[MAX_NEWS_ITEMS]; void news_item_init_queue(); @@ -75,4 +79,8 @@ bool news_item_is_valid_idx(sint32 index); void news_item_add_to_queue_custom(NewsItem *newNewsItem); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/management/research.h b/src/openrct2/management/research.h index f2631e5f2a..b1a552e671 100644 --- a/src/openrct2/management/research.h +++ b/src/openrct2/management/research.h @@ -71,6 +71,10 @@ enum { RESEARCH_CATEGORY_SCENERYSET }; +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 gResearchFundingLevel; extern uint8 gResearchPriorities; extern uint16 gResearchProgress; @@ -115,4 +119,8 @@ bool scenery_is_invented(uint16 sceneryItem); void reset_researched_scenery_items(); void reset_researched_ride_types_and_entries(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/network/Http.cpp b/src/openrct2/network/Http.cpp index a930df2278..67b7bd0938 100644 --- a/src/openrct2/network/Http.cpp +++ b/src/openrct2/network/Http.cpp @@ -16,9 +16,7 @@ #include -extern "C" { - #include "http.h" -} +#include "http.h" #ifdef DISABLE_HTTP diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index 906cd223cc..42738be2a6 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -21,10 +21,8 @@ #include "../ui/UiContext.h" #include "../ui/WindowManager.h" -extern "C" { - #include "../platform/platform.h" - #include "../util/sawyercoding.h" -} +#include "../platform/platform.h" +#include "../util/sawyercoding.h" #include "network.h" diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index a96bfe0916..4ebc3359ce 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -19,11 +19,8 @@ #include #include "NetworkAction.h" -extern "C" -{ - #include "../game.h" - #include "../localisation/string_ids.h" -} +#include "../game.h" +#include "../localisation/string_ids.h" sint32 NetworkActions::FindCommand(sint32 command) { diff --git a/src/openrct2/network/NetworkAction.h b/src/openrct2/network/NetworkAction.h index 1ea9c2c442..83827849b2 100644 --- a/src/openrct2/network/NetworkAction.h +++ b/src/openrct2/network/NetworkAction.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "../common.h" @@ -43,3 +45,5 @@ public: static sint32 FindCommand(sint32 command); static sint32 FindCommandByPermissionName(const std::string &permission_name); }; + +#endif diff --git a/src/openrct2/network/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index c39d537a74..e985ac0b76 100644 --- a/src/openrct2/network/NetworkConnection.cpp +++ b/src/openrct2/network/NetworkConnection.cpp @@ -20,11 +20,8 @@ #include "NetworkConnection.h" #include "../core/String.hpp" -extern "C" -{ - #include "../localisation/localisation.h" - #include "../platform/platform.h" -} +#include "../localisation/localisation.h" +#include "../platform/platform.h" constexpr size_t NETWORK_DISCONNECT_REASON_BUFFER_SIZE = 256; diff --git a/src/openrct2/network/NetworkConnection.h b/src/openrct2/network/NetworkConnection.h index 1d40eca766..3186dc3890 100644 --- a/src/openrct2/network/NetworkConnection.h +++ b/src/openrct2/network/NetworkConnection.h @@ -16,6 +16,9 @@ #pragma once +#ifdef __cplusplus + +#ifndef DISABLE_NETWORK #include #include #include @@ -62,3 +65,6 @@ private: bool SendPacket(NetworkPacket &packet); }; + +#endif // DISABLE_NETWORK +#endif diff --git a/src/openrct2/network/NetworkGroup.h b/src/openrct2/network/NetworkGroup.h index 79d38ef634..96ec6fdb88 100644 --- a/src/openrct2/network/NetworkGroup.h +++ b/src/openrct2/network/NetworkGroup.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include @@ -47,3 +49,5 @@ public: private: std::string _name; }; + +#endif diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index 938719d5e2..570ae82611 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -19,6 +19,8 @@ #ifndef DISABLE_NETWORK +#ifdef __cplusplus + #include "../common.h" #include @@ -49,6 +51,8 @@ private: EVP_PKEY * _key = nullptr; }; +#endif + #endif // DISABLE_NETWORK #endif // NETWORKKEY_H diff --git a/src/openrct2/network/NetworkPacket.h b/src/openrct2/network/NetworkPacket.h index bebc8dde7f..683720e890 100644 --- a/src/openrct2/network/NetworkPacket.h +++ b/src/openrct2/network/NetworkPacket.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "NetworkTypes.h" @@ -67,3 +69,5 @@ public: return *this; } }; + +#endif diff --git a/src/openrct2/network/NetworkPlayer.cpp b/src/openrct2/network/NetworkPlayer.cpp index fe5312169e..c27ac8ef54 100644 --- a/src/openrct2/network/NetworkPlayer.cpp +++ b/src/openrct2/network/NetworkPlayer.cpp @@ -19,11 +19,8 @@ #include "NetworkPacket.h" #include "NetworkPlayer.h" -extern "C" -{ - #include "../interface/window.h" - #include "../localisation/localisation.h" -} +#include "../interface/window.h" +#include "../localisation/localisation.h" void NetworkPlayer::SetName(const std::string &name) { diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index 631f08c4bc..a4323cdd97 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -16,15 +16,14 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" -extern "C" -{ - #include "../peep/peep.h" - #include "../world/map.h" - #include "../world/sprite.h" -} +#include "../peep/peep.h" +#include "../world/map.h" +#include "../world/sprite.h" class NetworkPacket; @@ -55,3 +54,5 @@ public: void Write(NetworkPacket &packet); void AddMoneySpent(money32 cost); }; + +#endif diff --git a/src/openrct2/network/NetworkServerAdvertiser.cpp b/src/openrct2/network/NetworkServerAdvertiser.cpp index 0b29399182..b75535ecb7 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.cpp +++ b/src/openrct2/network/NetworkServerAdvertiser.cpp @@ -23,18 +23,15 @@ #include "network.h" #include "NetworkServerAdvertiser.h" -extern "C" -{ - #include "../config/Config.h" - #include "../localisation/date.h" - #include "../management/finance.h" - #include "../peep/peep.h" - #include "../platform/platform.h" - #include "../util/util.h" - #include "../world/map.h" - #include "../world/park.h" - #include "http.h" -} +#include "../config/Config.h" +#include "../localisation/date.h" +#include "../management/finance.h" +#include "../peep/peep.h" +#include "../platform/platform.h" +#include "../util/util.h" +#include "../world/map.h" +#include "../world/park.h" +#include "http.h" enum MASTER_SERVER_STATUS { diff --git a/src/openrct2/network/NetworkServerAdvertiser.h b/src/openrct2/network/NetworkServerAdvertiser.h index 90df8a8151..9edda6c876 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.h +++ b/src/openrct2/network/NetworkServerAdvertiser.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" enum ADVERTISE_STATUS @@ -34,3 +36,5 @@ interface INetworkServerAdvertiser }; INetworkServerAdvertiser * CreateServerAdvertiser(uint16 port); + +#endif diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index 1fa2343c31..de20d9e158 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -24,10 +24,7 @@ #include "../core/String.hpp" #include "NetworkUser.h" -extern "C" -{ - #include "../platform/platform.h" -} +#include "../platform/platform.h" constexpr const utf8 * USER_STORE_FILENAME = "users.json"; diff --git a/src/openrct2/network/NetworkUser.h b/src/openrct2/network/NetworkUser.h index 00d22bccbb..bb62174545 100644 --- a/src/openrct2/network/NetworkUser.h +++ b/src/openrct2/network/NetworkUser.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" #include "../core/Nullable.hpp" @@ -66,3 +68,5 @@ private: void DisposeUsers(); static void GetStorePath(utf8 * buffer, size_t bufferSize); }; + +#endif diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index 21258289f7..25f4292572 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -19,10 +19,7 @@ #include "../core/String.hpp" #include "ServerList.h" -extern "C" -{ - #include "../platform/platform.h" -} +#include "../platform/platform.h" extern "C" { diff --git a/src/openrct2/network/TcpSocket.h b/src/openrct2/network/TcpSocket.h index 895928dd00..7c686f3e8a 100644 --- a/src/openrct2/network/TcpSocket.h +++ b/src/openrct2/network/TcpSocket.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" enum SOCKET_STATUS @@ -71,3 +73,5 @@ namespace Convert uint16 HostToNetwork(uint16 value); uint16 NetworkToHost(uint16 value); } + +#endif diff --git a/src/openrct2/network/Twitch.cpp b/src/openrct2/network/Twitch.cpp index 7452834093..9643fed694 100644 --- a/src/openrct2/network/Twitch.cpp +++ b/src/openrct2/network/Twitch.cpp @@ -16,10 +16,7 @@ #ifdef DISABLE_TWITCH - extern "C" - { - #include "twitch.h" - } + #include "twitch.h" void twitch_update() { } @@ -34,21 +31,18 @@ #include "../core/String.hpp" #include "../OpenRCT2.h" -extern "C" -{ - #include "../config/Config.h" - #include "../drawing/drawing.h" - #include "../game.h" - #include "../interface/console.h" - #include "../localisation/localisation.h" - #include "../management/news_item.h" - #include "../peep/peep.h" - #include "../platform/platform.h" - #include "../util/util.h" - #include "../world/sprite.h" - #include "http.h" - #include "twitch.h" -} +#include "../config/Config.h" +#include "../drawing/drawing.h" +#include "../game.h" +#include "../interface/console.h" +#include "../localisation/localisation.h" +#include "../management/news_item.h" +#include "../peep/peep.h" +#include "../platform/platform.h" +#include "../util/util.h" +#include "../world/sprite.h" +#include "http.h" +#include "twitch.h" bool gTwitchEnable = false; diff --git a/src/openrct2/network/http.h b/src/openrct2/network/http.h index e9ca9ea572..c947b1e0a2 100644 --- a/src/openrct2/network/http.h +++ b/src/openrct2/network/http.h @@ -17,6 +17,8 @@ #ifndef _HTTP_H_ #define _HTTP_H_ +#ifdef __cplusplus + #ifndef DISABLE_HTTP #include #include "../common.h" @@ -75,3 +77,5 @@ void http_init(); void http_dispose(); #endif + +#endif diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 29ad09a50e..366b15af2c 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -37,15 +37,9 @@ enum { #define NETWORK_DEFAULT_PORT 11753 #define MAX_SERVER_DESCRIPTION_LENGTH 256 -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus #include "../common.h" #include "../game.h" #include "../localisation/string_ids.h" -#ifdef __cplusplus -} -#endif // __cplusplus #include "../Version.h" #include "NetworkTypes.h" diff --git a/src/openrct2/network/twitch.h b/src/openrct2/network/twitch.h index 87dc80464e..8554019209 100644 --- a/src/openrct2/network/twitch.h +++ b/src/openrct2/network/twitch.h @@ -19,8 +19,16 @@ #include "../common.h" +#ifdef __cplusplus +extern "C" { +#endif + extern bool gTwitchEnable; void twitch_update(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/object.h b/src/openrct2/object.h index 4435aaf83e..92965f6778 100644 --- a/src/openrct2/object.h +++ b/src/openrct2/object.h @@ -91,9 +91,6 @@ typedef struct rct_object_entry_extended { } rct_object_entry_extended; assert_struct_size(rct_object_entry_extended, 0x14); -extern sint32 object_entry_group_counts[]; -extern sint32 object_entry_group_encoding[]; - typedef struct rct_object_entry_group { void **chunks; rct_object_entry_extended *entries; @@ -116,6 +113,13 @@ typedef struct rct_object_filters { assert_struct_size(rct_object_filters, 3); #pragma pack(pop) +#ifdef __cplusplus +extern "C" { +#endif + +extern sint32 object_entry_group_counts[]; +extern sint32 object_entry_group_encoding[]; + extern const rct_object_entry_group object_entry_groups[]; void object_list_load(); @@ -132,4 +136,8 @@ const rct_object_entry * object_list_find(rct_object_entry *entry); void object_entry_get_name(utf8 * buffer, size_t bufferSize, const rct_object_entry * entry); void object_entry_get_name_fixed(utf8 * buffer, size_t bufferSize, const rct_object_entry * entry); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/object/BannerObject.cpp b/src/openrct2/object/BannerObject.cpp index c078deba0e..a32c732a8b 100644 --- a/src/openrct2/object/BannerObject.cpp +++ b/src/openrct2/object/BannerObject.cpp @@ -18,11 +18,8 @@ #include "../core/Memory.hpp" #include "BannerObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" void BannerObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/BannerObject.h b/src/openrct2/object/BannerObject.h index 5ffb72aa29..4f69c25963 100644 --- a/src/openrct2/object/BannerObject.h +++ b/src/openrct2/object/BannerObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "SceneryObject.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" class BannerObject final : public SceneryObject { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index 96ccdf0dc8..a200f105bc 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -18,11 +18,8 @@ #include "../core/String.hpp" #include "EntranceObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" void EntranceObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/EntranceObject.h b/src/openrct2/object/EntranceObject.h index ae3a66734d..326fa3c4a3 100644 --- a/src/openrct2/object/EntranceObject.h +++ b/src/openrct2/object/EntranceObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../world/entrance.h" -} +#include "../world/entrance.h" class EntranceObject final : public Object { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object/FootpathItemObject.cpp b/src/openrct2/object/FootpathItemObject.cpp index 4de95dd058..1c419a43e3 100644 --- a/src/openrct2/object/FootpathItemObject.cpp +++ b/src/openrct2/object/FootpathItemObject.cpp @@ -17,11 +17,8 @@ #include "../core/IStream.hpp" #include "FootpathItemObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" void FootpathItemObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/FootpathItemObject.h b/src/openrct2/object/FootpathItemObject.h index 9d49fa4c81..545c114ea4 100644 --- a/src/openrct2/object/FootpathItemObject.h +++ b/src/openrct2/object/FootpathItemObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "SceneryObject.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" class FootpathItemObject final : public SceneryObject { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object/FootpathObject.cpp b/src/openrct2/object/FootpathObject.cpp index 454c91bd5c..24ebe52e3e 100644 --- a/src/openrct2/object/FootpathObject.cpp +++ b/src/openrct2/object/FootpathObject.cpp @@ -17,12 +17,9 @@ #include "../core/IStream.hpp" #include "FootpathObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" - #include "../world/footpath.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" +#include "../world/footpath.h" void FootpathObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/FootpathObject.h b/src/openrct2/object/FootpathObject.h index 47bfdc789e..8bd9eb1905 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../world/footpath.h" -} +#include "../world/footpath.h" class FootpathObject final : public Object { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object/ImageTable.h b/src/openrct2/object/ImageTable.h index 235d649fdf..c4641802ab 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -16,13 +16,12 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" -extern "C" -{ - #include "../drawing/drawing.h" -} +#include "../drawing/drawing.h" interface IReadObjectContext; interface IStream; @@ -41,3 +40,5 @@ public: const rct_g1_element * GetImages() const { return _entries.data(); } uint32 GetCount() const { return (uint32)_entries.size(); } }; + +#endif diff --git a/src/openrct2/object/LargeSceneryObject.cpp b/src/openrct2/object/LargeSceneryObject.cpp index 7dc6c061ce..da420d1f1c 100644 --- a/src/openrct2/object/LargeSceneryObject.cpp +++ b/src/openrct2/object/LargeSceneryObject.cpp @@ -18,11 +18,8 @@ #include "../core/Memory.hpp" #include "LargeSceneryObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" LargeSceneryObject::~LargeSceneryObject() { diff --git a/src/openrct2/object/LargeSceneryObject.h b/src/openrct2/object/LargeSceneryObject.h index 6f37879a1c..b4e75eecd0 100644 --- a/src/openrct2/object/LargeSceneryObject.h +++ b/src/openrct2/object/LargeSceneryObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "SceneryObject.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" class LargeSceneryObject final : public SceneryObject { @@ -46,3 +45,5 @@ public: private: static rct_large_scenery_tile * ReadTiles(IStream * stream); }; + +#endif diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 4687973e12..8303b394d8 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -18,10 +18,7 @@ #include "../core/String.hpp" #include "Object.h" -extern "C" -{ - #include "../localisation/localisation.h" -} +#include "../localisation/localisation.h" Object::Object(const rct_object_entry &entry) { diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 5b4e8d66cf..ebefed7c59 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -16,14 +16,13 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" #include "ImageTable.h" #include "StringTable.h" -extern "C" -{ - #include "../object.h" -} +#include "../object.h" enum OBJ_STRING_ID { @@ -94,3 +93,5 @@ enum OBJECT_ERROR : uint32 OBJECT_ERROR_BAD_IMAGE_TABLE, OBJECT_ERROR_UNEXPECTED_EOF, }; + +#endif diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index f8d3e05a6d..18f1dabc3a 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -35,11 +35,8 @@ #include "WallObject.h" #include "WaterObject.h" -extern "C" -{ - #include "../object.h" - #include "../util/sawyercoding.h" -} +#include "../object.h" +#include "../util/sawyercoding.h" class ReadObjectContext : public IReadObjectContext { diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index c8b1793f1d..d375d051d1 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" class Object; @@ -26,3 +28,5 @@ namespace ObjectFactory Object * CreateObjectFromLegacyData(const rct_object_entry * entry, const void * data, size_t dataSize); Object * CreateObject(const rct_object_entry &entry); } + +#endif diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index f4885539bd..295f60cc09 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -29,10 +29,7 @@ #include "SmallSceneryObject.h" #include "WallObject.h" -extern "C" -{ - #include "../object_list.h" -} +#include "../object_list.h" class ObjectManager final : public IObjectManager { diff --git a/src/openrct2/object/ObjectManager.h b/src/openrct2/object/ObjectManager.h index 2ee35a1375..ad5c0d64bd 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -20,16 +20,8 @@ #include #endif - -#ifdef __cplusplus -extern "C" -{ -#endif - #include "../common.h" - #include "../object.h" -#ifdef __cplusplus -} -#endif +#include "../common.h" +#include "../object.h" #ifdef __cplusplus diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 3bc47ff295..2445ddfced 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -40,16 +40,13 @@ #include "RideObject.h" #include "StexObject.h" -extern "C" -{ - #include "../config/Config.h" - #include "../localisation/localisation.h" - #include "../object.h" - #include "../object_list.h" - #include "../platform/platform.h" - #include "../util/sawyercoding.h" - #include "../util/util.h" -} +#include "../config/Config.h" +#include "../localisation/localisation.h" +#include "../object.h" +#include "../object_list.h" +#include "../platform/platform.h" +#include "../util/sawyercoding.h" +#include "../util/util.h" using namespace OpenRCT2; diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index af15504c20..8669d08c00 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -22,15 +22,8 @@ #include "../common.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "../object.h" - #include "../ride/ride.h" -#ifdef __cplusplus -} -#endif +#include "../object.h" +#include "../ride/ride.h" #ifdef __cplusplus interface IStream; diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 90400105b0..e227ba3567 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -23,15 +23,12 @@ #include "RideObject.h" #include "../ride/RideGroupManager.h" -extern "C" -{ - #include "../config/Config.h" - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" - #include "../rct1.h" - #include "../ride/ride.h" - #include "../ride/track.h" -} +#include "../config/Config.h" +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" +#include "../rct1.h" +#include "../ride/ride.h" +#include "../ride/track.h" RideObject::~RideObject() { diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index f260caa89d..97752303f2 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../ride/ride.h" -} +#include "../ride/ride.h" class RideObject final : public Object { @@ -55,3 +54,5 @@ private: static uint8 CalculateNumVerticalFrames(const rct_ride_entry_vehicle * vehicleEntry); static uint8 CalculateNumHorizontalFrames(const rct_ride_entry_vehicle * vehicleEntry); }; + +#endif diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 247d407694..fe20b0f63f 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -20,11 +20,8 @@ #include "ObjectRepository.h" #include "SceneryGroupObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" SceneryGroupObject::~SceneryGroupObject() { diff --git a/src/openrct2/object/SceneryGroupObject.h b/src/openrct2/object/SceneryGroupObject.h index 1c2048b2c5..a2247d44bf 100644 --- a/src/openrct2/object/SceneryGroupObject.h +++ b/src/openrct2/object/SceneryGroupObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" struct ObjectRepositoryItem; @@ -50,3 +49,5 @@ public: private: void ReadItems(IStream * stream); }; + +#endif diff --git a/src/openrct2/object/SceneryObject.h b/src/openrct2/object/SceneryObject.h index d08c6d9e4b..d3c16b6f8a 100644 --- a/src/openrct2/object/SceneryObject.h +++ b/src/openrct2/object/SceneryObject.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" class SceneryObject : public Object @@ -32,3 +34,5 @@ public: protected: void SetPrimarySceneryGroup(const rct_object_entry * entry) { _primarySceneryGroupEntry = *entry; } }; + +#endif diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 5e13248847..725c782e97 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -19,11 +19,8 @@ #include "../core/Memory.hpp" #include "SmallSceneryObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" SmallSceneryObject::~SmallSceneryObject() { diff --git a/src/openrct2/object/SmallSceneryObject.h b/src/openrct2/object/SmallSceneryObject.h index aa2c5c2a49..ee7a7a869a 100644 --- a/src/openrct2/object/SmallSceneryObject.h +++ b/src/openrct2/object/SmallSceneryObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "SceneryObject.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" class SmallSceneryObject final : public SceneryObject { @@ -44,3 +43,5 @@ public: private: static uint8 * ReadFrameOffsets(IStream * stream); }; + +#endif diff --git a/src/openrct2/object/StexObject.cpp b/src/openrct2/object/StexObject.cpp index f702ab0767..2ee3451029 100644 --- a/src/openrct2/object/StexObject.cpp +++ b/src/openrct2/object/StexObject.cpp @@ -17,10 +17,7 @@ #include "../core/IStream.hpp" #include "StexObject.h" -extern "C" -{ - #include "../localisation/localisation.h" -} +#include "../localisation/localisation.h" void StexObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/StexObject.h b/src/openrct2/object/StexObject.h index 0bc274bab7..c12b1379c3 100644 --- a/src/openrct2/object/StexObject.h +++ b/src/openrct2/object/StexObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../scenario/scenario.h" -} +#include "../scenario/scenario.h" class StexObject final : public Object { @@ -45,3 +44,5 @@ public: const utf8 * GetScenarioDetails() const; const utf8 * GetParkName() const; }; + +#endif diff --git a/src/openrct2/object/StringTable.cpp b/src/openrct2/object/StringTable.cpp index 8c76e1953b..8da8351d49 100644 --- a/src/openrct2/object/StringTable.cpp +++ b/src/openrct2/object/StringTable.cpp @@ -21,10 +21,7 @@ #include "Object.h" #include "StringTable.h" -extern "C" -{ - #include "../localisation/localisation.h" -} +#include "../localisation/localisation.h" static bool StringIsBlank(utf8 * str) { diff --git a/src/openrct2/object/StringTable.h b/src/openrct2/object/StringTable.h index 9262e90289..690575abe8 100644 --- a/src/openrct2/object/StringTable.h +++ b/src/openrct2/object/StringTable.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" @@ -41,3 +43,5 @@ public: void Sort(); const utf8 * GetString(uint8 id) const; }; + +#endif diff --git a/src/openrct2/object/WallObject.cpp b/src/openrct2/object/WallObject.cpp index b5c157c169..e799d45706 100644 --- a/src/openrct2/object/WallObject.cpp +++ b/src/openrct2/object/WallObject.cpp @@ -18,11 +18,8 @@ #include "../core/Memory.hpp" #include "WallObject.h" -extern "C" -{ - #include "../drawing/drawing.h" - #include "../localisation/localisation.h" -} +#include "../drawing/drawing.h" +#include "../localisation/localisation.h" void WallObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/WallObject.h b/src/openrct2/object/WallObject.h index fa8f208619..ef7fc28c59 100644 --- a/src/openrct2/object/WallObject.h +++ b/src/openrct2/object/WallObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "SceneryObject.h" -extern "C" -{ - #include "../world/scenery.h" -} +#include "../world/scenery.h" class WallObject final : public SceneryObject { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index 64e79179d8..1d7b464153 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -18,10 +18,7 @@ #include "../OpenRCT2.h" #include "WaterObject.h" -extern "C" -{ - #include "../localisation/localisation.h" -} +#include "../localisation/localisation.h" void WaterObject::ReadLegacy(IReadObjectContext * context, IStream * stream) { diff --git a/src/openrct2/object/WaterObject.h b/src/openrct2/object/WaterObject.h index 468a6c211a..ecc69a6a91 100644 --- a/src/openrct2/object/WaterObject.h +++ b/src/openrct2/object/WaterObject.h @@ -16,12 +16,11 @@ #pragma once +#ifdef __cplusplus + #include "Object.h" -extern "C" -{ - #include "../world/water.h" -} +#include "../world/water.h" class WaterObject final : public Object { @@ -39,3 +38,5 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; + +#endif diff --git a/src/openrct2/object_list.h b/src/openrct2/object_list.h index 5504bce22c..4695475b94 100644 --- a/src/openrct2/object_list.h +++ b/src/openrct2/object_list.h @@ -8,6 +8,10 @@ #include "world/scenery.h" #include "world/water.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef NO_RCT2 extern rct_ride_entry *gRideEntries[128]; extern rct_small_scenery_entry *gSmallSceneryEntries[252]; @@ -39,3 +43,7 @@ void get_type_entry_index(size_t index, uint8 * outObjectType, uint8 * outEntryIndex); const rct_object_entry * get_loaded_object_entry(size_t index); void * get_loaded_object_chunk(size_t index); + +#ifdef __cplusplus +} +#endif diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index b8000da75d..7133f6322f 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -14,7 +14,9 @@ *****************************************************************************/ #pragma endregion -#include +#ifdef __cplusplus + +#include #include "../common.h" struct rct_drawpixelinfo; @@ -52,3 +54,5 @@ namespace OpenRCT2 }; } } + +#endif diff --git a/src/openrct2/paint/map_element/map_element.h b/src/openrct2/paint/map_element/map_element.h index 95a5a7d0ca..92bc44fb0b 100644 --- a/src/openrct2/paint/map_element/map_element.h +++ b/src/openrct2/paint/map_element/map_element.h @@ -48,9 +48,6 @@ enum SEGMENT_C4 = (1 << 8), // 4 }; -extern const sint32 SEGMENTS_ALL; -extern const uint16 segment_offsets[9]; - enum { TUNNEL_0 = 0, @@ -77,10 +74,17 @@ enum G141E9DB_FLAG_2 = 2, }; +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __TESTPAINT__ extern uint16 testPaintVerticalTunnelHeight; #endif +extern const sint32 SEGMENTS_ALL; +extern const uint16 segment_offsets[9]; + extern bool gShowSupportSegmentHeights; extern const rct_xy16 BannerBoundBoxes[][2]; @@ -105,4 +109,8 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma void scenery_multiple_paint(paint_session * session, uint8 direction, uint16 height, rct_map_element *mapElement); void track_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element *mapElement); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/paint/paint.h b/src/openrct2/paint/paint.h index 14effd694e..51e4236323 100644 --- a/src/openrct2/paint/paint.h +++ b/src/openrct2/paint/paint.h @@ -23,9 +23,6 @@ #include "../interface/colour.h" #include "../drawing/drawing.h" -// Global for paint clipping height. -extern uint8 gClipHeight; - typedef struct attached_paint_struct attached_paint_struct; typedef struct paint_struct paint_struct; @@ -204,6 +201,13 @@ extern paint_session gPaintSession; #define gTrackColours RCT2_ADDRESS(0x00F44198, uint32) #endif +#ifdef __cplusplus +extern "C" { +#endif + +// Global for paint clipping height. +extern uint8 gClipHeight; + /** rct2: 0x00993CC4 */ extern const uint32 construction_markers[]; extern bool gShowDirtyVisuals; @@ -246,4 +250,8 @@ void paint_draw_money_structs(rct_drawpixelinfo * dpi, paint_string_struct * ps) #define TESTPAINT_IGNORE_ALL() #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/peep/peep.h b/src/openrct2/peep/peep.h index 90d787d018..cd107ead2d 100644 --- a/src/openrct2/peep/peep.h +++ b/src/openrct2/peep/peep.h @@ -649,8 +649,6 @@ typedef struct rct_peep_animation_entry { const rct_sprite_bounds *sprite_bounds; // 0x04 } rct_peep_animation_entry; -// rct2: 0x00982708 -extern rct_peep_animation_entry g_peep_animation_entries[PEEP_SPRITE_TYPE_COUNT]; enum { EASTEREGG_PEEP_NAME_MICHAEL_SCHUMACHER, @@ -698,6 +696,13 @@ enum { FOR_ALL_PEEPS(sprite_index, peep) \ if (peep->type == PEEP_TYPE_STAFF) +#ifdef __cplusplus +extern "C" { +#endif + +// rct2: 0x00982708 +extern rct_peep_animation_entry g_peep_animation_entries[PEEP_SPRITE_TYPE_COUNT]; + extern uint8 gGuestChangeModifier; extern uint16 gNumGuestsInPark; extern uint16 gNumGuestsInParkLastWeek; @@ -792,4 +797,8 @@ void increment_guests_heading_for_park(); void decrement_guests_in_park(); void decrement_guests_heading_for_park(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/peep/staff.h b/src/openrct2/peep/staff.h index 6bee4a3d2c..dabe3a7493 100644 --- a/src/openrct2/peep/staff.h +++ b/src/openrct2/peep/staff.h @@ -65,6 +65,10 @@ enum ENTERTAINER_COSTUME { ENTERTAINER_COSTUME_COUNT }; +#ifdef __cplusplus +extern "C" { +#endif + extern const rct_string_id StaffCostumeNames[ENTERTAINER_COSTUME_COUNT]; extern uint32 gStaffPatrolAreas[(STAFF_MAX_COUNT + STAFF_TYPE_COUNT) * STAFF_PATROL_AREA_SIZE]; @@ -100,4 +104,8 @@ bool staff_set_colour(uint8 staffType, colour_t value); uint32 staff_get_available_entertainer_costumes(); sint32 staff_get_available_entertainer_costume_list(uint8 * costumeList); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/platform/Platform2.h b/src/openrct2/platform/Platform2.h index 223f5dadbb..fce41f87b9 100644 --- a/src/openrct2/platform/Platform2.h +++ b/src/openrct2/platform/Platform2.h @@ -16,9 +16,13 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" namespace Platform { uint32 GetTicks(); } + +#endif diff --git a/src/openrct2/platform/platform.h b/src/openrct2/platform/platform.h index fb351a1571..c669d4b079 100644 --- a/src/openrct2/platform/platform.h +++ b/src/openrct2/platform/platform.h @@ -80,6 +80,11 @@ typedef struct file_dialog_desc { } filters[8]; } file_dialog_desc; + +#ifdef __cplusplus +extern "C" { +#endif + // Platform shared definitions void platform_update_palette(const uint8 *colours, sint32 start_index, sint32 num_colours); void platform_toggle_windowed_mode(); @@ -170,4 +175,8 @@ void core_init(); utf8* macos_str_decomp_to_precomp(utf8 *input); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/rct1.h b/src/openrct2/rct1.h index 34b7304d89..3be36ee5a2 100644 --- a/src/openrct2/rct1.h +++ b/src/openrct2/rct1.h @@ -1214,6 +1214,10 @@ enum { RCT1_WATER_ORANGE }; +#ifdef __cplusplus +extern "C" { +#endif + extern const uint8 gRideCategories[RIDE_TYPE_COUNT]; bool rideTypeShouldLoseSeparateFlag(const rct_ride_entry *rideEntry); @@ -1223,4 +1227,8 @@ ParkLoadResult * load_from_sc4(const char *path); colour_t rct1_get_colour(colour_t colour); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/rct12/SawyerChunk.h b/src/openrct2/rct12/SawyerChunk.h index 0c982bb170..7294a4f82e 100644 --- a/src/openrct2/rct12/SawyerChunk.h +++ b/src/openrct2/rct12/SawyerChunk.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" /** @@ -47,3 +49,5 @@ public: SawyerChunk(SAWYER_ENCODING encoding, void * data, size_t length); ~SawyerChunk(); }; + +#endif diff --git a/src/openrct2/rct12/SawyerChunkReader.h b/src/openrct2/rct12/SawyerChunkReader.h index 0bd4766d92..348f87f536 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" #include "SawyerChunk.h" @@ -68,3 +70,5 @@ public: return result; } }; + +#endif diff --git a/src/openrct2/rct12/SawyerChunkWriter.h b/src/openrct2/rct12/SawyerChunkWriter.h index 50db15e233..2bb58c2637 100644 --- a/src/openrct2/rct12/SawyerChunkWriter.h +++ b/src/openrct2/rct12/SawyerChunkWriter.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" #include "SawyerChunk.h" @@ -55,3 +57,5 @@ public: WriteChunk(src, sizeof(T), encoding); } }; + +#endif diff --git a/src/openrct2/rct12/SawyerEncoding.h b/src/openrct2/rct12/SawyerEncoding.h index e738d79804..077ed0300c 100644 --- a/src/openrct2/rct12/SawyerEncoding.h +++ b/src/openrct2/rct12/SawyerEncoding.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include "../common.h" interface IStream; @@ -24,3 +26,5 @@ namespace SawyerEncoding { bool ValidateChecksum(IStream * stream); } + +#endif diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index 10baf2ec11..457726f815 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -16,16 +16,15 @@ #pragma once +#ifdef __cplusplus + #include #include #include "../common.h" -extern "C" -{ - #include "../scenario/scenario.h" - #include "../object_list.h" -} +#include "../scenario/scenario.h" +#include "../object_list.h" interface IStream; struct ObjectRepositoryItem; @@ -55,3 +54,5 @@ private: void Save(IStream * stream, bool isScenario); static uint32 GetLoanHash(money32 initialCash, money32 bankLoan, uint32 maxBankLoan); }; + +#endif diff --git a/src/openrct2/rct2/interop.h b/src/openrct2/rct2/interop.h index eb424bab07..14a5f170c5 100644 --- a/src/openrct2/rct2/interop.h +++ b/src/openrct2/rct2/interop.h @@ -17,8 +17,16 @@ #ifndef _RCT2_INTEROP_H_ #define _RCT2_INTEROP_H_ +#ifdef __cplusplus +extern "C" { +#endif + bool rct2_interop_setup_segment(); void rct2_interop_setup_hooks(); void rct2_interop_dispose(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index b803d5e80d..9c00fd2263 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -197,6 +197,10 @@ enum { MAZE_ELEMENT_TYPE_EXIT = (1 << 7) }; +#ifdef __cplusplus +extern "C" { +#endif + extern rct_track_td6 *gActiveTrackDesign; extern bool gTrackDesignSceneryToggle; extern rct_xyz16 gTrackPreviewMin; @@ -236,4 +240,8 @@ bool track_design_save_to_file(const utf8 *path); bool track_design_are_entrance_and_exit_placed(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index f701a1421e..561d175464 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -31,10 +31,7 @@ #include "RideGroupManager.h" #include "TrackDesignRepository.h" -extern "C" -{ - #include "TrackDesign.h" -} +#include "TrackDesign.h" using namespace OpenRCT2; diff --git a/src/openrct2/ride/ride.h b/src/openrct2/ride/ride.h index e7d97714ea..9f97da8e77 100644 --- a/src/openrct2/ride/ride.h +++ b/src/openrct2/ride/ride.h @@ -924,8 +924,6 @@ typedef struct rct_ride_properties { sint8 booster_speed_factor; // The factor to shift the raw booster speed with } rct_ride_properties; -extern const rct_ride_properties RideProperties[RIDE_TYPE_COUNT]; - #define RIDE_MODE_COUNT 37 #define MAX_RIDE_MEASUREMENTS 8 @@ -943,6 +941,12 @@ extern const rct_ride_properties RideProperties[RIDE_TYPE_COUNT]; #define CONSTRUCTION_LIFT_HILL_SELECTED 1 +#ifdef __cplusplus +extern "C" { +#endif + +extern const rct_ride_properties RideProperties[RIDE_TYPE_COUNT]; + /** Helper macros until rides are stored in this module. */ Ride *get_ride(sint32 index); rct_ride_entry *get_ride_entry(sint32 index); @@ -1199,4 +1203,8 @@ sint32 get_booster_speed(uint8 rideType, sint32 rawSpeed); void fix_invalid_vehicle_sprite_sizes(); bool ride_entry_has_category(const rct_ride_entry * rideEntry, uint8 category); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/ride_data.h b/src/openrct2/ride/ride_data.h index ef98012bd0..fe7347e584 100644 --- a/src/openrct2/ride/ride_data.h +++ b/src/openrct2/ride/ride_data.h @@ -134,6 +134,10 @@ typedef struct rct_shop_item_stats { uint16 cold_value; } rct_shop_item_stats; +#ifdef __cplusplus +extern "C" { +#endif + extern const bool hasRunningTrack[RIDE_TYPE_COUNT]; extern const uint8 initialUpkeepCosts[RIDE_TYPE_COUNT]; extern const uint8 costPerTrackPiece[RIDE_TYPE_COUNT]; @@ -177,4 +181,8 @@ extern const track_colour_preset_list RideColourPresets[RIDE_TYPE_COUNT]; extern const rct_string_id RideModeNames[RIDE_MODE_COUNT]; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/ride_ratings.h b/src/openrct2/ride/ride_ratings.h index 629b97a6ad..eab10490d2 100644 --- a/src/openrct2/ride/ride_ratings.h +++ b/src/openrct2/ride/ride_ratings.h @@ -60,9 +60,17 @@ typedef struct rct_ride_rating_calc_data { uint16 station_flags; } rct_ride_rating_calc_data; +#ifdef __cplusplus +extern "C" { +#endif + extern rct_ride_rating_calc_data gRideRatingsCalcData; void ride_ratings_update_ride(int rideIndex); void ride_ratings_update_all(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/track.h b/src/openrct2/ride/track.h index 884495f967..3ed838f2f6 100644 --- a/src/openrct2/ride/track.h +++ b/src/openrct2/ride/track.h @@ -512,6 +512,10 @@ typedef struct track_circuit_iterator { bool looped; } track_circuit_iterator; +#ifdef __cplusplus +extern "C" { +#endif + extern const rct_trackdefinition FlatRideTrackDefinitions[256]; extern const rct_trackdefinition TrackDefinitions[256]; @@ -549,4 +553,9 @@ void game_command_set_maze_track(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 * void game_command_set_brakes_speed(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); bool track_element_is_booster(uint8 rideType, uint8 trackType); bool track_element_has_speed_setting(uint8 trackType); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/track_data.h b/src/openrct2/ride/track_data.h index f4484770ff..e2466e6874 100644 --- a/src/openrct2/ride/track_data.h +++ b/src/openrct2/ride/track_data.h @@ -20,6 +20,10 @@ #include "track.h" #include "track_paint.h" +#ifdef __cplusplus +extern "C" { +#endif + // 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3 extern const rct_track_coordinates TrackCoordinates[256]; // 0x009972BB, 0x009972BC, 0x009972BD, 0x009972BF, 0x009972C1, 0x009972C3 @@ -87,3 +91,7 @@ extern const uint8 FlatRideTrackSequenceElementAllowedWallEdges[256][16]; extern const uint16 FlatTrackFlags[256]; extern const uint16 TrackFlags[256]; + +#ifdef __cplusplus +} +#endif diff --git a/src/openrct2/ride/track_paint.h b/src/openrct2/ride/track_paint.h index 06b5dd1360..8021a1a08a 100644 --- a/src/openrct2/ride/track_paint.h +++ b/src/openrct2/ride/track_paint.h @@ -24,6 +24,10 @@ #include "../paint/paint.h" #include "../world/map.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const uint8 track_map_2x2[][4]; extern const uint8 edges_2x2[]; @@ -384,4 +388,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(sint32 trackType, sint32 d TRACK_PAINT_FUNCTION get_track_paint_function_mine_ride(sint32 trackType, sint32 direction); TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(sint32 trackType, sint32 direction); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/ride/vehicle.h b/src/openrct2/ride/vehicle.h index f730d8fd23..50d39c533f 100644 --- a/src/openrct2/ride/vehicle.h +++ b/src/openrct2/ride/vehicle.h @@ -365,6 +365,10 @@ enum { #define VEHICLE_SEAT_PAIR_FLAG 0x80 #define VEHICLE_SEAT_NUM_MASK 0x7F +#ifdef __cplusplus +extern "C" { +#endif + rct_vehicle * try_get_vehicle(uint16 spriteIndex); void vehicle_update_all(); sint32 sub_6BC2F3(rct_vehicle* vehicle); @@ -397,6 +401,10 @@ extern uint8 _vehicleF64E2C; extern rct_vehicle * _vehicleFrontVehicle; extern rct_xyz16 unk_F64E20; +#ifdef __cplusplus +} +#endif + /** Helper macro until rides are stored in this module. */ #define GET_VEHICLE(sprite_index) &(get_sprite(sprite_index)->vehicle) diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index dc52dd8e6e..96fd7d6dfc 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -31,13 +31,10 @@ #include "ScenarioRepository.h" #include "ScenarioSources.h" -extern "C" -{ - #include "../config/Config.h" - #include "../localisation/localisation.h" - #include "../platform/platform.h" - #include "scenario.h" -} +#include "../config/Config.h" +#include "../localisation/localisation.h" +#include "../platform/platform.h" +#include "scenario.h" using namespace OpenRCT2; diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index 0a53129961..d7e90250de 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -19,10 +19,7 @@ #include "../core/Util.hpp" #include "ScenarioSources.h" -extern "C" -{ - #include "scenario.h" -} +#include "scenario.h" namespace ScenarioSources { diff --git a/src/openrct2/scenario/scenario.h b/src/openrct2/scenario/scenario.h index ffbfb69c3b..201c46d407 100644 --- a/src/openrct2/scenario/scenario.h +++ b/src/openrct2/scenario/scenario.h @@ -360,6 +360,10 @@ enum { #define AUTOSAVE_PAUSE 0 +#ifdef __cplusplus +extern "C" { +#endif + extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; #if defined(NO_RCT2) @@ -415,4 +419,8 @@ void scenario_success(); void scenario_success_submit_name(const char *name); void scenario_autosave_check(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index b034559875..5eeae7ff74 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -26,16 +26,13 @@ #include "TitleSequenceManager.h" #include "TitleSequencePlayer.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../drawing/drawing.h" - #include "../game.h" - #include "../input.h" - #include "../interface/viewport.h" - #include "../interface/window.h" - #include "../localisation/localisation.h" -} +#include "../audio/audio.h" +#include "../drawing/drawing.h" +#include "../game.h" +#include "../input.h" +#include "../interface/viewport.h" +#include "../interface/window.h" +#include "../localisation/localisation.h" // TODO Remove when no longer required. static TitleScreen * _singleton = nullptr; diff --git a/src/openrct2/title/TitleScreen.h b/src/openrct2/title/TitleScreen.h index 3a79ba0220..6dd3701c78 100644 --- a/src/openrct2/title/TitleScreen.h +++ b/src/openrct2/title/TitleScreen.h @@ -18,14 +18,7 @@ #include "../common.h" -#ifdef __cplusplus -extern "C" -{ -#endif #include "../drawing/drawing.h" -#ifdef __cplusplus -} -#endif #ifdef __cplusplus interface ITitleSequencePlayer; diff --git a/src/openrct2/title/TitleSequenceManager.cpp b/src/openrct2/title/TitleSequenceManager.cpp index 28beaaa956..9a26bda38b 100644 --- a/src/openrct2/title/TitleSequenceManager.cpp +++ b/src/openrct2/title/TitleSequenceManager.cpp @@ -26,11 +26,8 @@ #include "TitleSequence.h" #include "TitleSequenceManager.h" -extern "C" -{ - #include "../localisation/localisation.h" - #include "../platform/platform.h" -} +#include "../localisation/localisation.h" +#include "../platform/platform.h" namespace TitleSequenceManager { diff --git a/src/openrct2/title/TitleSequencePlayer.cpp b/src/openrct2/title/TitleSequencePlayer.cpp index 90d04fe7cc..c7f74e93f4 100644 --- a/src/openrct2/title/TitleSequencePlayer.cpp +++ b/src/openrct2/title/TitleSequencePlayer.cpp @@ -31,14 +31,11 @@ #include "TitleSequenceManager.h" #include "TitleSequencePlayer.h" -extern "C" -{ - #include "../game.h" - #include "../interface/viewport.h" - #include "../interface/window.h" - #include "../management/news_item.h" - #include "../world/scenery.h" -} +#include "../game.h" +#include "../interface/viewport.h" +#include "../interface/window.h" +#include "../management/news_item.h" +#include "../world/scenery.h" using namespace OpenRCT2; diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 88bf49fabd..ffcd6648fe 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -16,6 +16,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "../common.h" @@ -145,3 +147,5 @@ namespace OpenRCT2 IUiContext * CreateDummyUiContext(); } } + +#endif diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index 353e3a7a36..424a2555f4 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -16,13 +16,12 @@ #pragma once +#ifdef __cplusplus + #include #include "../common.h" -extern "C" -{ - #include "../interface/window.h" -} +#include "../interface/window.h" namespace OpenRCT2 { @@ -43,3 +42,5 @@ namespace OpenRCT2 IWindowManager * CreateDummyWindowManager(); } } + +#endif diff --git a/src/openrct2/util/sawyercoding.h b/src/openrct2/util/sawyercoding.h index 68a637e13d..def71f70d3 100644 --- a/src/openrct2/util/sawyercoding.h +++ b/src/openrct2/util/sawyercoding.h @@ -27,7 +27,6 @@ typedef struct sawyercoding_chunk_header { assert_struct_size(sawyercoding_chunk_header, 5); #pragma pack(pop) -extern bool gUseRLE; enum { CHUNK_ENCODING_NONE, @@ -48,6 +47,12 @@ enum { FILE_TYPE_SC4 = (2 << 2) }; +#ifdef __cplusplus +extern "C" { +#endif + +extern bool gUseRLE; + uint32 sawyercoding_calculate_checksum(const uint8* buffer, size_t length); size_t sawyercoding_read_chunk_buffer(uint8 *dst_buffer, const uint8 *src_buffer, sawyercoding_chunk_header chunkHeader, size_t dst_buffer_size); size_t sawyercoding_write_chunk_buffer(uint8 *dst_file, const uint8 *src_buffer, sawyercoding_chunk_header chunkHeader); @@ -61,4 +66,8 @@ sint32 sawyercoding_validate_track_checksum(const uint8* src, size_t length); sint32 sawyercoding_detect_file_type(const uint8 *src, size_t length); sint32 sawyercoding_detect_rct1_version(sint32 gameVersion); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/util/util.h b/src/openrct2/util/util.h index 16a1eb64a0..2f2e13e330 100644 --- a/src/openrct2/util/util.h +++ b/src/openrct2/util/util.h @@ -20,6 +20,10 @@ #include #include "../common.h" +#ifdef __cplusplus +extern "C" { +#endif + sint32 squaredmetres_to_squaredfeet(sint32 squaredMetres); sint32 metres_to_feet(sint32 metres); sint32 mph_to_kmph(sint32 mph); @@ -65,4 +69,8 @@ money32 add_clamp_money32(money32 value, money32 value_to_add); size_t strcatftime(char * buffer, size_t bufferSize, const char * format, const struct tm * tp); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/windows/Banner.cpp b/src/openrct2/windows/Banner.cpp index 815b38d6f3..8a692f709b 100644 --- a/src/openrct2/windows/Banner.cpp +++ b/src/openrct2/windows/Banner.cpp @@ -16,15 +16,13 @@ #include "../config/Config.h" -extern "C" { - #include "../game.h" - #include "../localisation/localisation.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../world/scenery.h" - #include "dropdown.h" - #include "../sprites.h" -} +#include "../game.h" +#include "../localisation/localisation.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../world/scenery.h" +#include "dropdown.h" +#include "../sprites.h" #define WW 113 #define WH 96 diff --git a/src/openrct2/windows/DemolishRidePrompt.cpp b/src/openrct2/windows/DemolishRidePrompt.cpp index 64ee256ff0..ac4da57a0b 100644 --- a/src/openrct2/windows/DemolishRidePrompt.cpp +++ b/src/openrct2/windows/DemolishRidePrompt.cpp @@ -14,11 +14,9 @@ *****************************************************************************/ #pragma endregion -extern "C" { - #include "../game.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" -} +#include "../game.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" #define WW 200 #define WH 100 diff --git a/src/openrct2/windows/Dropdown.cpp b/src/openrct2/windows/Dropdown.cpp index cdd53ce4f6..9f89d27ab5 100644 --- a/src/openrct2/windows/Dropdown.cpp +++ b/src/openrct2/windows/Dropdown.cpp @@ -18,14 +18,11 @@ #include "../core/Util.hpp" #include "../core/Math.hpp" -extern "C" -{ - #include "../input.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "dropdown.h" -} +#include "../input.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "dropdown.h" // The maximum number of rows to list before items overflow into new columns #define DROPDOWN_TEXT_MAX_ROWS 32 diff --git a/src/openrct2/windows/EditorBottomToolbar.cpp b/src/openrct2/windows/EditorBottomToolbar.cpp index cd0ef802b0..099241f88a 100644 --- a/src/openrct2/windows/EditorBottomToolbar.cpp +++ b/src/openrct2/windows/EditorBottomToolbar.cpp @@ -17,19 +17,16 @@ #include "../Context.h" #include "../OpenRCT2.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../game.h" - #include "../editor.h" - #include "../input.h" - #include "../sprites.h" - #include "../localisation/localisation.h" - #include "../interface/themes.h" - #include "../interface/widget.h" - #include "../world/scenery.h" - #include "error.h" -} +#include "../audio/audio.h" +#include "../game.h" +#include "../editor.h" +#include "../input.h" +#include "../sprites.h" +#include "../localisation/localisation.h" +#include "../interface/themes.h" +#include "../interface/widget.h" +#include "../world/scenery.h" +#include "error.h" enum { WIDX_PREVIOUS_IMAGE, // 1 diff --git a/src/openrct2/windows/EditorMain.cpp b/src/openrct2/windows/EditorMain.cpp index cdcc0eca9e..3cbcdaf10a 100644 --- a/src/openrct2/windows/EditorMain.cpp +++ b/src/openrct2/windows/EditorMain.cpp @@ -16,12 +16,9 @@ #include "../Context.h" -extern "C" -{ - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../world/footpath.h" -} +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../world/footpath.h" static void window_editor_main_paint(rct_window *w, rct_drawpixelinfo *dpi); diff --git a/src/openrct2/windows/EditorObjectSelection.cpp b/src/openrct2/windows/EditorObjectSelection.cpp index 9d93a7cb99..14b24970c9 100644 --- a/src/openrct2/windows/EditorObjectSelection.cpp +++ b/src/openrct2/windows/EditorObjectSelection.cpp @@ -22,23 +22,20 @@ #include "../core/Util.hpp" #include "../core/Memory.hpp" -extern "C" -{ - #include - #include "../audio/audio.h" - #include "../game.h" - #include "../editor.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../object_list.h" - #include "../rct1.h" - #include "../ride/ride_data.h" - #include "../util/util.h" - #include "dropdown.h" - #include "error.h" - #include "../sprites.h" - #include "_legacy.h" -} +#include +#include "../audio/audio.h" +#include "../game.h" +#include "../editor.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../object_list.h" +#include "../rct1.h" +#include "../ride/ride_data.h" +#include "../util/util.h" +#include "dropdown.h" +#include "error.h" +#include "../sprites.h" +#include "_legacy.h" enum { FILTER_RCT2 = (1 << 0), diff --git a/src/openrct2/windows/Error.cpp b/src/openrct2/windows/Error.cpp index 04f1b83c25..752aa46ea1 100644 --- a/src/openrct2/windows/Error.cpp +++ b/src/openrct2/windows/Error.cpp @@ -18,13 +18,10 @@ #include "../OpenRCT2.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "error.h" -} +#include "../audio/audio.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "error.h" bool gDisableErrorWindowSound = false; @@ -74,6 +71,8 @@ static rct_window_event_list window_error_events = { static char _window_error_text[512]; static uint16 _window_error_num_lines; +extern "C" { + /** * * rct2: 0x0066792F @@ -151,6 +150,8 @@ void window_error_open(rct_string_id title, rct_string_id message) } } +} + /** * * rct2: 0x00667BFE diff --git a/src/openrct2/windows/Finances.cpp b/src/openrct2/windows/Finances.cpp index d1c03afe3f..19e9ca16ba 100644 --- a/src/openrct2/windows/Finances.cpp +++ b/src/openrct2/windows/Finances.cpp @@ -17,17 +17,14 @@ #include "../config/Config.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../game.h" - #include "../interface/graph.h" - #include "../interface/widget.h" - #include "../localisation/date.h" - #include "../localisation/localisation.h" - #include "../ride/ride_data.h" - #include "../sprites.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../interface/graph.h" +#include "../interface/widget.h" +#include "../localisation/date.h" +#include "../localisation/localisation.h" +#include "../ride/ride_data.h" +#include "../sprites.h" +#include "dropdown.h" enum { WINDOW_FINANCES_PAGE_SUMMARY, diff --git a/src/openrct2/windows/GameBottomToolbar.cpp b/src/openrct2/windows/GameBottomToolbar.cpp index 30f2bf5a14..a893c58499 100644 --- a/src/openrct2/windows/GameBottomToolbar.cpp +++ b/src/openrct2/windows/GameBottomToolbar.cpp @@ -20,18 +20,15 @@ #include "../world/Climate.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../game.h" - #include "../input.h" - #include "../interface/themes.h" - #include "../interface/widget.h" - #include "../localisation/date.h" - #include "../localisation/localisation.h" - #include "../management/news_item.h" - #include "../peep/staff.h" - #include "../sprites.h" -} +#include "../game.h" +#include "../input.h" +#include "../interface/themes.h" +#include "../interface/widget.h" +#include "../localisation/date.h" +#include "../localisation/localisation.h" +#include "../management/news_item.h" +#include "../peep/staff.h" +#include "../sprites.h" enum WINDOW_GAME_BOTTOM_TOOLBAR_WIDGET_IDX { WIDX_LEFT_OUTSET, diff --git a/src/openrct2/windows/Guest.cpp b/src/openrct2/windows/Guest.cpp index 9312d6c839..da8feb06b4 100644 --- a/src/openrct2/windows/Guest.cpp +++ b/src/openrct2/windows/Guest.cpp @@ -17,20 +17,17 @@ #include "../config/Config.h" #include "../network/network.h" -extern "C" -{ - #include "../game.h" - #include "../input.h" - #include "../management/marketing.h" - #include "../peep/staff.h" - #include "../ride/ride_data.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../util/util.h" - #include "../world/footpath.h" -} +#include "../game.h" +#include "../input.h" +#include "../management/marketing.h" +#include "../peep/staff.h" +#include "../ride/ride_data.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../util/util.h" +#include "../world/footpath.h" enum WINDOW_GUEST_PAGE { WINDOW_GUEST_OVERVIEW, diff --git a/src/openrct2/windows/GuestList.cpp b/src/openrct2/windows/GuestList.cpp index 9a81803a48..dd6acaaba6 100644 --- a/src/openrct2/windows/GuestList.cpp +++ b/src/openrct2/windows/GuestList.cpp @@ -16,14 +16,11 @@ #include "../config/Config.h" -extern "C" -{ - #include "../game.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "dropdown.h" enum { PAGE_INDIVIDUAL, diff --git a/src/openrct2/windows/InstallTrack.cpp b/src/openrct2/windows/InstallTrack.cpp index 0bf5b5a4de..42e59cf64c 100644 --- a/src/openrct2/windows/InstallTrack.cpp +++ b/src/openrct2/windows/InstallTrack.cpp @@ -20,16 +20,13 @@ #include "../core/Math.hpp" #include "../core/Memory.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../platform/platform.h" - #include "../sprites.h" - #include "../util/util.h" - #include "error.h" -} +#include "../audio/audio.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../platform/platform.h" +#include "../sprites.h" +#include "../util/util.h" +#include "error.h" enum { WIDX_BACKGROUND, diff --git a/src/openrct2/windows/LoadSave.cpp b/src/openrct2/windows/LoadSave.cpp index 31a9d6a04f..89110d02ec 100644 --- a/src/openrct2/windows/LoadSave.cpp +++ b/src/openrct2/windows/LoadSave.cpp @@ -18,18 +18,15 @@ #include "../title/TitleScreen.h" #include "../core/Memory.hpp" -extern "C" -{ - #include - #include "../core/Guard.hpp" - #include "../editor.h" - #include "../game.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../platform/platform.h" - #include "../util/util.h" - #include "../windows/error.h" -} +#include +#include "../core/Guard.hpp" +#include "../editor.h" +#include "../game.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../platform/platform.h" +#include "../util/util.h" +#include "../windows/error.h" #pragma region Widgets diff --git a/src/openrct2/windows/Map.cpp b/src/openrct2/windows/Map.cpp index e318c15665..6e2c399d5a 100644 --- a/src/openrct2/windows/Map.cpp +++ b/src/openrct2/windows/Map.cpp @@ -20,21 +20,18 @@ #include "../core/Memory.hpp" #include "../Context.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../cheats.h" - #include "../game.h" - #include "../input.h" - #include "../interface/land_tool.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../world/entrance.h" - #include "../world/footpath.h" - #include "../world/scenery.h" - #include "error.h" -} +#include "../audio/audio.h" +#include "../cheats.h" +#include "../game.h" +#include "../input.h" +#include "../interface/land_tool.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../world/entrance.h" +#include "../world/footpath.h" +#include "../world/scenery.h" +#include "error.h" #define MAP_COLOUR_2(colourA, colourB) ((colourA << 8) | colourB) #define MAP_COLOUR(colour) MAP_COLOUR_2(colour, colour) diff --git a/src/openrct2/windows/MapTooltip.cpp b/src/openrct2/windows/MapTooltip.cpp index 52465bacba..781497e42b 100644 --- a/src/openrct2/windows/MapTooltip.cpp +++ b/src/openrct2/windows/MapTooltip.cpp @@ -16,13 +16,10 @@ #include "../Context.h" -extern "C" -{ - #include "../input.h" - #include "../interface/themes.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" -} +#include "../input.h" +#include "../interface/themes.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" static rct_widget window_map_tooltip_widgets[] = { { WWT_IMGBTN, 0, 0, 199, 0, 29, 0xFFFFFFFF, STR_NONE }, diff --git a/src/openrct2/windows/MazeConstruction.cpp b/src/openrct2/windows/MazeConstruction.cpp index e74f53dac8..7a37552101 100644 --- a/src/openrct2/windows/MazeConstruction.cpp +++ b/src/openrct2/windows/MazeConstruction.cpp @@ -14,19 +14,15 @@ *****************************************************************************/ #pragma endregion - -extern "C" -{ - #include "../audio/audio.h" - #include "../drawing/drawing.h" - #include "../game.h" - #include "../input.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../ride/track.h" - #include "../sprites.h" -} +#include "../audio/audio.h" +#include "../drawing/drawing.h" +#include "../game.h" +#include "../input.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../ride/track.h" +#include "../sprites.h" #pragma region Widgets diff --git a/src/openrct2/windows/NetworkStatus.cpp b/src/openrct2/windows/NetworkStatus.cpp index f33332c5a9..9d9c7e0f48 100644 --- a/src/openrct2/windows/NetworkStatus.cpp +++ b/src/openrct2/windows/NetworkStatus.cpp @@ -16,12 +16,9 @@ #include "../network/network.h" -extern "C" -{ - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../util/util.h" -} +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../util/util.h" static char _password[33]; diff --git a/src/openrct2/windows/NewCampaign.cpp b/src/openrct2/windows/NewCampaign.cpp index 00643fe51c..a4445a5363 100644 --- a/src/openrct2/windows/NewCampaign.cpp +++ b/src/openrct2/windows/NewCampaign.cpp @@ -17,14 +17,11 @@ #include "../config/Config.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../game.h" - #include "../localisation/localisation.h" - #include "../interface/widget.h" - #include "../ride/ride_data.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../localisation/localisation.h" +#include "../interface/widget.h" +#include "../ride/ride_data.h" +#include "dropdown.h" #define SELECTED_RIDE_UNDEFINED ((uint16)0xFFFF) diff --git a/src/openrct2/windows/NewRide.cpp b/src/openrct2/windows/NewRide.cpp index 55d32fe398..035447827b 100644 --- a/src/openrct2/windows/NewRide.cpp +++ b/src/openrct2/windows/NewRide.cpp @@ -22,19 +22,16 @@ #include "../core/Util.hpp" #include "../core/Math.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../game.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../management/news_item.h" - #include "../rct1.h" - #include "../ride/ride_data.h" - #include "../ride/track_data.h" - #include "../sprites.h" - #include "../util/util.h" -} +#include "../audio/audio.h" +#include "../game.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../management/news_item.h" +#include "../rct1.h" +#include "../ride/ride_data.h" +#include "../ride/track_data.h" +#include "../sprites.h" +#include "../util/util.h" static uint8 _windowNewRideCurrentTab; static ride_list_item _windowNewRideHighlightedItem[6]; diff --git a/src/openrct2/windows/ObjectLoadError.cpp b/src/openrct2/windows/ObjectLoadError.cpp index 05254577db..49dc6eb8fb 100644 --- a/src/openrct2/windows/ObjectLoadError.cpp +++ b/src/openrct2/windows/ObjectLoadError.cpp @@ -17,12 +17,9 @@ #include "../object/ObjectManager.h" #include "../core/Memory.hpp" -extern "C" -{ - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../platform/platform.h" -} +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../platform/platform.h" enum WINDOW_OBJECT_LOAD_ERROR_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2/windows/Park.cpp b/src/openrct2/windows/Park.cpp index dc3148a79a..12a27913a2 100644 --- a/src/openrct2/windows/Park.cpp +++ b/src/openrct2/windows/Park.cpp @@ -18,22 +18,19 @@ #include "../Context.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../game.h" - #include "../localisation/date.h" - #include "../localisation/localisation.h" - #include "../input.h" - #include "../interface/graph.h" - #include "../interface/land_tool.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../management/award.h" - #include "../util/util.h" - #include "../world/entrance.h" - #include "dropdown.h" - #include "../interface/themes.h" -} +#include "../game.h" +#include "../localisation/date.h" +#include "../localisation/localisation.h" +#include "../input.h" +#include "../interface/graph.h" +#include "../interface/land_tool.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../management/award.h" +#include "../util/util.h" +#include "../world/entrance.h" +#include "dropdown.h" +#include "../interface/themes.h" enum WINDOW_PARK_PAGE { WINDOW_PARK_PAGE_ENTRANCE, diff --git a/src/openrct2/windows/Player.cpp b/src/openrct2/windows/Player.cpp index e03f933903..743f168ab1 100644 --- a/src/openrct2/windows/Player.cpp +++ b/src/openrct2/windows/Player.cpp @@ -17,17 +17,14 @@ #include "../config/Config.h" #include "../network/network.h" -extern "C" -{ - #include "../game.h" - #include "../input.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../util/util.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../input.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../util/util.h" +#include "dropdown.h" enum WINDOW_PLAYER_PAGE { WINDOW_PLAYER_PAGE_OVERVIEW, diff --git a/src/openrct2/windows/Research.cpp b/src/openrct2/windows/Research.cpp index afcc7c6e0d..27a85c52b6 100644 --- a/src/openrct2/windows/Research.cpp +++ b/src/openrct2/windows/Research.cpp @@ -14,16 +14,13 @@ *****************************************************************************/ #pragma endregion -extern "C" -{ - #include "../game.h" - #include "../localisation/localisation.h" - #include "../interface/widget.h" - #include "../management/news_item.h" - #include "../sprites.h" - #include "../world/scenery.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../localisation/localisation.h" +#include "../interface/widget.h" +#include "../management/news_item.h" +#include "../sprites.h" +#include "../world/scenery.h" +#include "dropdown.h" enum { WINDOW_RESEARCH_PAGE_DEVELOPMENT, diff --git a/src/openrct2/windows/Ride.cpp b/src/openrct2/windows/Ride.cpp index 913ee1fda1..43115c4014 100644 --- a/src/openrct2/windows/Ride.cpp +++ b/src/openrct2/windows/Ride.cpp @@ -23,27 +23,23 @@ #include "../core/Math.hpp" #include "../core/Util.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../cheats.h" - #include "../game.h" - #include "../input.h" - #include "../interface/themes.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/date.h" - #include "../localisation/localisation.h" - #include "../peep/staff.h" - #include "../rct1.h" - #include "../ride/ride_data.h" - #include "../ride/track.h" - #include "../ride/track_data.h" - #include "../sprites.h" - #include "../windows/error.h" - #include "dropdown.h" -} - +#include "../audio/audio.h" +#include "../cheats.h" +#include "../game.h" +#include "../input.h" +#include "../interface/themes.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/date.h" +#include "../localisation/localisation.h" +#include "../peep/staff.h" +#include "../rct1.h" +#include "../ride/ride_data.h" +#include "../ride/track.h" +#include "../ride/track_data.h" +#include "../sprites.h" +#include "../windows/error.h" +#include "dropdown.h" enum { WINDOW_RIDE_PAGE_MAIN, diff --git a/src/openrct2/windows/RideConstruction.cpp b/src/openrct2/windows/RideConstruction.cpp index 7a8c0ebfd9..d1c8721100 100644 --- a/src/openrct2/windows/RideConstruction.cpp +++ b/src/openrct2/windows/RideConstruction.cpp @@ -21,23 +21,20 @@ #include "../core/Math.hpp" #include "../core/Util.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../cheats.h" - #include "../game.h" - #include "../input.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../ride/ride_data.h" - #include "../ride/track.h" - #include "../ride/track_data.h" - #include "../world/footpath.h" - #include "dropdown.h" - #include "../sprites.h" - #include "../world/entrance.h" -} +#include "../audio/audio.h" +#include "../cheats.h" +#include "../game.h" +#include "../input.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../ride/ride_data.h" +#include "../ride/track.h" +#include "../ride/track_data.h" +#include "../world/footpath.h" +#include "dropdown.h" +#include "../sprites.h" +#include "../world/entrance.h" #pragma region Widgets diff --git a/src/openrct2/windows/RideList.cpp b/src/openrct2/windows/RideList.cpp index 6b507d54df..e2c023e505 100644 --- a/src/openrct2/windows/RideList.cpp +++ b/src/openrct2/windows/RideList.cpp @@ -18,15 +18,12 @@ #include "../network/network.h" #include "../core/Util.hpp" -extern "C" -{ - #include "../game.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "../interface/widget.h" - #include "dropdown.h" - #include "../interface/themes.h" -} +#include "../game.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "../interface/widget.h" +#include "dropdown.h" +#include "../interface/themes.h" enum { PAGE_RIDES, diff --git a/src/openrct2/windows/Scenery.cpp b/src/openrct2/windows/Scenery.cpp index 228fe8fc3c..e8cfd238d5 100644 --- a/src/openrct2/windows/Scenery.cpp +++ b/src/openrct2/windows/Scenery.cpp @@ -18,18 +18,15 @@ #include "../network/network.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../input.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../world/scenery.h" - #include "dropdown.h" - #include "error.h" - #include "../sprites.h" -} +#include "../audio/audio.h" +#include "../input.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../world/scenery.h" +#include "dropdown.h" +#include "error.h" +#include "../sprites.h" #define WINDOW_SCENERY_WIDTH 634 #define WINDOW_SCENERY_HEIGHT 180 diff --git a/src/openrct2/windows/Sign.cpp b/src/openrct2/windows/Sign.cpp index 95fc4ffc77..0b9bbcd2b7 100644 --- a/src/openrct2/windows/Sign.cpp +++ b/src/openrct2/windows/Sign.cpp @@ -16,16 +16,13 @@ #include "../config/Config.h" -extern "C" -{ - #include "../game.h" - #include "../localisation/localisation.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../world/scenery.h" - #include "dropdown.h" - #include "../sprites.h" -} +#include "../game.h" +#include "../localisation/localisation.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../world/scenery.h" +#include "dropdown.h" +#include "../sprites.h" #define WW 113 #define WH 96 diff --git a/src/openrct2/windows/Staff.cpp b/src/openrct2/windows/Staff.cpp index 8c6da8d49f..0f35b5dd6e 100644 --- a/src/openrct2/windows/Staff.cpp +++ b/src/openrct2/windows/Staff.cpp @@ -16,19 +16,16 @@ #include "../config/Config.h" -extern "C" -{ - #include "../game.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../peep/staff.h" - #include "../sprites.h" - #include "../world/footpath.h" - #include "../input.h" - #include "dropdown.h" - #include "../interface/themes.h" -} +#include "../game.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../peep/staff.h" +#include "../sprites.h" +#include "../world/footpath.h" +#include "../input.h" +#include "dropdown.h" +#include "../interface/themes.h" #define WW 190 #define WH 180 diff --git a/src/openrct2/windows/StaffFirePrompt.cpp b/src/openrct2/windows/StaffFirePrompt.cpp index 2c884b3f26..14ffb73393 100644 --- a/src/openrct2/windows/StaffFirePrompt.cpp +++ b/src/openrct2/windows/StaffFirePrompt.cpp @@ -14,12 +14,9 @@ *****************************************************************************/ #pragma endregion -extern "C" -{ - #include "../game.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" -} +#include "../game.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" #define WW 200 #define WH 100 diff --git a/src/openrct2/windows/TextInput.cpp b/src/openrct2/windows/TextInput.cpp index 252c57c9f2..09c3f46d35 100644 --- a/src/openrct2/windows/TextInput.cpp +++ b/src/openrct2/windows/TextInput.cpp @@ -25,12 +25,9 @@ #include "../Context.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../util/util.h" -} +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../util/util.h" #define WW 250 #define WH 90 diff --git a/src/openrct2/windows/TileInspector.cpp b/src/openrct2/windows/TileInspector.cpp index 59c3dd1f5a..6a230dd6b1 100644 --- a/src/openrct2/windows/TileInspector.cpp +++ b/src/openrct2/windows/TileInspector.cpp @@ -18,22 +18,19 @@ #include "../core/Math.hpp" #include "../core/Util.hpp" -extern "C" -{ - #include "../common.h" - #include "../game.h" - #include "../input.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../ride/ride_data.h" - #include "../ride/track.h" - #include "../sprites.h" - #include "../world/footpath.h" - #include "../world/scenery.h" - #include "../world/tile_inspector.h" - #include "dropdown.h" - #include "tile_inspector.h" -} +#include "../common.h" +#include "../game.h" +#include "../input.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../ride/ride_data.h" +#include "../ride/track.h" +#include "../sprites.h" +#include "../world/footpath.h" +#include "../world/scenery.h" +#include "../world/tile_inspector.h" +#include "dropdown.h" +#include "tile_inspector.h" static const rct_string_id TerrainTypeStringIds[] = { STR_TILE_INSPECTOR_TERRAIN_GRASS, diff --git a/src/openrct2/windows/TitleCommandEditor.cpp b/src/openrct2/windows/TitleCommandEditor.cpp index 64b20e6a27..35f59d3e3c 100644 --- a/src/openrct2/windows/TitleCommandEditor.cpp +++ b/src/openrct2/windows/TitleCommandEditor.cpp @@ -18,17 +18,14 @@ #include "../title/TitleSequence.h" #include "../core/Memory.hpp" -extern "C" -{ - #include "../game.h" - #include "../input.h" - #include "../interface/themes.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../util/util.h" - #include "dropdown.h" -} +#include "../game.h" +#include "../input.h" +#include "../interface/themes.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../util/util.h" +#include "dropdown.h" typedef struct TITLE_COMMAND_ORDER { // originally a uint8, but the new millisecond wait times require a uint16. diff --git a/src/openrct2/windows/TitleEditor.cpp b/src/openrct2/windows/TitleEditor.cpp index 9a2f1a12d2..d46389a9a9 100644 --- a/src/openrct2/windows/TitleEditor.cpp +++ b/src/openrct2/windows/TitleEditor.cpp @@ -24,17 +24,14 @@ #include "../title/TitleSequenceManager.h" #include "../title/TitleSequencePlayer.h" -extern "C" -{ - #include "../game.h" - #include "../input.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "../util/util.h" - #include "dropdown.h" - #include "error.h" -} +#include "../game.h" +#include "../input.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "../util/util.h" +#include "dropdown.h" +#include "error.h" enum WINDOW_TITLE_EDITOR_TAB { WINDOW_TITLE_EDITOR_TAB_PRESETS, diff --git a/src/openrct2/windows/TitleScenarioSelect.cpp b/src/openrct2/windows/TitleScenarioSelect.cpp index 2f5c9e6b5b..cbb36f6bd8 100644 --- a/src/openrct2/windows/TitleScenarioSelect.cpp +++ b/src/openrct2/windows/TitleScenarioSelect.cpp @@ -19,16 +19,13 @@ #include "../scenario/ScenarioSources.h" #include "../core/Memory.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../localisation/date.h" - #include "../localisation/localisation.h" - #include "../sprites.h" - #include "../interface/widget.h" - #include "../interface/themes.h" - #include "../util/util.h" -} +#include "../audio/audio.h" +#include "../localisation/date.h" +#include "../localisation/localisation.h" +#include "../sprites.h" +#include "../interface/widget.h" +#include "../interface/themes.h" +#include "../util/util.h" #define INITIAL_NUM_UNLOCKED_SCENARIOS 5 diff --git a/src/openrct2/windows/Tooltip.cpp b/src/openrct2/windows/Tooltip.cpp index 17c2cc626b..786ac343b6 100644 --- a/src/openrct2/windows/Tooltip.cpp +++ b/src/openrct2/windows/Tooltip.cpp @@ -17,13 +17,10 @@ #include "../Context.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../localisation/localisation.h" - #include "../input.h" - #include "../interface/widget.h" - #include "tooltip.h" -} +#include "../localisation/localisation.h" +#include "../input.h" +#include "../interface/widget.h" +#include "tooltip.h" enum { WIDX_BACKGROUND diff --git a/src/openrct2/windows/TopToolbar.cpp b/src/openrct2/windows/TopToolbar.cpp index b1abcca9f6..ab18eee739 100644 --- a/src/openrct2/windows/TopToolbar.cpp +++ b/src/openrct2/windows/TopToolbar.cpp @@ -23,23 +23,20 @@ #include "../core/Math.hpp" #include "../interface/Screenshot.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../cheats.h" - #include "../editor.h" - #include "../input.h" - #include "../interface/console.h" - #include "../interface/land_tool.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../network/twitch.h" - #include "../peep/staff.h" - #include "../util/util.h" - #include "../world/footpath.h" - #include "../world/scenery.h" - #include "dropdown.h" -} +#include "../audio/audio.h" +#include "../cheats.h" +#include "../editor.h" +#include "../input.h" +#include "../interface/console.h" +#include "../interface/land_tool.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../network/twitch.h" +#include "../peep/staff.h" +#include "../util/util.h" +#include "../world/footpath.h" +#include "../world/scenery.h" +#include "dropdown.h" enum { WIDX_PAUSE, diff --git a/src/openrct2/windows/TrackList.cpp b/src/openrct2/windows/TrackList.cpp index 59c9bb6559..7c22f00c30 100644 --- a/src/openrct2/windows/TrackList.cpp +++ b/src/openrct2/windows/TrackList.cpp @@ -21,16 +21,13 @@ #include "../core/Math.hpp" #include "../core/Memory.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../editor.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../rct1.h" - #include "../sprites.h" - #include "error.h" -} +#include "../audio/audio.h" +#include "../editor.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../rct1.h" +#include "../sprites.h" +#include "error.h" enum { WIDX_BACKGROUND, diff --git a/src/openrct2/windows/TrackManage.cpp b/src/openrct2/windows/TrackManage.cpp index fd95337e71..ad5f4debd3 100644 --- a/src/openrct2/windows/TrackManage.cpp +++ b/src/openrct2/windows/TrackManage.cpp @@ -18,13 +18,10 @@ #include "../ride/TrackDesignRepository.h" #include "../core/Math.hpp" -extern "C" -{ - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../util/util.h" - #include "error.h" -} +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../util/util.h" +#include "error.h" #pragma region Widgets diff --git a/src/openrct2/windows/TrackPlace.cpp b/src/openrct2/windows/TrackPlace.cpp index 6f3be210e7..003b85cfad 100644 --- a/src/openrct2/windows/TrackPlace.cpp +++ b/src/openrct2/windows/TrackPlace.cpp @@ -18,19 +18,16 @@ #include "../core/Memory.hpp" #include "../core/Math.hpp" -extern "C" -{ - #include "../audio/audio.h" - #include "../cheats.h" - #include "../game.h" - #include "../input.h" - #include "../interface/viewport.h" - #include "../interface/widget.h" - #include "../localisation/localisation.h" - #include "../ride/track.h" - #include "../ride/track_data.h" - #include "../sprites.h" -} +#include "../audio/audio.h" +#include "../cheats.h" +#include "../game.h" +#include "../input.h" +#include "../interface/viewport.h" +#include "../interface/widget.h" +#include "../localisation/localisation.h" +#include "../ride/track.h" +#include "../ride/track_data.h" +#include "../sprites.h" #define TRACK_MINI_PREVIEW_WIDTH 168 #define TRACK_MINI_PREVIEW_HEIGHT 78 diff --git a/src/openrct2/windows/_legacy.h b/src/openrct2/windows/_legacy.h index e5f0022e0d..71f6edf94b 100644 --- a/src/openrct2/windows/_legacy.h +++ b/src/openrct2/windows/_legacy.h @@ -16,5 +16,18 @@ #include "../object.h" +#ifndef _LEGACY_H +#define _LEGACY_H + +#ifdef __cplusplus +extern "C" { +#endif + extern const rct_object_entry RequiredSelectedObjects[7]; extern const rct_object_entry DefaultSelectedObjects[26]; + +#ifdef __cplusplus +} +#endif + +#endif // _LEGACY_H \ No newline at end of file diff --git a/src/openrct2/windows/dropdown.h b/src/openrct2/windows/dropdown.h index f8ef8e1940..4dd55f03dc 100644 --- a/src/openrct2/windows/dropdown.h +++ b/src/openrct2/windows/dropdown.h @@ -31,6 +31,10 @@ enum DROPDOWN_FLAG_STAY_OPEN = (1 << 7) }; +#ifdef __cplusplus +extern "C" { +#endif + extern sint32 gAppropriateImageDropdownItemsPerRow[]; extern sint32 gDropdownNumItems; @@ -54,4 +58,8 @@ sint32 dropdown_index_from_point(sint32 x, sint32 y, rct_window* w); void window_dropdown_show_colour(rct_window *w, rct_widget *widget, uint8 dropdownColour, uint8 selectedColour); void window_dropdown_show_colour_available(rct_window *w, rct_widget *widget, uint8 dropdownColour, uint8 selectedColour, uint32 availableColours); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/windows/error.h b/src/openrct2/windows/error.h index 7867a20fd9..0ecde606a6 100644 --- a/src/openrct2/windows/error.h +++ b/src/openrct2/windows/error.h @@ -19,6 +19,14 @@ #include "../common.h" +#ifdef __cplusplus +extern "C" { +#endif + void window_error_open(rct_string_id title, rct_string_id message); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/windows/tile_inspector.h b/src/openrct2/windows/tile_inspector.h index 2f3771707c..c32a29dcd5 100644 --- a/src/openrct2/windows/tile_inspector.h +++ b/src/openrct2/windows/tile_inspector.h @@ -33,9 +33,17 @@ typedef enum tile_inspector_page TILE_INSPECTOR_PAGE_CORRUPT } tile_inspector_page; +#ifdef __cplusplus +extern "C" { +#endif + extern uint32 windowTileInspectorTileX; extern uint32 windowTileInspectorTileY; extern sint32 windowTileInspectorElementCount; void window_tile_inspector_set_page(rct_window *w, const tile_inspector_page page); void window_tile_inspector_auto_set_buttons(rct_window *w); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/src/openrct2/windows/tooltip.h b/src/openrct2/windows/tooltip.h index 4d394a350c..5e4543aad2 100644 --- a/src/openrct2/windows/tooltip.h +++ b/src/openrct2/windows/tooltip.h @@ -19,9 +19,17 @@ #include "../interface/window.h" +#ifdef __cplusplus +extern "C" { +#endif + void window_tooltip_reset(sint32 x, sint32 y); void window_tooltip_show(rct_string_id id, sint32 x, sint32 y); void window_tooltip_open(rct_window *widgetWindow, rct_widgetindex widgetIndex, sint32 x, sint32 y); void window_tooltip_close(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/world/Balloon.cpp index dd922ca75d..b6222effdc 100644 --- a/src/openrct2/world/Balloon.cpp +++ b/src/openrct2/world/Balloon.cpp @@ -16,13 +16,10 @@ #include "../network/network.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../scenario/scenario.h" - #include "../util/util.h" - #include "sprite.h" -} +#include "../audio/audio.h" +#include "../scenario/scenario.h" +#include "../util/util.h" +#include "sprite.h" bool rct_sprite::IsBalloon() { diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 6d59ced339..c46881480b 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -20,17 +20,14 @@ #include "../core/String.hpp" #include "../network/network.h" -extern "C" -{ - #include "banner.h" - #include "map.h" - #include "park.h" - #include "scenery.h" - #include "../game.h" - #include "../interface/window.h" - #include "../localisation/localisation.h" - #include "../ride/ride.h" -} +#include "banner.h" +#include "map.h" +#include "park.h" +#include "scenery.h" +#include "../game.h" +#include "../interface/window.h" +#include "../localisation/localisation.h" +#include "../ride/ride.h" rct_banner gBanners[MAX_BANNERS]; diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index e3874f3962..c182b39c17 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -19,19 +19,16 @@ #include "../OpenRCT2.h" #include "Climate.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../audio/AudioMixer.h" - #include "../cheats.h" - #include "../drawing/drawing.h" - #include "../game.h" - #include "../interface/window.h" - #include "../localisation/date.h" - #include "../scenario/scenario.h" - #include "../sprites.h" - #include "../util/util.h" -} +#include "../audio/audio.h" +#include "../audio/AudioMixer.h" +#include "../cheats.h" +#include "../drawing/drawing.h" +#include "../game.h" +#include "../interface/window.h" +#include "../localisation/date.h" +#include "../scenario/scenario.h" +#include "../sprites.h" +#include "../util/util.h" constexpr sint32 MAX_THUNDER_INSTANCES = 2; diff --git a/src/openrct2/world/Climate.h b/src/openrct2/world/Climate.h index 3303c022fd..3e1c3b04dc 100644 --- a/src/openrct2/world/Climate.h +++ b/src/openrct2/world/Climate.h @@ -18,14 +18,7 @@ #include "../common.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "../drawing/drawing.h" -#ifdef __cplusplus -} -#endif +#include "../drawing/drawing.h" enum CLIMATE { diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/world/Duck.cpp index 749f3bf387..1c2c8ae7b0 100644 --- a/src/openrct2/world/Duck.cpp +++ b/src/openrct2/world/Duck.cpp @@ -18,14 +18,11 @@ #include "../core/Util.hpp" #include "../sprites.h" -extern "C" -{ - #include "../audio/audio.h" - #include "../game.h" - #include "../localisation/date.h" - #include "../scenario/scenario.h" - #include "sprite.h" -} +#include "../audio/audio.h" +#include "../game.h" +#include "../localisation/date.h" +#include "../scenario/scenario.h" +#include "sprite.h" enum DUCK_STATE { diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 3093a5c02c..c7bdac4a18 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -17,18 +17,15 @@ #include "../network/network.h" #include "../OpenRCT2.h" -extern "C" -{ - #include "entrance.h" - #include "footpath.h" - #include "map.h" - #include "park.h" - #include "../cheats.h" - #include "../game.h" - #include "../localisation/string_ids.h" - #include "../management/finance.h" - #include "../ride/track.h" -} +#include "entrance.h" +#include "footpath.h" +#include "map.h" +#include "park.h" +#include "../cheats.h" +#include "../game.h" +#include "../localisation/string_ids.h" +#include "../management/finance.h" +#include "../ride/track.h" bool gParkEntranceGhostExists = false; rct_xyz16 gParkEntranceGhostPosition = { 0, 0, 0 }; diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 42ea2f028a..c520fff5f6 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -16,17 +16,12 @@ #include "Fountain.h" -#ifdef __cplusplus -extern "C" -{ - #include "../game.h" - #include "../scenario/scenario.h" - #include "footpath.h" - #include "map.h" - #include "scenery.h" - #include "sprite.h" -} -#endif +#include "../game.h" +#include "../scenario/scenario.h" +#include "footpath.h" +#include "map.h" +#include "scenery.h" +#include "sprite.h" enum class PATTERN { diff --git a/src/openrct2/world/Fountain.h b/src/openrct2/world/Fountain.h index 75fd3b9efe..a0af6543bc 100644 --- a/src/openrct2/world/Fountain.h +++ b/src/openrct2/world/Fountain.h @@ -18,15 +18,8 @@ #include "../common.h" -#ifdef __cplusplus -extern "C" -{ -#endif - #include "map.h" - #include "sprite.h" -#ifdef __cplusplus -} -#endif +#include "map.h" +#include "sprite.h" enum { diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 81f490cceb..dcea72d9e1 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -17,15 +17,12 @@ #include "../network/network.h" #include "../OpenRCT2.h" -extern "C" -{ - #include "footpath.h" - #include "scenery.h" - #include "map.h" - #include "park.h" - #include "../cheats.h" - #include "../ride/TrackDesign.h" -} +#include "footpath.h" +#include "scenery.h" +#include "map.h" +#include "park.h" +#include "../cheats.h" +#include "../ride/TrackDesign.h" static money32 SmallSceneryRemove(sint16 x, sint16 y, uint8 baseHeight, uint8 quadrant, uint8 sceneryType, uint8 flags) { diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index c36e60ab8e..df84bcf09e 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -18,17 +18,14 @@ #include "../network/network.h" #include "../OpenRCT2.h" -extern "C" -{ - #include "../cheats.h" - #include "../game.h" - #include "../localisation/string_ids.h" - #include "../ride/track.h" - #include "../ride/track_data.h" - #include "map.h" - #include "park.h" - #include "scenery.h" -} +#include "../cheats.h" +#include "../game.h" +#include "../localisation/string_ids.h" +#include "../ride/track.h" +#include "../ride/track_data.h" +#include "map.h" +#include "park.h" +#include "scenery.h" /** * Gets whether the given track type can have a wall placed on the edge of the given direction. diff --git a/src/openrct2/world/banner.h b/src/openrct2/world/banner.h index bd3780239e..e78a500b48 100644 --- a/src/openrct2/world/banner.h +++ b/src/openrct2/world/banner.h @@ -43,6 +43,10 @@ enum{ BANNER_FLAG_IS_WALL = (1 << 3) }; +#ifdef __cplusplus +extern "C" { +#endif + extern rct_banner gBanners[MAX_BANNERS]; void banner_init(); @@ -52,4 +56,8 @@ sint32 banner_get_closest_ride_index(sint32 x, sint32 y, sint32 z); void banner_reset_broken_index(); void game_command_callback_place_banner(sint32 eax, sint32 ebx, sint32 ecx, sint32 edx, sint32 esi, sint32 edi, sint32 ebp); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/entrance.h b/src/openrct2/world/entrance.h index 551605591a..60dfb2081d 100644 --- a/src/openrct2/world/entrance.h +++ b/src/openrct2/world/entrance.h @@ -29,6 +29,10 @@ typedef struct rct_entrance_type { assert_struct_size(rct_entrance_type, 8); #pragma pack(pop) +#ifdef __cplusplus +extern "C" { +#endif + void game_command_remove_park_entrance(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); typedef struct rct_xyz16 rct_xyz16; @@ -52,4 +56,8 @@ void reset_park_entrance(); void maze_entrance_hedge_replacement(sint32 x, sint32 y, rct_map_element *mapElement); void maze_entrance_hedge_removal(sint32 x, sint32 y, rct_map_element *mapElement); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/footpath.h b/src/openrct2/world/footpath.h index 1c2fba1637..3b3dc9fb4e 100644 --- a/src/openrct2/world/footpath.h +++ b/src/openrct2/world/footpath.h @@ -63,6 +63,10 @@ enum FOOTPATH_CLEAR_DIRECTIONAL = (1 << 8), // Flag set when direction is used. }; +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 gFootpathProvisionalFlags; extern rct_xyz16 gFootpathProvisionalPosition; extern uint8 gFootpathProvisionalType; @@ -118,4 +122,8 @@ rct_footpath_entry *get_footpath_entry(sint32 entryIndex); void footpath_queue_chain_reset(); void footpath_queue_chain_push(uint8 rideIndex); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/map.h b/src/openrct2/world/map.h index 6f82f5fba6..cf2c5e8fa4 100644 --- a/src/openrct2/world/map.h +++ b/src/openrct2/world/map.h @@ -382,6 +382,10 @@ enum { MAP_SELECT_TYPE_EDGE_3, }; +#ifdef __cplusplus +extern "C" { +#endif + extern const rct_xy16 TileDirectionDelta[]; extern const money32 TerrainPricing[]; @@ -598,4 +602,8 @@ void wall_element_set_secondary_colour(rct_map_element * wallElement, uint8 seco uint32 map_get_available_peep_spawn_index_list(uint32* peepSpawnIndexList); uint16 check_max_allowable_land_rights_for_tile(uint8 x, uint8 y, uint8 base_z); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/map_animation.h b/src/openrct2/world/map_animation.h index f361d8ca7f..6f200e9230 100644 --- a/src/openrct2/world/map_animation.h +++ b/src/openrct2/world/map_animation.h @@ -53,10 +53,18 @@ enum { #define MAX_ANIMATED_OBJECTS 2000 +#ifdef __cplusplus +extern "C" { +#endif + extern uint16 gNumMapAnimations; extern rct_map_animation gAnimatedObjects[MAX_ANIMATED_OBJECTS]; void map_animation_create(sint32 type, sint32 x, sint32 y, sint32 z); void map_animation_invalidate_all(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/map_helpers.h b/src/openrct2/world/map_helpers.h index 7fb7c172fa..8b290cd294 100644 --- a/src/openrct2/world/map_helpers.h +++ b/src/openrct2/world/map_helpers.h @@ -17,7 +17,15 @@ #ifndef _MAP_HELPERS_H_ #define _MAP_HELPERS_H_ +#ifdef __cplusplus +extern "C" { +#endif + sint32 map_smooth(sint32 l, sint32 t, sint32 r, sint32 b); sint32 tile_smooth(sint32 x, sint32 y); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/mapgen.h b/src/openrct2/world/mapgen.h index 99722aed1c..54d17c2d83 100644 --- a/src/openrct2/world/mapgen.h +++ b/src/openrct2/world/mapgen.h @@ -43,6 +43,10 @@ typedef struct mapgen_settings { bool normalize_height; } mapgen_settings; +#ifdef __cplusplus +extern "C" { +#endif + void mapgen_generate_blank(mapgen_settings *settings); void mapgen_generate(mapgen_settings *settings); void mapgen_generate_custom_simplex(mapgen_settings *settings); @@ -50,4 +54,8 @@ bool mapgen_load_heightmap(const utf8 *path); void mapgen_unload_heightmap(); void mapgen_generate_from_heightmap(mapgen_settings *settings); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/park.h b/src/openrct2/world/park.h index ff9a2d795d..d74e747700 100644 --- a/src/openrct2/world/park.h +++ b/src/openrct2/world/park.h @@ -56,6 +56,10 @@ enum BUY_LAND_RIGHTS_FLAG_SET_OWNERSHIP_WITH_CHECKS, // Used in scenario editor }; +#ifdef __cplusplus +extern "C" { +#endif + extern rct_string_id gParkName; extern uint32 gParkNameArgs; extern uint32 gParkFlags; @@ -112,4 +116,8 @@ void game_command_buy_land_rights(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 money16 park_get_entrance_fee(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/scenery.h b/src/openrct2/world/scenery.h index 5a6dc6df03..6b43ee7ea1 100644 --- a/src/openrct2/world/scenery.h +++ b/src/openrct2/world/scenery.h @@ -238,6 +238,10 @@ enum { #define SCENERY_ENTRIES_BY_TAB 256 +#ifdef __cplusplus +extern "C" { +#endif + extern uint8 gWindowSceneryActiveTabIndex; extern uint16 gWindowSceneryTabSelections[20]; extern uint8 gWindowSceneryClusterEnabled; @@ -302,4 +306,8 @@ void scenery_small_set_secondary_colour(rct_map_element *mapElement, uint32 colo bool scenery_small_get_supports_needed(const rct_map_element *mapElement); void scenery_small_set_supports_needed(rct_map_element *mapElement); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/sprite.h b/src/openrct2/world/sprite.h index 44929c96ca..77ce358221 100644 --- a/src/openrct2/world/sprite.h +++ b/src/openrct2/world/sprite.h @@ -405,6 +405,10 @@ enum { LITTER_TYPE_EMPTY_BOWL_BLUE, }; +#ifdef __cplusplus +extern "C" { +#endif + rct_sprite *try_get_sprite(size_t spriteIndex); rct_sprite *get_sprite(size_t sprite_idx); @@ -480,5 +484,10 @@ bool sprite_get_flashing(rct_sprite *sprite); sint32 check_for_sprite_list_cycles(bool fix); sint32 check_for_spatial_index_cycles(bool fix); sint32 fix_disjoint_sprites(); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/openrct2/world/tile_inspector.h b/src/openrct2/world/tile_inspector.h index e624bec4b1..f5f0a234f6 100644 --- a/src/openrct2/world/tile_inspector.h +++ b/src/openrct2/world/tile_inspector.h @@ -54,6 +54,10 @@ typedef enum { TILE_INSPECTOR_CORRUPT_CLAMP, } tile_inspector_instruction; +#ifdef __cplusplus +extern "C" { +#endif + sint32 tile_inspector_insert_corrupt_at(sint32 x, sint32 y, sint16 elementIndex, sint32 flags); sint32 tile_inspector_remove_element_at(sint32 x, sint32 y, sint16 elementIndex, sint32 flags); sint32 tile_inspector_swap_elements_at(sint32 x, sint32 y, sint16 first, sint16 second, sint32 flags); @@ -73,3 +77,7 @@ sint32 tile_inspector_scenery_set_quarter_location(sint32 x, sint32 y, sint32 el sint32 tile_inspector_scenery_set_quarter_collision(sint32 x, sint32 y, sint32 elementIndex, sint32 quarterIndex, sint32 flags); sint32 tile_inspector_banner_toggle_blocking_edge(sint32 x, sint32 y, sint32 elementIndex, sint32 edgeIndex, sint32 flags); sint32 tile_inspector_corrupt_clamp(sint32 x, sint32 y, sint32 elementIndex, sint32 flags); + +#ifdef __cplusplus +} +#endif diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index b9cebe335c..d728e781c3 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -1,9 +1,7 @@ // Make MSVC shut up about M_PI #include -extern "C" { #include "openrct2/util/sawyercoding.h" -} #include