From 34a6b5ef92925629ce16c75fb4adbaa64cfdb11d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 1 Feb 2018 19:01:47 +0100 Subject: [PATCH] Remove __cplusplus ifdefs --- src/openrct2-ui/input/KeyboardShortcuts.h | 4 --- src/openrct2/EditorObjectSelectionSession.h | 2 -- src/openrct2/cmdline/CommandLine.hpp | 4 --- src/openrct2/config/Config.h | 10 ------- src/openrct2/core/Endianness.h | 4 --- src/openrct2/core/File.h | 4 --- src/openrct2/core/FileScanner.h | 4 --- src/openrct2/core/Nullable.hpp | 4 --- src/openrct2/core/Zip.h | 4 --- src/openrct2/drawing/IDrawingContext.h | 4 --- src/openrct2/drawing/IDrawingEngine.h | 4 --- src/openrct2/drawing/Rain.h | 4 --- src/openrct2/drawing/X8DrawingEngine.h | 4 --- src/openrct2/interface/Cursors.h | 4 --- src/openrct2/localisation/Language.h | 10 +------ src/openrct2/localisation/LanguagePack.h | 4 --- src/openrct2/network/NetworkAction.h | 4 --- src/openrct2/network/NetworkConnection.h | 3 --- src/openrct2/network/NetworkGroup.h | 4 --- src/openrct2/network/NetworkKey.h | 5 ---- src/openrct2/network/NetworkPacket.h | 4 --- src/openrct2/network/NetworkPlayer.h | 4 --- .../network/NetworkServerAdvertiser.h | 4 --- src/openrct2/network/NetworkUser.h | 4 --- src/openrct2/network/TcpSocket.h | 4 --- src/openrct2/network/http.h | 4 --- src/openrct2/network/network.h | 8 +----- src/openrct2/object/BannerObject.h | 4 --- src/openrct2/object/EntranceObject.h | 4 --- src/openrct2/object/FootpathItemObject.h | 4 --- src/openrct2/object/FootpathObject.h | 4 --- src/openrct2/object/ImageTable.h | 4 --- src/openrct2/object/LargeSceneryObject.h | 4 --- src/openrct2/object/Object.h | 9 ------- src/openrct2/object/ObjectFactory.h | 4 --- src/openrct2/object/ObjectManager.h | 9 +------ src/openrct2/object/ObjectRepository.h | 27 ++++++------------- src/openrct2/object/RideObject.h | 4 --- src/openrct2/object/SceneryGroupObject.h | 4 --- src/openrct2/object/SceneryObject.h | 4 --- src/openrct2/object/SmallSceneryObject.h | 4 --- src/openrct2/object/StexObject.h | 4 --- src/openrct2/object/StringTable.h | 4 --- src/openrct2/object/WallObject.h | 4 --- src/openrct2/object/WaterObject.h | 4 --- src/openrct2/platform/Platform2.h | 4 --- src/openrct2/rct1/Tables.h | 7 +---- src/openrct2/rct12/SawyerChunk.h | 4 --- src/openrct2/rct12/SawyerChunkReader.h | 4 --- src/openrct2/rct12/SawyerChunkWriter.h | 4 --- src/openrct2/rct12/SawyerEncoding.h | 4 --- src/openrct2/rct2/RCT2.h | 4 --- src/openrct2/rct2/S6Exporter.h | 4 --- src/openrct2/ride/Ride.h | 2 -- src/openrct2/scenario/ScenarioRepository.h | 4 --- src/openrct2/scenario/ScenarioSources.h | 4 --- src/openrct2/title/TitleScreen.h | 2 -- src/openrct2/title/TitleSequence.h | 8 ++---- src/openrct2/title/TitleSequenceManager.h | 8 +----- src/openrct2/title/TitleSequencePlayer.h | 8 ------ src/openrct2/ui/UiContext.h | 4 --- src/openrct2/ui/WindowManager.h | 4 --- src/openrct2/world/Map.h | 5 +--- src/openrct2/world/Sprite.h | 7 ----- 64 files changed, 16 insertions(+), 302 deletions(-) diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index 6c2200e832..c916c873da 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -103,8 +103,6 @@ enum SHORTCUT_UNDEFINED = 0xFFFF, }; -#ifdef __cplusplus - #include namespace OpenRCT2 @@ -138,8 +136,6 @@ namespace OpenRCT2 } } -#endif - typedef struct rct_window rct_window; /** The current shortcut being changed. */ diff --git a/src/openrct2/EditorObjectSelectionSession.h b/src/openrct2/EditorObjectSelectionSession.h index d83e77af75..8eb526007f 100644 --- a/src/openrct2/EditorObjectSelectionSession.h +++ b/src/openrct2/EditorObjectSelectionSession.h @@ -19,7 +19,6 @@ #include "common.h" #include "object/Object.h" -#ifdef __cplusplus extern bool _maxObjectsWasHit; extern uint8 * _objectSelectionFlags; extern sint32 _numSelectedObjectsForType[OBJECT_TYPE_COUNT]; @@ -30,7 +29,6 @@ void unload_unselected_objects(); bool sub_6AB211(); void reset_selected_object_count_and_size(); sint32 window_editor_object_selection_select_object(uint8 bh, sint32 flags, const rct_object_entry *entry); -#endif /** * Removes all unused objects from the object selection. diff --git a/src/openrct2/cmdline/CommandLine.hpp b/src/openrct2/cmdline/CommandLine.hpp index 3037044b02..180ea5f8f6 100644 --- a/src/openrct2/cmdline/CommandLine.hpp +++ b/src/openrct2/cmdline/CommandLine.hpp @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" /** @@ -111,5 +109,3 @@ namespace CommandLine exitcode_t HandleCommandConvert(CommandLineArgEnumerator * enumerator); exitcode_t HandleCommandUri(CommandLineArgEnumerator * enumerator); } - -#endif diff --git a/src/openrct2/config/Config.h b/src/openrct2/config/Config.h index 28f3888d79..d8ebb8a68f 100644 --- a/src/openrct2/config/Config.h +++ b/src/openrct2/config/Config.h @@ -224,16 +224,6 @@ enum MEASUREMENT_FORMAT MEASUREMENT_FORMAT_SI }; -#ifndef __cplusplus -// This is only for C files, C++ files should use FULLSCREEN_MODE in UiContext.h -enum -{ - FULLSCREEN_MODE_WINDOWED, - FULLSCREEN_MODE_FULLSCREEN, - FULLSCREEN_MODE_FULLSCREEN_DESKTOP, -}; -#endif - extern GeneralConfiguration gConfigGeneral; extern InterfaceConfiguration gConfigInterface; extern SoundConfiguration gConfigSound; diff --git a/src/openrct2/core/Endianness.h b/src/openrct2/core/Endianness.h index 2f5699abb2..2ce75b9a28 100644 --- a/src/openrct2/core/Endianness.h +++ b/src/openrct2/core/Endianness.h @@ -18,8 +18,6 @@ #include "../common.h" -#ifdef __cplusplus - template struct ByteSwapT { }; @@ -58,5 +56,3 @@ static T ByteSwapBE(const T& value) { return ByteSwapT::SwapBE(value); } - -#endif diff --git a/src/openrct2/core/File.h b/src/openrct2/core/File.h index f26a4710f6..2084be8608 100644 --- a/src/openrct2/core/File.h +++ b/src/openrct2/core/File.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -33,5 +31,3 @@ namespace File std::vector ReadAllLines(const std::string &path); uint64 GetLastModified(const std::string &path); } - -#endif diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index f3424b0f6a..659360fc36 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -70,5 +68,3 @@ namespace Path std::vector GetDirectories(const std::string &path); } - -#endif diff --git a/src/openrct2/core/Nullable.hpp b/src/openrct2/core/Nullable.hpp index 80f8671b3d..4732af9ebe 100644 --- a/src/openrct2/core/Nullable.hpp +++ b/src/openrct2/core/Nullable.hpp @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" template @@ -61,5 +59,3 @@ private: T _value; bool _hasValue; }; - -#endif diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index 1dbd68678d..8d3e85efd0 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" /** @@ -57,5 +55,3 @@ namespace Zip IZipArchive * Open(const utf8 * path, ZIP_ACCESS zipAccess); IZipArchive * TryOpen(const utf8 * path, ZIP_ACCESS zipAccess); } - -#endif diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 376e1df851..bcd96cc413 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" #include "Drawing.h" @@ -42,5 +40,3 @@ namespace OpenRCT2 { namespace Drawing virtual void DrawGlyph(uint32 image, sint32 x, sint32 y, uint8 * palette) abstract; }; } } - -#endif diff --git a/src/openrct2/drawing/IDrawingEngine.h b/src/openrct2/drawing/IDrawingEngine.h index 026813bb6c..f46b6571b1 100644 --- a/src/openrct2/drawing/IDrawingEngine.h +++ b/src/openrct2/drawing/IDrawingEngine.h @@ -37,8 +37,6 @@ enum DRAWING_ENGINE_FLAGS DEF_DIRTY_OPTIMISATIONS = 1 << 0, }; -#ifdef __cplusplus - struct rct_drawpixelinfo; struct rct_palette_entry; @@ -83,5 +81,3 @@ namespace OpenRCT2 { namespace Drawing sint32 yStart) abstract; }; } } - -#endif diff --git a/src/openrct2/drawing/Rain.h b/src/openrct2/drawing/Rain.h index 3fbbc7c3ab..97bfb60c91 100644 --- a/src/openrct2/drawing/Rain.h +++ b/src/openrct2/drawing/Rain.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" namespace OpenRCT2 { namespace Drawing @@ -26,5 +24,3 @@ namespace OpenRCT2 { namespace Drawing } } void DrawRain(rct_drawpixelinfo * dpi, OpenRCT2::Drawing::IRainDrawer * rainDrawer); - -#endif diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index 57f7e8bf39..2cc06c124a 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" #include "IDrawingContext.h" #include "IDrawingEngine.h" @@ -153,5 +151,3 @@ namespace OpenRCT2 }; } } - -#endif diff --git a/src/openrct2/interface/Cursors.h b/src/openrct2/interface/Cursors.h index c3bd7b7dc8..ea224fa043 100644 --- a/src/openrct2/interface/Cursors.h +++ b/src/openrct2/interface/Cursors.h @@ -51,8 +51,6 @@ enum CURSOR_ID CURSOR_COUNT, }; -#ifdef __cplusplus - namespace OpenRCT2 { namespace Ui { constexpr size_t CURSOR_BIT_WIDTH = 32; @@ -68,5 +66,3 @@ namespace OpenRCT2 { namespace Ui uint8 Mask[CURSOR_BIT_WIDTH * CURSOR_HEIGHT]; }; } } - -#endif diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index 0f37d9c84b..69cbb408a6 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -17,10 +17,7 @@ #ifndef _LANGUAGE_H_ #define _LANGUAGE_H_ -#ifdef __cplusplus #include -#endif - #include "../common.h" #include "../drawing/Font.h" @@ -72,15 +69,13 @@ typedef enum RCT2LanguageId #define FONT_OPENRCT2_SPRITE NULL -#ifdef __cplusplus #include "../interface/FontFamilies.h" -#endif typedef struct language_descriptor { const char *locale; const utf8 *english_name; const utf8 *native_name; -#if defined(__cplusplus) && !defined(NO_TTF) +#if !defined(NO_TTF) TTFontFamily const * font_family; #else void * font_family; @@ -117,9 +112,6 @@ utf8 *rct2_language_string_to_utf8(const char *src, size_t srcSize, RCT2Language bool language_get_localised_scenario_strings(const utf8 *scenarioFilename, rct_string_id *outStringIds); 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 rct_string_id language_allocate_object_string(const std::string &target); -#endif #endif diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index 35cccd5ce6..7df72d7cc3 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../common.h" @@ -40,5 +38,3 @@ namespace LanguagePackFactory ILanguagePack * FromFile(uint16 id, const utf8 * path); ILanguagePack * FromText(uint16 id, const utf8 * text); } - -#endif diff --git a/src/openrct2/network/NetworkAction.h b/src/openrct2/network/NetworkAction.h index 83827849b2..1ea9c2c442 100644 --- a/src/openrct2/network/NetworkAction.h +++ b/src/openrct2/network/NetworkAction.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -45,5 +43,3 @@ public: static sint32 FindCommand(sint32 command); static sint32 FindCommandByPermissionName(const std::string &permission_name); }; - -#endif diff --git a/src/openrct2/network/NetworkConnection.h b/src/openrct2/network/NetworkConnection.h index 7b6b51f758..a798acd1b5 100644 --- a/src/openrct2/network/NetworkConnection.h +++ b/src/openrct2/network/NetworkConnection.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #ifndef DISABLE_NETWORK #include #include @@ -67,4 +65,3 @@ private: }; #endif // DISABLE_NETWORK -#endif diff --git a/src/openrct2/network/NetworkGroup.h b/src/openrct2/network/NetworkGroup.h index 96ec6fdb88..79d38ef634 100644 --- a/src/openrct2/network/NetworkGroup.h +++ b/src/openrct2/network/NetworkGroup.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include @@ -49,5 +47,3 @@ public: private: std::string _name; }; - -#endif diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index 570ae82611..0552f99677 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -19,10 +19,7 @@ #ifndef DISABLE_NETWORK -#ifdef __cplusplus - #include "../common.h" - #include typedef struct evp_pkey_st EVP_PKEY; @@ -51,8 +48,6 @@ 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 717be49017..5585336d9c 100644 --- a/src/openrct2/network/NetworkPacket.h +++ b/src/openrct2/network/NetworkPacket.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "NetworkTypes.h" @@ -76,5 +74,3 @@ public: return *this; } }; - -#endif diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index 1cfde83757..484e985bd6 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../common.h" @@ -54,5 +52,3 @@ public: void Write(NetworkPacket &packet); void AddMoneySpent(money32 cost); }; - -#endif diff --git a/src/openrct2/network/NetworkServerAdvertiser.h b/src/openrct2/network/NetworkServerAdvertiser.h index 1a4cce178e..376bbf3eb3 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.h +++ b/src/openrct2/network/NetworkServerAdvertiser.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" enum class ADVERTISE_STATUS @@ -36,5 +34,3 @@ interface INetworkServerAdvertiser }; INetworkServerAdvertiser * CreateServerAdvertiser(uint16 port); - -#endif diff --git a/src/openrct2/network/NetworkUser.h b/src/openrct2/network/NetworkUser.h index bb62174545..00d22bccbb 100644 --- a/src/openrct2/network/NetworkUser.h +++ b/src/openrct2/network/NetworkUser.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" #include "../core/Nullable.hpp" @@ -68,5 +66,3 @@ private: void DisposeUsers(); static void GetStorePath(utf8 * buffer, size_t bufferSize); }; - -#endif diff --git a/src/openrct2/network/TcpSocket.h b/src/openrct2/network/TcpSocket.h index 7c686f3e8a..895928dd00 100644 --- a/src/openrct2/network/TcpSocket.h +++ b/src/openrct2/network/TcpSocket.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" enum SOCKET_STATUS @@ -73,5 +71,3 @@ namespace Convert uint16 HostToNetwork(uint16 value); uint16 NetworkToHost(uint16 value); } - -#endif diff --git a/src/openrct2/network/http.h b/src/openrct2/network/http.h index b15aecc793..239d3c9515 100644 --- a/src/openrct2/network/http.h +++ b/src/openrct2/network/http.h @@ -17,8 +17,6 @@ #ifndef _HTTP_H_ #define _HTTP_H_ -#ifdef __cplusplus - #ifndef DISABLE_HTTP #include #include @@ -78,5 +76,3 @@ void http_init(); void http_dispose(); #endif - -#endif diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 412ed49bfc..c36dfc0c58 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -14,8 +14,7 @@ *****************************************************************************/ #pragma endregion -#ifndef _NETWORK_H_ -#define _NETWORK_H_ +#pragma once enum { NETWORK_MODE_NONE, @@ -54,8 +53,6 @@ typedef struct GameAction GameAction; #define NETWORK_STREAM_VERSION "30" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION -#ifdef __cplusplus - #include #include #include @@ -296,7 +293,6 @@ private: std::ofstream _server_log_fs; }; -#endif // __cplusplus #else /* DISABLE_NETWORK */ #define NETWORK_STREAM_ID "Multiplayer disabled" #endif /* DISABLE_NETWORK */ @@ -369,5 +365,3 @@ const utf8 * network_get_server_greeting(); const utf8 * network_get_server_provider_name(); const utf8 * network_get_server_provider_email(); const utf8 * network_get_server_provider_website(); - -#endif diff --git a/src/openrct2/object/BannerObject.h b/src/openrct2/object/BannerObject.h index c6e47a85a7..1dedd329d2 100644 --- a/src/openrct2/object/BannerObject.h +++ b/src/openrct2/object/BannerObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "SceneryObject.h" #include "../world/Scenery.h" @@ -38,5 +36,3 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; - -#endif diff --git a/src/openrct2/object/EntranceObject.h b/src/openrct2/object/EntranceObject.h index 7991754ce3..4af4a02985 100644 --- a/src/openrct2/object/EntranceObject.h +++ b/src/openrct2/object/EntranceObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../world/Entrance.h" @@ -38,5 +36,3 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; - -#endif diff --git a/src/openrct2/object/FootpathItemObject.h b/src/openrct2/object/FootpathItemObject.h index 025e082430..14d2c7fefc 100644 --- a/src/openrct2/object/FootpathItemObject.h +++ b/src/openrct2/object/FootpathItemObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "SceneryObject.h" #include "../world/Scenery.h" @@ -38,5 +36,3 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; - -#endif diff --git a/src/openrct2/object/FootpathObject.h b/src/openrct2/object/FootpathObject.h index d22f0ae82a..b1513ab491 100644 --- a/src/openrct2/object/FootpathObject.h +++ b/src/openrct2/object/FootpathObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../world/Footpath.h" @@ -38,5 +36,3 @@ 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 8eab59ad1d..9edfa20391 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../common.h" @@ -40,5 +38,3 @@ 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.h b/src/openrct2/object/LargeSceneryObject.h index 4beaf0adf8..9e6ed8f709 100644 --- a/src/openrct2/object/LargeSceneryObject.h +++ b/src/openrct2/object/LargeSceneryObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "SceneryObject.h" #include "../world/Scenery.h" @@ -45,5 +43,3 @@ public: private: static rct_large_scenery_tile * ReadTiles(IStream * stream); }; - -#endif diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index dff621c9b6..cbec22fa75 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -17,14 +17,9 @@ #pragma once #include "../common.h" - -#ifdef __cplusplus - #include "ImageTable.h" #include "StringTable.h" -#endif - // First 0xF of rct_object_entry->flags typedef enum { @@ -131,8 +126,6 @@ typedef struct rct_object_filters { assert_struct_size(rct_object_filters, 3); #pragma pack(pop) -#ifdef __cplusplus - enum OBJ_STRING_ID { OBJ_STRING_ID_NAME, @@ -222,8 +215,6 @@ enum OBJECT_ERROR : uint32 OBJECT_ERROR_UNEXPECTED_EOF, }; -#endif - extern sint32 object_entry_group_counts[]; extern sint32 object_entry_group_encoding[]; diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index d375d051d1..c8b1793f1d 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" class Object; @@ -28,5 +26,3 @@ 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.h b/src/openrct2/object/ObjectManager.h index b822a1e8c7..bd2a1be382 100644 --- a/src/openrct2/object/ObjectManager.h +++ b/src/openrct2/object/ObjectManager.h @@ -16,15 +16,10 @@ #pragma once -#ifdef __cplusplus - #include -#endif - +#include #include "../common.h" #include "../object/Object.h" -#ifdef __cplusplus - interface IObjectRepository; class Object; struct ObjectRepositoryItem; @@ -51,8 +46,6 @@ interface IObjectManager IObjectManager * CreateObjectManager(IObjectRepository * objectRepository); IObjectManager * GetObjectManager(); -#endif - void * object_manager_get_loaded_object_by_index(size_t index); void * object_manager_get_loaded_object(const rct_object_entry * entry); uint8 object_manager_get_loaded_object_entry_index(const void * loadedObject); diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index fbedc6b931..2c79898b95 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -16,25 +16,18 @@ #pragma once -#ifdef __cplusplus - #include -#endif - +#include #include "../common.h" - #include "../object/Object.h" #include "../ride/Ride.h" -#ifdef __cplusplus - interface IStream; - class Object; - namespace OpenRCT2 - { - interface IPlatformEnvironment; - } -#else - typedef struct Object Object; -#endif +interface IStream; +class Object; +namespace OpenRCT2 +{ + interface IPlatformEnvironment; +} + typedef struct rct_drawpixelinfo rct_drawpixelinfo; @@ -62,8 +55,6 @@ typedef struct ObjectRepositoryItem }; } ObjectRepositoryItem; -#ifdef __cplusplus - interface IObjectRepository { virtual ~IObjectRepository() { } @@ -92,8 +83,6 @@ IObjectRepository * GetObjectRepository(); bool IsObjectCustom(const ObjectRepositoryItem * object); -#endif - size_t object_repository_get_items_count(); const ObjectRepositoryItem * object_repository_get_items(); const ObjectRepositoryItem * object_repository_find_object_by_entry(const rct_object_entry * entry); diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index 003f9bc376..27c467667f 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../ride/Ride.h" @@ -54,5 +52,3 @@ 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.h b/src/openrct2/object/SceneryGroupObject.h index 3a2c1fbf7e..3269c319c3 100644 --- a/src/openrct2/object/SceneryGroupObject.h +++ b/src/openrct2/object/SceneryGroupObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../world/Scenery.h" @@ -49,5 +47,3 @@ public: private: void ReadItems(IStream * stream); }; - -#endif diff --git a/src/openrct2/object/SceneryObject.h b/src/openrct2/object/SceneryObject.h index 7626062c38..18a1386ad7 100644 --- a/src/openrct2/object/SceneryObject.h +++ b/src/openrct2/object/SceneryObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" class SceneryObject : public Object @@ -34,5 +32,3 @@ public: protected: void SetPrimarySceneryGroup(const rct_object_entry * entry) { _primarySceneryGroupEntry = *entry; } }; - -#endif diff --git a/src/openrct2/object/SmallSceneryObject.h b/src/openrct2/object/SmallSceneryObject.h index fbd6851999..973809cf9d 100644 --- a/src/openrct2/object/SmallSceneryObject.h +++ b/src/openrct2/object/SmallSceneryObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "SceneryObject.h" #include "../world/Scenery.h" @@ -47,5 +45,3 @@ private: rct_object_entry GetScgMineHeader(); rct_object_entry GetScgAbstrHeader(); }; - -#endif diff --git a/src/openrct2/object/StexObject.h b/src/openrct2/object/StexObject.h index 533990dd04..bcd752d25d 100644 --- a/src/openrct2/object/StexObject.h +++ b/src/openrct2/object/StexObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../scenario/Scenario.h" @@ -44,5 +42,3 @@ public: std::string GetScenarioDetails() const; std::string GetParkName() const; }; - -#endif diff --git a/src/openrct2/object/StringTable.h b/src/openrct2/object/StringTable.h index f38b5f4193..c370971bbe 100644 --- a/src/openrct2/object/StringTable.h +++ b/src/openrct2/object/StringTable.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -43,5 +41,3 @@ public: std::string GetString(uint8 id) const; void SetString(uint8 id, uint8 language, const std::string &text); }; - -#endif diff --git a/src/openrct2/object/WallObject.h b/src/openrct2/object/WallObject.h index f62404e536..605443e0c0 100644 --- a/src/openrct2/object/WallObject.h +++ b/src/openrct2/object/WallObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "SceneryObject.h" #include "../world/Scenery.h" @@ -38,5 +36,3 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; - -#endif diff --git a/src/openrct2/object/WaterObject.h b/src/openrct2/object/WaterObject.h index 8f09715166..e1c7a6ec1e 100644 --- a/src/openrct2/object/WaterObject.h +++ b/src/openrct2/object/WaterObject.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "Object.h" #include "../world/Water.h" @@ -38,5 +36,3 @@ public: void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override; }; - -#endif diff --git a/src/openrct2/platform/Platform2.h b/src/openrct2/platform/Platform2.h index 45d71b158b..50510a4ee1 100644 --- a/src/openrct2/platform/Platform2.h +++ b/src/openrct2/platform/Platform2.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -47,5 +45,3 @@ namespace Platform std::string FormatShortDate(std::time_t timestamp); std::string FormatTime(std::time_t timestamp); } - -#endif diff --git a/src/openrct2/rct1/Tables.h b/src/openrct2/rct1/Tables.h index eea4dd3a5c..0b51643cfb 100644 --- a/src/openrct2/rct1/Tables.h +++ b/src/openrct2/rct1/Tables.h @@ -16,11 +16,8 @@ #pragma once -#include "../common.h" - -#ifdef __cplusplus - #include +#include "../common.h" namespace RCT1 { @@ -52,5 +49,3 @@ namespace RCT1 const std::vector GetSceneryObjects(uint8 sceneryType); } - -#endif diff --git a/src/openrct2/rct12/SawyerChunk.h b/src/openrct2/rct12/SawyerChunk.h index 7294a4f82e..0c982bb170 100644 --- a/src/openrct2/rct12/SawyerChunk.h +++ b/src/openrct2/rct12/SawyerChunk.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" /** @@ -49,5 +47,3 @@ 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 6c4c05c1e7..2e5dcddaf4 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../common.h" #include "../util/SawyerCoding.h" @@ -78,5 +76,3 @@ private: static size_t DecodeChunkRepeat(void * dst, size_t dstCapacity, const void * src, size_t srcLength); static size_t DecodeChunkRotate(void * dst, size_t dstCapacity, const void * src, size_t srcLength); }; - -#endif diff --git a/src/openrct2/rct12/SawyerChunkWriter.h b/src/openrct2/rct12/SawyerChunkWriter.h index a4ae06cdb0..afbbb431ec 100644 --- a/src/openrct2/rct12/SawyerChunkWriter.h +++ b/src/openrct2/rct12/SawyerChunkWriter.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../common.h" #include "SawyerChunk.h" @@ -57,5 +55,3 @@ public: WriteChunk(src, sizeof(T), encoding); } }; - -#endif diff --git a/src/openrct2/rct12/SawyerEncoding.h b/src/openrct2/rct12/SawyerEncoding.h index 077ed0300c..e738d79804 100644 --- a/src/openrct2/rct12/SawyerEncoding.h +++ b/src/openrct2/rct12/SawyerEncoding.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include "../common.h" interface IStream; @@ -26,5 +24,3 @@ namespace SawyerEncoding { bool ValidateChecksum(IStream * stream); } - -#endif diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 90c8a315fa..9ef75c48a2 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -267,8 +267,6 @@ typedef struct rct2_ride { } rct2_ride; assert_struct_size(rct2_ride, 0x260); -#ifdef __cplusplus - /** * scores.dat file header. * size: 0x10 @@ -303,8 +301,6 @@ struct rct_scores_entry }; assert_struct_size(rct_scores_entry, 0x02B0); -#endif // __cplusplus - #pragma pack(pop) #endif diff --git a/src/openrct2/rct2/S6Exporter.h b/src/openrct2/rct2/S6Exporter.h index 4262de8a57..45b29ad062 100644 --- a/src/openrct2/rct2/S6Exporter.h +++ b/src/openrct2/rct2/S6Exporter.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -56,5 +54,3 @@ private: void ExportResearchedSceneryItems(); void ExportResearchList(); }; - -#endif diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 8d1151ee58..56fe0ec205 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -797,10 +797,8 @@ enum ride_type_flags { RIDE_TYPE_FLAG_HAS_LARGE_CURVES = 1 << 30, // whether the ride supports large (45 degree turn) curves RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR = 1u << 31, }; -#ifdef __cplusplus // Hack for MSVC which thinks RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR = 1u << 31 is signed and generates narrowing conversion warnings constexpr inline uint32 operator | (ride_type_flags a, ride_type_flags b) { return static_cast(static_cast(a) | static_cast(b)); } -#endif enum { RIDE_CRASH_TYPE_NONE = 0, diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index 2e0c000d7e..5ea95d3ce8 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -51,8 +51,6 @@ typedef struct scenario_index_entry utf8 details[256]; } scenario_index_entry; -#ifdef __cplusplus - namespace OpenRCT2 { interface IPlatformEnvironment; @@ -82,8 +80,6 @@ interface IScenarioRepository IScenarioRepository * CreateScenarioRepository(OpenRCT2::IPlatformEnvironment * env); IScenarioRepository * GetScenarioRepository(); -#endif - void scenario_repository_scan(); size_t scenario_repository_get_count(); const scenario_index_entry *scenario_repository_get_by_index(size_t index); diff --git a/src/openrct2/scenario/ScenarioSources.h b/src/openrct2/scenario/ScenarioSources.h index e20533531f..27b93fa927 100644 --- a/src/openrct2/scenario/ScenarioSources.h +++ b/src/openrct2/scenario/ScenarioSources.h @@ -27,8 +27,6 @@ typedef struct source_desc uint8 category; } source_desc; -#ifdef __cplusplus - namespace ScenarioSources { bool TryGetByName(const utf8 * name, source_desc * outDesc); @@ -36,8 +34,6 @@ namespace ScenarioSources void NormaliseName(utf8 * buffer, size_t bufferSize, const utf8 * name); } -#endif - bool scenario_get_source_desc(const utf8 *name, source_desc *outDesc); bool scenario_get_source_desc_by_id(uint8 id, source_desc *outDesc); void scenario_normalise_name(utf8 *buffer, size_t bufferSize, utf8 *name); diff --git a/src/openrct2/title/TitleScreen.h b/src/openrct2/title/TitleScreen.h index c43a3f1876..2652707dca 100644 --- a/src/openrct2/title/TitleScreen.h +++ b/src/openrct2/title/TitleScreen.h @@ -20,7 +20,6 @@ #include "../drawing/Drawing.h" -#ifdef __cplusplus interface ITitleSequencePlayer; class TitleScreen final @@ -52,7 +51,6 @@ private: void TitleInitialise(); bool TryLoadSequence(bool loadPreview = false); }; -#endif void title_load(); void title_create_windows(); diff --git a/src/openrct2/title/TitleSequence.h b/src/openrct2/title/TitleSequence.h index 6dec9d3ef2..986089a858 100644 --- a/src/openrct2/title/TitleSequence.h +++ b/src/openrct2/title/TitleSequence.h @@ -83,12 +83,8 @@ enum TITLE_SCRIPT TITLE_SCRIPT_LOADSC, }; -#ifdef __cplusplus - constexpr const utf8 * TITLE_SEQUENCE_EXTENSION = ".parkseq"; - constexpr uint8 SAVE_INDEX_INVALID = UINT8_MAX; -#else - #define SAVE_INDEX_INVALID UINT8_MAX -#endif +constexpr const utf8 * TITLE_SEQUENCE_EXTENSION = ".parkseq"; +constexpr uint8 SAVE_INDEX_INVALID = UINT8_MAX; TitleSequence * CreateTitleSequence(); TitleSequence * LoadTitleSequence(const utf8 * path); diff --git a/src/openrct2/title/TitleSequenceManager.h b/src/openrct2/title/TitleSequenceManager.h index ebe5ee7c15..66c8dd3ad9 100644 --- a/src/openrct2/title/TitleSequenceManager.h +++ b/src/openrct2/title/TitleSequenceManager.h @@ -15,12 +15,8 @@ #pragma endregion #pragma once - -#include "../common.h" - -#ifdef __cplusplus - #include +#include "../common.h" struct TitleSequenceManagerItem { @@ -43,8 +39,6 @@ namespace TitleSequenceManager constexpr const size_t PREDEFINED_INDEX_CUSTOM = SIZE_MAX; -#endif - size_t title_sequence_manager_get_count(); const utf8 * title_sequence_manager_get_name(size_t index); const utf8 * title_sequence_manager_get_path(size_t index); diff --git a/src/openrct2/title/TitleSequencePlayer.h b/src/openrct2/title/TitleSequencePlayer.h index 28564fb7ea..ea61e68c0f 100644 --- a/src/openrct2/title/TitleSequencePlayer.h +++ b/src/openrct2/title/TitleSequencePlayer.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - interface IScenarioRepository; interface ITitleSequencePlayer @@ -35,12 +33,6 @@ interface ITitleSequencePlayer ITitleSequencePlayer * CreateTitleSequencePlayer(IScenarioRepository * scenarioRepository); -#else - -typedef struct ITitleSequencePlayer ITitleSequencePlayer; - -#endif - // When testing title sequences within a normal game extern bool gPreviewingTitleSequenceInGame; diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index f982c758b0..9b38aad735 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include #include "../common.h" @@ -149,5 +147,3 @@ namespace OpenRCT2 IUiContext * CreateDummyUiContext(); } } - -#endif diff --git a/src/openrct2/ui/WindowManager.h b/src/openrct2/ui/WindowManager.h index a0c63db609..ab4f3b18a2 100644 --- a/src/openrct2/ui/WindowManager.h +++ b/src/openrct2/ui/WindowManager.h @@ -16,8 +16,6 @@ #pragma once -#ifdef __cplusplus - #include #include "../windows/Intent.h" #include "../common.h" @@ -51,5 +49,3 @@ namespace OpenRCT2 IWindowManager * CreateDummyWindowManager(); } } - -#endif diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 7eb7210867..d526032ca3 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -17,13 +17,10 @@ #ifndef _MAP_H_ #define _MAP_H_ +#include #include "../common.h" #include "Location.h" -#ifdef __cplusplus -#include -#endif - #pragma pack(push, 1) typedef struct rct_tile_element_surface_properties { uint8 slope; //4 0xE0 Edge Style, 0x1F Slope diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index f87d6b1881..ccf48fbae5 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -117,12 +117,9 @@ typedef struct rct_balloon { uint8 pad_28[4]; uint8 colour; // 0x2C -#ifdef __cplusplus void Update(); void Pop(); void Press(); -#endif - } rct_balloon; assert_struct_size(rct_balloon, 0x2D); @@ -151,7 +148,6 @@ typedef struct rct_duck { uint8 pad_34[0x14]; uint8 state; // 0x48 -#ifdef __cplusplus void UpdateFlyToWater(); void UpdateSwim(); void UpdateDrink(); @@ -161,7 +157,6 @@ typedef struct rct_duck { void Invalidate(); void Remove(); void MoveTo(sint16 x, sint16 y, sint16 z); -#endif } rct_duck; assert_struct_size(rct_duck, 0x49); @@ -339,12 +334,10 @@ typedef union { rct_crash_splash crash_splash; rct_steam_particle steam_particle; -#ifdef __cplusplus bool IsBalloon(); bool IsDuck(); rct_balloon * AsBalloon(); rct_duck * AsDuck(); -#endif } rct_sprite; assert_struct_size(rct_sprite, 0x100);