diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d768fc727f..1339939c4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: name: Check code formatting runs-on: ubuntu-latest container: - image: openrct2/openrct2-build:0.3.0-format + image: openrct2/openrct2-build:0.3.1-format steps: - name: Checkout uses: actions/checkout@v1 @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-mingw + image: openrct2/openrct2-build:0.3.1-mingw steps: - name: Checkout uses: actions/checkout@v2 @@ -96,7 +96,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-mingw + image: openrct2/openrct2-build:0.3.1-mingw steps: - name: Checkout uses: actions/checkout@v2 @@ -145,7 +145,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-bionic + image: openrct2/openrct2-build:0.3.1-bionic steps: - name: Checkout uses: actions/checkout@v1 @@ -180,7 +180,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-bionic32 + image: openrct2/openrct2-build:0.3.1-bionic32 steps: - name: Checkout uses: actions/checkout@v1 @@ -220,7 +220,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-bionic + image: openrct2/openrct2-build:0.3.1-bionic steps: - name: Checkout uses: actions/checkout@v1 @@ -278,7 +278,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-bionic + image: openrct2/openrct2-build:0.3.1-bionic steps: - name: Checkout uses: actions/checkout@v1 @@ -290,7 +290,7 @@ jobs: runs-on: ubuntu-latest needs: [check-code-formatting] container: - image: openrct2/openrct2-build:0.3.0-android + image: openrct2/openrct2-build:0.3.1-android steps: - name: Checkout uses: actions/checkout@v1 diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index 221351d711..421d8ca956 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -74,6 +74,8 @@ 932A211E22D73CFA00C57EDB /* GameActionCompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20CF22D73CEE00C57EDB /* GameActionCompat.cpp */; }; 932A211F22D73CFA00C57EDB /* GameActionRegistration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A20D322D73CEF00C57EDB /* GameActionRegistration.cpp */; }; 932A212022D73CFA00C57EDB /* GameAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 932A211C22D73CFA00C57EDB /* GameAction.cpp */; }; + 93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93378D00252B4F550077D2D8 /* JsonFwd.hpp */; }; + 93378D03252B54140077D2D8 /* json_fwd.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 93378D02252B54140077D2D8 /* json_fwd.hpp */; }; 933C55B524B858490057E64B /* SeaDecrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933C55B424B858490057E64B /* SeaDecrypt.cpp */; }; 933CBDB520CB1ACD00134678 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB120CB1ACC00134678 /* Widget.cpp */; }; 933CBDB620CB1ACD00134678 /* Theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933CBDB220CB1ACD00134678 /* Theme.cpp */; }; @@ -1064,6 +1066,8 @@ 932A211B22D73CFA00C57EDB /* TrackSetBrakeSpeedAction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TrackSetBrakeSpeedAction.hpp; sourceTree = ""; }; 932A211C22D73CFA00C57EDB /* GameAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameAction.cpp; sourceTree = ""; }; 932A211D22D73CFA00C57EDB /* LargeSceneryRemoveAction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LargeSceneryRemoveAction.hpp; sourceTree = ""; }; + 93378D00252B4F550077D2D8 /* JsonFwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JsonFwd.hpp; sourceTree = ""; }; + 93378D02252B54140077D2D8 /* json_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = json_fwd.hpp; path = "build/json-3.9.1/include/nlohmann/json_fwd.hpp"; sourceTree = SOURCE_ROOT; }; 933C55B424B858490057E64B /* SeaDecrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SeaDecrypt.cpp; sourceTree = ""; }; 933CBDB120CB1ACC00134678 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = ""; }; 933CBDB220CB1ACD00134678 /* Theme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Theme.cpp; sourceTree = ""; }; @@ -2263,6 +2267,7 @@ isa = PBXGroup; children = ( 93FB271E24ED32B7008241C9 /* json.hpp */, + 93378D02252B54140077D2D8 /* json_fwd.hpp */, ); name = nlohmann; path = libxc/include/nlohmann; @@ -2831,6 +2836,7 @@ 2ADE2F25224418B2002598AF /* JobPool.hpp */, F76C83881EC4E7CC00FA49E2 /* Json.cpp */, F76C83891EC4E7CC00FA49E2 /* Json.hpp */, + 93378D00252B4F550077D2D8 /* JsonFwd.hpp */, F76C838B1EC4E7CC00FA49E2 /* Memory.hpp */, F76C838C1EC4E7CC00FA49E2 /* MemoryStream.cpp */, F76C838D1EC4E7CC00FA49E2 /* MemoryStream.h */, @@ -3670,6 +3676,7 @@ 93DFD05524521C1A001FCBAF /* ScMap.hpp in Headers */, 9308DA04209908090079EE96 /* TileElement.h in Headers */, C67B28152002D67A00109C93 /* Widget.h in Headers */, + 93378D01252B4F550077D2D8 /* JsonFwd.hpp in Headers */, C6352B851F477022006CCEE3 /* DataSerialiserTraits.h in Headers */, 93DFD05124521C1A001FCBAF /* ScContext.hpp in Headers */, 939A359F20C12FDE00630B3F /* Paint.Surface.h in Headers */, @@ -3686,6 +3693,7 @@ 93DFD04A24521C1A001FCBAF /* ScConfiguration.hpp in Headers */, 93CBA4CC20A7504500867D56 /* ImageImporter.h in Headers */, 2ADE2F29224418B2002598AF /* Numerics.hpp in Headers */, + 93378D03252B54140077D2D8 /* json_fwd.hpp in Headers */, 93DFD04924521C1A001FCBAF /* ScTile.hpp in Headers */, 936F412B24CE030F00E07BCF /* NetworkBase.h in Headers */, 93DFD04524521C1A001FCBAF /* ScObject.hpp in Headers */, @@ -3889,7 +3897,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "version=\"25\"\nzipname=\"openrct2-libs-v25-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -L -o \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n"; + shellScript = "version=\"26\"\nzipname=\"openrct2-libs-v26-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -L -o \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n"; }; D42C09D21C254F4E00309751 /* Build g2.dat */ = { isa = PBXShellScriptBuildPhase; diff --git a/src/openrct2/core/JsonFwd.hpp b/src/openrct2/core/JsonFwd.hpp new file mode 100644 index 0000000000..37410d3098 --- /dev/null +++ b/src/openrct2/core/JsonFwd.hpp @@ -0,0 +1,14 @@ +/***************************************************************************** + * Copyright (c) 2014-2020 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include + +using json_t = nlohmann::json; diff --git a/src/openrct2/interface/Colour.cpp b/src/openrct2/interface/Colour.cpp index 5c37dea329..bd1dccb19f 100644 --- a/src/openrct2/interface/Colour.cpp +++ b/src/openrct2/interface/Colour.cpp @@ -14,6 +14,7 @@ #include #include +#include rct_colour_map ColourMapA[COLOUR_COUNT] = {}; diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 2a36a0f165..762f7cf5c6 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -169,6 +169,7 @@ + diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index a6e74f4af3..30dc0f4557 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -18,6 +18,7 @@ #include "../actions/NetworkModifyGroupAction.hpp" #include "../actions/PeepPickupAction.hpp" #include "../core/Guard.hpp" +#include "../core/Json.hpp" #include "../platform/Platform2.h" #include "../scripting/ScriptEngine.h" #include "../ui/UiContext.h" @@ -52,7 +53,6 @@ static constexpr uint32_t CHUNK_SIZE = 1024 * 63; # include "../config/Config.h" # include "../core/Console.hpp" # include "../core/FileStream.hpp" -# include "../core/Json.hpp" # include "../core/MemoryStream.h" # include "../core/Nullable.hpp" # include "../core/Path.hpp" diff --git a/src/openrct2/network/NetworkBase.h b/src/openrct2/network/NetworkBase.h index fd8e797f3a..8981377d9e 100644 --- a/src/openrct2/network/NetworkBase.h +++ b/src/openrct2/network/NetworkBase.h @@ -1,7 +1,6 @@ #pragma once #include "../actions/GameAction.h" -#include "../core/Json.hpp" #include "NetworkConnection.h" #include "NetworkGroup.h" #include "NetworkPlayer.h" diff --git a/src/openrct2/network/NetworkGroup.cpp b/src/openrct2/network/NetworkGroup.cpp index 4f5b4e7419..38e24d6647 100644 --- a/src/openrct2/network/NetworkGroup.cpp +++ b/src/openrct2/network/NetworkGroup.cpp @@ -11,6 +11,7 @@ # include "NetworkGroup.h" +# include "../openrct2/core/Json.hpp" # include "NetworkAction.h" # include "NetworkTypes.h" diff --git a/src/openrct2/network/NetworkGroup.h b/src/openrct2/network/NetworkGroup.h index bc84e7dc02..92533cb0ae 100644 --- a/src/openrct2/network/NetworkGroup.h +++ b/src/openrct2/network/NetworkGroup.h @@ -10,7 +10,6 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" #include "NetworkPacket.h" #include diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index a8c176d371..b1275b3810 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -13,6 +13,7 @@ # include "../core/Console.hpp" # include "../core/Guard.hpp" +# include "../core/Json.hpp" # include "../core/Path.hpp" # include "../core/String.hpp" # include "../platform/Platform2.h" diff --git a/src/openrct2/network/NetworkUser.h b/src/openrct2/network/NetworkUser.h index cd4e331267..4cb750dd1d 100644 --- a/src/openrct2/network/NetworkUser.h +++ b/src/openrct2/network/NetworkUser.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include "../core/Nullable.hpp" #include diff --git a/src/openrct2/network/ServerList.h b/src/openrct2/network/ServerList.h index d4c1109557..803d6b4abc 100644 --- a/src/openrct2/network/ServerList.h +++ b/src/openrct2/network/ServerList.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include #include diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index fbfa0dc24f..3bbcd5a9f7 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -15,7 +15,7 @@ #define MAX_SERVER_DESCRIPTION_LENGTH 256 #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include "../localisation/StringIds.h" #include "NetworkTypes.h" diff --git a/src/openrct2/object/BannerObject.cpp b/src/openrct2/object/BannerObject.cpp index d756b2f568..1f38f470c1 100644 --- a/src/openrct2/object/BannerObject.cpp +++ b/src/openrct2/object/BannerObject.cpp @@ -10,6 +10,7 @@ #include "BannerObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../drawing/Drawing.h" #include "../localisation/Language.h" #include "../object/Object.h" diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index 974917bbb1..9bbb92f3f0 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -10,6 +10,7 @@ #include "EntranceObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/object/FootpathItemObject.cpp b/src/openrct2/object/FootpathItemObject.cpp index e3352db258..bc486f0634 100644 --- a/src/openrct2/object/FootpathItemObject.cpp +++ b/src/openrct2/object/FootpathItemObject.cpp @@ -10,6 +10,7 @@ #include "FootpathItemObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../drawing/Drawing.h" #include "../interface/Cursors.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index b755b97a71..eea338f3f6 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -15,6 +15,7 @@ #include "../core/File.h" #include "../core/FileScanner.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/Path.hpp" #include "../core/String.hpp" #include "../drawing/ImageImporter.h" diff --git a/src/openrct2/object/ImageTable.h b/src/openrct2/object/ImageTable.h index 7499a305ef..acd6aeea0d 100644 --- a/src/openrct2/object/ImageTable.h +++ b/src/openrct2/object/ImageTable.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include "../drawing/Drawing.h" #include diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 767929f681..b029ffb38c 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include "ImageTable.h" #include "StringTable.h" diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 9955f0616e..2944d9aff0 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -14,6 +14,7 @@ #include "../OpenRCT2.h" #include "../audio/audio.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/Memory.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index c2217259bd..3ad1dd15c1 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -10,7 +10,6 @@ #pragma once #include "../core/IStream.hpp" -#include "../core/Json.hpp" #include "../ride/Ride.h" #include "Object.h" diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index 5936bb0296..341e77c2d6 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -13,6 +13,7 @@ #include "../Context.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/Memory.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 9cef4276f1..06f20c08e1 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -12,6 +12,7 @@ #include "SmallSceneryObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/Memory.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" diff --git a/src/openrct2/object/StationObject.cpp b/src/openrct2/object/StationObject.cpp index 2b8c37c938..e64f040a8e 100644 --- a/src/openrct2/object/StationObject.cpp +++ b/src/openrct2/object/StationObject.cpp @@ -10,6 +10,7 @@ #include "StationObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/object/StringTable.cpp b/src/openrct2/object/StringTable.cpp index 1994cd9f1f..0293208678 100644 --- a/src/openrct2/object/StringTable.cpp +++ b/src/openrct2/object/StringTable.cpp @@ -10,6 +10,7 @@ #include "StringTable.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../localisation/Language.h" #include "../localisation/LanguagePack.h" diff --git a/src/openrct2/object/StringTable.h b/src/openrct2/object/StringTable.h index 9f75b3a0ed..7ef420a26d 100644 --- a/src/openrct2/object/StringTable.h +++ b/src/openrct2/object/StringTable.h @@ -10,7 +10,7 @@ #pragma once #include "../common.h" -#include "../core/Json.hpp" +#include "../core/JsonFwd.hpp" #include "../localisation/Language.h" #include diff --git a/src/openrct2/object/TerrainEdgeObject.cpp b/src/openrct2/object/TerrainEdgeObject.cpp index 77ca225822..3e26972f03 100644 --- a/src/openrct2/object/TerrainEdgeObject.cpp +++ b/src/openrct2/object/TerrainEdgeObject.cpp @@ -10,6 +10,7 @@ #include "TerrainEdgeObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/object/TerrainSurfaceObject.cpp b/src/openrct2/object/TerrainSurfaceObject.cpp index cfba7585c9..2c67cf9963 100644 --- a/src/openrct2/object/TerrainSurfaceObject.cpp +++ b/src/openrct2/object/TerrainSurfaceObject.cpp @@ -12,6 +12,7 @@ #include "TerrainSurfaceObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/object/WallObject.cpp b/src/openrct2/object/WallObject.cpp index 7fbe8453d6..989bdf6dc1 100644 --- a/src/openrct2/object/WallObject.cpp +++ b/src/openrct2/object/WallObject.cpp @@ -10,6 +10,7 @@ #include "WallObject.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../interface/Cursors.h" diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index 69df434eb9..1a475c3101 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -13,6 +13,7 @@ #include "../OpenRCT2.h" #include "../core/IStream.hpp" +#include "../core/Json.hpp" #include "../localisation/Language.h" #include "../localisation/StringIds.h" #include "../world/Location.hpp"