diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index 51befdacdc..c865ba018d 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -9,11 +9,11 @@ #include "FileClassifier.h" -#include "ParkFile.h" #include "core/Console.hpp" #include "core/FileStream.h" #include "core/Path.hpp" #include "core/String.hpp" +#include "park/ParkFile.h" #include "rct12/SawyerChunkReader.h" #include "scenario/Scenario.h" #include "util/SawyerCoding.h" diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 5f3e1b1d50..37438f9354 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -13,7 +13,6 @@ #include "Game.h" #include "GameStateSnapshots.h" #include "OpenRCT2.h" -#include "ParkFile.h" #include "ParkImporter.h" #include "PlatformEnvironment.h" #include "actions/FootpathPlaceAction.h" @@ -31,6 +30,7 @@ #include "management/NewsItem.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" +#include "park/ParkFile.h" #include "scenario/Scenario.h" #include "world/Park.h" #include "zlib.h" diff --git a/src/openrct2/cmdline/ConvertCommand.cpp b/src/openrct2/cmdline/ConvertCommand.cpp index d69b781bd4..d5f063472e 100644 --- a/src/openrct2/cmdline/ConvertCommand.cpp +++ b/src/openrct2/cmdline/ConvertCommand.cpp @@ -10,13 +10,13 @@ #include "../Context.h" #include "../FileClassifier.h" #include "../OpenRCT2.h" -#include "../ParkFile.h" #include "../ParkImporter.h" #include "../common.h" #include "../core/Console.hpp" #include "../core/Path.hpp" #include "../interface/Window.h" #include "../object/ObjectManager.h" +#include "../park/ParkFile.h" #include "../scenario/Scenario.h" #include "CommandLine.hpp" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 61c7ea40f6..ba32dc720d 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -304,8 +304,10 @@ - + + + @@ -771,8 +773,9 @@ - + + @@ -943,4 +946,4 @@ - \ No newline at end of file + diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index e7351fa5b6..10db659590 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -13,7 +13,6 @@ #include "../Game.h" #include "../GameStateSnapshots.h" #include "../OpenRCT2.h" -#include "../ParkFile.h" #include "../PlatformEnvironment.h" #include "../actions/LoadOrQuitAction.h" #include "../actions/NetworkModifyGroupAction.h" @@ -24,6 +23,7 @@ #include "../entity/EntityRegistry.h" #include "../entity/EntityTweener.h" #include "../localisation/Formatting.h" +#include "../park/ParkFile.h" #include "../platform/Platform2.h" #include "../scenario/Scenario.h" #include "../scripting/ScriptEngine.h" diff --git a/src/openrct2/park/Legacy.cpp b/src/openrct2/park/Legacy.cpp index b79c4f83ae..6f072894ad 100644 --- a/src/openrct2/park/Legacy.cpp +++ b/src/openrct2/park/Legacy.cpp @@ -1,3 +1,19 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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. + *****************************************************************************/ + +#include "Legacy.h" + +#include "../object/ObjectList.h" +#include "../rct2/RCT2.h" + +#include + static std::map oldObjectIds = { { "official.scgpanda", "rct2dlc.scenery_group.scgpanda" }, { "official.wtrpink", "rct2dlc.water.wtrpink" }, @@ -2196,7 +2212,7 @@ static std::map oldObjectIds = { { "rct1.pathsurface.tile.brown", "rct1.footpath_surface.tiles_brown" }, }; -static std::string_view MapToNewObjectIdentifier(std::string_view s) +std::string_view MapToNewObjectIdentifier(std::string_view s) { auto it = oldObjectIds.find(s); if (it != oldObjectIds.end()) @@ -2214,7 +2230,7 @@ static std::map DATPathNames = { { "rct2.medipath", "MEDIPATH" }, { "rct2.mythpath", "MYTHPATH" }, { "rct2.ranbpath", "RANBPATH" }, }; -static std::optional GetDATPathName(std::string_view newPathName) +std::optional GetDATPathName(std::string_view newPathName) { auto it = DATPathNames.find(newPathName); if (it != DATPathNames.end()) @@ -2228,7 +2244,7 @@ static RCT2::FootpathMapping _extendedFootpathMappings[] = { { "rct1.path.tarmac", "rct1.footpath_surface.tarmac", "rct1.footpath_surface.queue_blue", "rct2.footpath_railings.wood" }, }; -static const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc) +const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc) { for (const auto& mapping : _extendedFootpathMappings) { @@ -2257,7 +2273,7 @@ static const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescript return RCT2::GetFootpathSurfaceId(desc); } -static void UpdateFootpathsFromMapping( +void UpdateFootpathsFromMapping( ObjectEntryIndex* pathToSurfaceMap, ObjectEntryIndex* pathToQueueSurfaceMap, ObjectEntryIndex* pathToRailingsMap, ObjectList& requiredObjects, ObjectEntryIndex& surfaceCount, ObjectEntryIndex& railingCount, ObjectEntryIndex entryIndex, const RCT2::FootpathMapping* footpathMapping) diff --git a/src/openrct2/park/Legacy.h b/src/openrct2/park/Legacy.h new file mode 100644 index 0000000000..a84b010aff --- /dev/null +++ b/src/openrct2/park/Legacy.h @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2014-2021 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 "../object/Object.h" + +#include +#include + +namespace RCT2 +{ + struct FootpathMapping; +} +struct ObjectEntryDescriptor; +class ObjectList; + +std::string_view MapToNewObjectIdentifier(std::string_view s); +std::optional GetDATPathName(std::string_view newPathName); +const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc); +void UpdateFootpathsFromMapping( + ObjectEntryIndex* pathToSurfaceMap, ObjectEntryIndex* pathToQueueSurfaceMap, ObjectEntryIndex* pathToRailingsMap, + ObjectList& requiredObjects, ObjectEntryIndex& surfaceCount, ObjectEntryIndex& railingCount, ObjectEntryIndex entryIndex, + const RCT2::FootpathMapping* footpathMapping); diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index d8aa274173..c9c37139b9 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2019 OpenRCT2 developers + * Copyright (c) 2014-2021 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -9,49 +9,50 @@ #include "ParkFile.h" -#include "Cheats.h" -#include "Context.h" -#include "Editor.h" -#include "GameState.h" -#include "OpenRCT2.h" -#include "ParkImporter.h" -#include "Version.h" -#include "core/Console.hpp" -#include "core/Crypt.h" -#include "core/DataSerialiser.h" -#include "core/File.h" -#include "core/OrcaStream.hpp" -#include "core/Path.hpp" -#include "drawing/Drawing.h" -#include "entity/Balloon.h" -#include "entity/Duck.h" -#include "entity/EntityList.h" -#include "entity/EntityRegistry.h" -#include "entity/Fountain.h" -#include "entity/Litter.h" -#include "entity/MoneyEffect.h" -#include "entity/Particle.h" -#include "entity/Staff.h" -#include "interface/Viewport.h" -#include "interface/Window.h" -#include "localisation/Date.h" -#include "localisation/Localisation.h" -#include "management/Award.h" -#include "management/Finance.h" -#include "management/NewsItem.h" -#include "object/Object.h" -#include "object/ObjectManager.h" -#include "object/ObjectRepository.h" -#include "peep/RideUseSystem.h" -#include "ride/ShopItem.h" -#include "ride/Vehicle.h" -#include "scenario/Scenario.h" -#include "scenario/ScenarioRepository.h" -#include "world/Climate.h" -#include "world/Entrance.h" -#include "world/Map.h" -#include "world/Park.h" -#include "world/Scenery.h" +#include "../Cheats.h" +#include "../Context.h" +#include "../Editor.h" +#include "../GameState.h" +#include "../OpenRCT2.h" +#include "../ParkImporter.h" +#include "../Version.h" +#include "../core/Console.hpp" +#include "../core/Crypt.h" +#include "../core/DataSerialiser.h" +#include "../core/File.h" +#include "../core/OrcaStream.hpp" +#include "../core/Path.hpp" +#include "../drawing/Drawing.h" +#include "../entity/Balloon.h" +#include "../entity/Duck.h" +#include "../entity/EntityList.h" +#include "../entity/EntityRegistry.h" +#include "../entity/Fountain.h" +#include "../entity/Litter.h" +#include "../entity/MoneyEffect.h" +#include "../entity/Particle.h" +#include "../entity/Staff.h" +#include "../interface/Viewport.h" +#include "../interface/Window.h" +#include "../localisation/Date.h" +#include "../localisation/Localisation.h" +#include "../management/Award.h" +#include "../management/Finance.h" +#include "../management/NewsItem.h" +#include "../object/Object.h" +#include "../object/ObjectManager.h" +#include "../object/ObjectRepository.h" +#include "../peep/RideUseSystem.h" +#include "../ride/ShopItem.h" +#include "../ride/Vehicle.h" +#include "../scenario/Scenario.h" +#include "../scenario/ScenarioRepository.h" +#include "../world/Climate.h" +#include "../world/Entrance.h" +#include "../world/Map.h" +#include "../world/Park.h" +#include "../world/Scenery.h" +#include "Legacy.h" #include #include @@ -62,14 +63,6 @@ using namespace OpenRCT2; -static std::string_view MapToNewObjectIdentifier(std::string_view s); -static std::optional GetDATPathName(std::string_view newPathName); -static const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc); -static void UpdateFootpathsFromMapping( - ObjectEntryIndex* pathToSurfaceMap, ObjectEntryIndex* pathToQueueSurfaceMap, ObjectEntryIndex* pathToRailingsMap, - ObjectList& requiredObjects, ObjectEntryIndex& surfaceCount, ObjectEntryIndex& railingCount, ObjectEntryIndex entryIndex, - const RCT2::FootpathMapping* footpathMapping); - namespace OpenRCT2 { // Current version that is saved. @@ -2342,4 +2335,3 @@ std::unique_ptr ParkImporter::CreateParkFile(IObjectRepository& o { return std::make_unique(objectRepository); } - diff --git a/src/openrct2/ParkFile.h b/src/openrct2/park/ParkFile.h similarity index 100% rename from src/openrct2/ParkFile.h rename to src/openrct2/park/ParkFile.h diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 1ff0fb17b9..5367c1b077 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -27,7 +27,6 @@ # include "../Context.h" # include "../Game.h" # include "../OpenRCT2.h" -# include "../ParkFile.h" # include "../PlatformEnvironment.h" # include "../Version.h" # include "../config/Config.h" @@ -38,6 +37,7 @@ # include "../interface/Screenshot.h" # include "../localisation/Language.h" # include "../object/ObjectManager.h" +# include "../park/ParkFile.h" # include "../scenario/Scenario.h" # include "../util/SawyerCoding.h" # include "../util/Util.h" diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index c59bcefb20..536da6cc09 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include #include #include +#include #include #include #include