From 622a8dc525bd7c819073e616be54e0d458673ad2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 25 Mar 2025 22:27:57 +0100 Subject: [PATCH] Rename DIRBASE and its members --- .../engines/opengl/OpenGLShaderProgram.cpp | 2 +- src/openrct2-ui/interface/FileBrowser.cpp | 4 +- src/openrct2-ui/interface/Theme.cpp | 2 +- src/openrct2-ui/windows/InstallTrack.cpp | 2 +- src/openrct2-ui/windows/Options.cpp | 2 +- src/openrct2-ui/windows/TitleMenu.cpp | 2 +- src/openrct2/AssetPackManager.cpp | 4 +- src/openrct2/Context.cpp | 10 +-- src/openrct2/Game.cpp | 10 +-- src/openrct2/PlatformEnvironment.cpp | 82 +++++++++---------- src/openrct2/PlatformEnvironment.h | 28 +++---- src/openrct2/ReplayManager.cpp | 4 +- src/openrct2/audio/Audio.cpp | 2 +- src/openrct2/config/Config.cpp | 4 +- src/openrct2/drawing/Drawing.Sprite.cpp | 4 +- src/openrct2/interface/InteractiveConsole.cpp | 6 +- src/openrct2/interface/Screenshot.cpp | 2 +- .../localisation/LocalisationService.cpp | 2 +- src/openrct2/network/NetworkBase.cpp | 12 +-- src/openrct2/network/NetworkUser.cpp | 2 +- src/openrct2/network/ServerList.cpp | 2 +- src/openrct2/object/ImageTable.cpp | 2 +- src/openrct2/object/MusicObject.cpp | 2 +- src/openrct2/object/ObjectRepository.cpp | 6 +- src/openrct2/object/ResourceTable.cpp | 14 ++-- src/openrct2/platform/Crash.cpp | 2 +- src/openrct2/rct12/ScenarioPatcher.cpp | 2 +- src/openrct2/ride/TrackDesignRepository.cpp | 8 +- src/openrct2/scenario/Scenario.cpp | 2 +- src/openrct2/scenario/ScenarioRepository.cpp | 10 +-- .../scenes/title/TitleSequenceManager.cpp | 4 +- src/openrct2/scripting/ScriptEngine.cpp | 4 +- test/tests/ScenarioPatcherTests.cpp | 2 +- 33 files changed, 123 insertions(+), 123 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index f266aebb27..84aee486f5 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -59,7 +59,7 @@ GLuint OpenGLShader::GetShaderId() std::string OpenGLShader::GetPath(const std::string& name) { auto env = GetContext()->GetPlatformEnvironment(); - auto shadersPath = env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::SHADER); + auto shadersPath = env->GetDirectoryPath(DirBase::openrct2, DIRID::SHADER); auto path = Path::Combine(shadersPath, name); if (_type == GL_VERTEX_SHADER) { diff --git a/src/openrct2-ui/interface/FileBrowser.cpp b/src/openrct2-ui/interface/FileBrowser.cpp index 79bfd8f213..6f0943ba33 100644 --- a/src/openrct2-ui/interface/FileBrowser.cpp +++ b/src/openrct2-ui/interface/FileBrowser.cpp @@ -146,9 +146,9 @@ namespace OpenRCT2::Ui::FileBrowser auto env = GetContext()->GetPlatformEnvironment(); if (subdir.has_value()) - return env->GetDirectoryPath(DIRBASE::USER, subdir.value()); + return env->GetDirectoryPath(DirBase::user, subdir.value()); else - return env->GetDirectoryPath(DIRBASE::USER); + return env->GetDirectoryPath(DirBase::user); } const char* GetFilterPatternByType(const LoadSaveType type, const bool isSave) diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index e1b3e609c1..e833b00006 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -688,7 +688,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = { auto context = GetContext(); auto env = context->GetPlatformEnvironment(); - return env->GetDirectoryPath(DIRBASE::USER, DIRID::THEME); + return env->GetDirectoryPath(DirBase::user, DIRID::THEME); } } // namespace ThemeManager diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 03e44a6a35..acfce4edd3 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -368,7 +368,7 @@ namespace OpenRCT2::Ui::Windows void InstallTrackDesign() { auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); + auto destPath = env->GetDirectoryPath(OpenRCT2::DirBase::user, OpenRCT2::DIRID::TRACK); if (!Path::CreateDirectory(destPath)) { LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 578c8c08a1..88317e22e3 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2207,7 +2207,7 @@ namespace OpenRCT2::Ui::Windows static bool IsRCT1TitleMusicAvailable() { auto env = GetContext()->GetPlatformEnvironment(); - auto rct1path = env->GetDirectoryPath(DIRBASE::RCT1); + auto rct1path = env->GetDirectoryPath(DirBase::rct1); return !rct1path.empty(); } diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index ac31a73bbe..c046b7a135 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -246,7 +246,7 @@ namespace OpenRCT2::Ui::Windows auto context = OpenRCT2::GetContext(); auto env = context->GetPlatformEnvironment(); auto uiContext = context->GetUiContext(); - uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER)); + uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DirBase::user)); break; } default: diff --git a/src/openrct2/AssetPackManager.cpp b/src/openrct2/AssetPackManager.cpp index 0145dc6b25..934a08afd4 100644 --- a/src/openrct2/AssetPackManager.cpp +++ b/src/openrct2/AssetPackManager.cpp @@ -70,10 +70,10 @@ void AssetPackManager::Scan() auto context = GetContext(); auto env = context->GetPlatformEnvironment(); - auto openrct2Dir = fs::u8path(env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::ASSET_PACK)); + auto openrct2Dir = fs::u8path(env->GetDirectoryPath(DirBase::openrct2, DIRID::ASSET_PACK)); Scan(openrct2Dir); - auto userDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK)); + auto userDirectory = fs::u8path(env->GetDirectoryPath(DirBase::user, DIRID::ASSET_PACK)); Path::CreateDirectory(userDirectory.u8string()); Scan(userDirectory); } diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 10201a152b..739eabf547 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -459,7 +459,7 @@ namespace OpenRCT2 { return false; } - _env->SetBasePath(DIRBASE::RCT2, rct2InstallPath); + _env->SetBasePath(DirBase::rct2, rct2InstallPath); } // The repositories are all dependent on the RCT2 path being set, @@ -1429,7 +1429,7 @@ namespace OpenRCT2 void EnsureUserContentDirectoriesExist() { EnsureDirectoriesExist( - DIRBASE::USER, + DirBase::user, { DIRID::OBJECT, DIRID::SAVE, @@ -1446,7 +1446,7 @@ namespace OpenRCT2 }); } - void EnsureDirectoriesExist(const DIRBASE dirBase, const std::initializer_list& dirIds) + void EnsureDirectoriesExist(const DirBase dirBase, const std::initializer_list& dirIds) { for (const auto& dirId : dirIds) { @@ -1467,8 +1467,8 @@ namespace OpenRCT2 void CopyOriginalUserFilesOver(DIRID dirid, const std::string& pattern) { - auto src = _env->GetDirectoryPath(DIRBASE::RCT2, dirid); - auto dst = _env->GetDirectoryPath(DIRBASE::USER, dirid); + auto src = _env->GetDirectoryPath(DirBase::rct2, dirid); + auto dst = _env->GetDirectoryPath(DirBase::user, dirid); CopyOriginalUserFilesOver(src, dst, pattern); } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 537e9ea3bc..504c7a8bf4 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -475,7 +475,7 @@ void SaveGameCmd(u8string_view name /* = {} */) else { auto env = GetContext()->GetPlatformEnvironment(); - auto savePath = Path::Combine(env->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE), u8string(name) + u8".park"); + auto savePath = Path::Combine(env->GetDirectoryPath(DirBase::user, DIRID::SAVE), u8string(name) + u8".park"); SaveGameWithName(savePath); } } @@ -518,11 +518,11 @@ static void LimitAutosaveCount(const size_t numberOfFilesToKeep, bool processLan size_t numAutosavesToDelete = 0; auto environment = GetContext()->GetPlatformEnvironment(); - auto folderDirectory = environment->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE); + auto folderDirectory = environment->GetDirectoryPath(DirBase::user, DIRID::SAVE); char const* fileFilter = "autosave_*.park"; if (processLandscapeFolder) { - folderDirectory = environment->GetDirectoryPath(DIRBASE::USER, DIRID::LANDSCAPE); + folderDirectory = environment->GetDirectoryPath(DirBase::user, DIRID::LANDSCAPE); fileFilter = "autosave_*.park"; } @@ -596,7 +596,7 @@ void GameAutosave() LimitAutosaveCount(autosavesToKeep - 1, isInEditorMode()); auto env = GetContext()->GetPlatformEnvironment(); - auto autosaveDir = Path::Combine(env->GetDirectoryPath(DIRBASE::USER, subDirectory), u8"autosave"); + auto autosaveDir = Path::Combine(env->GetDirectoryPath(DirBase::user, subDirectory), u8"autosave"); Path::CreateDirectory(autosaveDir); auto path = Path::Combine(autosaveDir, timeName); @@ -711,7 +711,7 @@ void GameLoadOrQuitNoSavePrompt() void StartSilentRecord() { std::string name = Path::Combine( - OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath(OpenRCT2::DIRBASE::USER), u8"debug_replay.parkrep"); + OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath(OpenRCT2::DirBase::user), u8"debug_replay.parkrep"); auto* replayManager = OpenRCT2::GetContext()->GetReplayManager(); if (replayManager->StartRecording(name, OpenRCT2::k_MaxReplayTicks, OpenRCT2::IReplayManager::RecordType::SILENT)) { diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 16ef59f68f..84d745db01 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -87,7 +87,7 @@ private: bool _usingRCTClassic{}; public: - explicit PlatformEnvironment(DIRBASE_VALUES basePaths) + explicit PlatformEnvironment(DirBaseValues basePaths) { for (size_t i = 0; i < kDirBaseCount; i++) { @@ -95,27 +95,27 @@ public: } } - u8string GetDirectoryPath(DIRBASE base) const override + u8string GetDirectoryPath(DirBase base) const override { return _basePath[EnumValue(base)]; } - u8string GetDirectoryPath(DIRBASE base, DIRID did) const override + u8string GetDirectoryPath(DirBase base, DIRID did) const override { auto basePath = GetDirectoryPath(base); u8string_view directoryName; switch (base) { default: - case DIRBASE::RCT1: + case DirBase::rct1: directoryName = kDirectoryNamesRCT2[EnumValue(did)]; break; - case DIRBASE::RCT2: + case DirBase::rct2: directoryName = _usingRCTClassic ? "Assets" : kDirectoryNamesRCT2[EnumValue(did)]; break; - case DIRBASE::OPENRCT2: - case DIRBASE::USER: - case DIRBASE::CONFIG: + case DirBase::openrct2: + case DirBase::user: + case DirBase::config: directoryName = kDirectoryNamesOpenRCT2[EnumValue(did)]; break; } @@ -131,12 +131,12 @@ public: return Path::Combine(basePath, fileName); } - u8string FindFile(DIRBASE base, DIRID did, u8string_view fileName) const override + u8string FindFile(DirBase base, DIRID did, u8string_view fileName) const override { auto dataPath = GetDirectoryPath(base, did); std::string alternativeFilename; - if (_usingRCTClassic && base == DIRBASE::RCT2 && did == DIRID::DATA) + if (_usingRCTClassic && base == DirBase::rct2 && did == DIRID::DATA) { // Special case, handle RCT Classic css ogg files if (String::startsWith(fileName, "css", true) && String::endsWith(fileName, ".dat", true)) @@ -148,7 +148,7 @@ public: } auto path = Path::ResolveCasing(Path::Combine(dataPath, fileName)); - if (base == DIRBASE::RCT1 && did == DIRID::DATA && !File::Exists(path)) + if (base == DirBase::rct1 && did == DIRID::DATA && !File::Exists(path)) { // Special case, handle RCT1 steam layout where some data files are under a CD root auto basePath = GetDirectoryPath(base); @@ -162,11 +162,11 @@ public: return path; } - void SetBasePath(DIRBASE base, u8string_view path) override + void SetBasePath(DirBase base, u8string_view path) override { _basePath[EnumValue(base)] = path; - if (base == DIRBASE::RCT2) + if (base == DirBase::rct2) { _usingRCTClassic = Platform::IsRCTClassicPath(path); } @@ -178,35 +178,35 @@ public: } private: - static DIRBASE GetDefaultBaseDirectory(PATHID pathid) + static DirBase GetDefaultBaseDirectory(PATHID pathid) { switch (pathid) { case PATHID::CONFIG: case PATHID::CONFIG_SHORTCUTS_LEGACY: case PATHID::CONFIG_SHORTCUTS: - return DIRBASE::CONFIG; + return DirBase::config; case PATHID::CACHE_OBJECTS: case PATHID::CACHE_TRACKS: case PATHID::CACHE_SCENARIOS: - return DIRBASE::CACHE; + return DirBase::cache; case PATHID::SCORES_RCT2: - return DIRBASE::RCT2; + return DirBase::rct2; case PATHID::CHANGELOG: case PATHID::CONTRIBUTORS: - return DIRBASE::DOCUMENTATION; + return DirBase::documentation; case PATHID::NETWORK_GROUPS: case PATHID::NETWORK_SERVERS: case PATHID::NETWORK_USERS: case PATHID::SCORES: case PATHID::SCORES_LEGACY: default: - return DIRBASE::USER; + return DirBase::user; } } }; -std::unique_ptr OpenRCT2::CreatePlatformEnvironment(DIRBASE_VALUES basePaths) +std::unique_ptr OpenRCT2::CreatePlatformEnvironment(DirBaseValues basePaths) { return std::make_unique(basePaths); } @@ -226,35 +226,35 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() // Set default paths std::string basePaths[kDirBaseCount]; - basePaths[EnumValue(DIRBASE::OPENRCT2)] = Platform::GetInstallPath(); - basePaths[EnumValue(DIRBASE::USER)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_DATA), subDirectory); - basePaths[EnumValue(DIRBASE::CONFIG)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CONFIG), subDirectory); - basePaths[EnumValue(DIRBASE::CACHE)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CACHE), subDirectory); - basePaths[EnumValue(DIRBASE::DOCUMENTATION)] = Platform::GetDocsPath(); + basePaths[EnumValue(DirBase::openrct2)] = Platform::GetInstallPath(); + basePaths[EnumValue(DirBase::user)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_DATA), subDirectory); + basePaths[EnumValue(DirBase::config)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CONFIG), subDirectory); + basePaths[EnumValue(DirBase::cache)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CACHE), subDirectory); + basePaths[EnumValue(DirBase::documentation)] = Platform::GetDocsPath(); // Override paths that have been specified via the command line if (!gCustomRCT1DataPath.empty()) { - basePaths[EnumValue(DIRBASE::RCT1)] = gCustomRCT1DataPath; + basePaths[EnumValue(DirBase::rct1)] = gCustomRCT1DataPath; } if (!gCustomRCT2DataPath.empty()) { - basePaths[EnumValue(DIRBASE::RCT2)] = gCustomRCT2DataPath; + basePaths[EnumValue(DirBase::rct2)] = gCustomRCT2DataPath; } if (!gCustomOpenRCT2DataPath.empty()) { - basePaths[EnumValue(DIRBASE::OPENRCT2)] = gCustomOpenRCT2DataPath; + basePaths[EnumValue(DirBase::openrct2)] = gCustomOpenRCT2DataPath; } if (!gCustomUserDataPath.empty()) { - basePaths[EnumValue(DIRBASE::USER)] = gCustomUserDataPath; - basePaths[EnumValue(DIRBASE::CONFIG)] = gCustomUserDataPath; - basePaths[EnumValue(DIRBASE::CACHE)] = gCustomUserDataPath; + basePaths[EnumValue(DirBase::user)] = gCustomUserDataPath; + basePaths[EnumValue(DirBase::config)] = gCustomUserDataPath; + basePaths[EnumValue(DirBase::cache)] = gCustomUserDataPath; } - if (basePaths[EnumValue(DIRBASE::DOCUMENTATION)].empty()) + if (basePaths[EnumValue(DirBase::documentation)].empty()) { - basePaths[EnumValue(DIRBASE::DOCUMENTATION)] = basePaths[EnumValue(DIRBASE::OPENRCT2)]; + basePaths[EnumValue(DirBase::documentation)] = basePaths[EnumValue(DirBase::openrct2)]; } auto env = OpenRCT2::CreatePlatformEnvironment(basePaths); @@ -268,20 +268,20 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() } if (gCustomRCT1DataPath.empty()) { - env->SetBasePath(DIRBASE::RCT1, Config::Get().general.RCT1Path); + env->SetBasePath(DirBase::rct1, Config::Get().general.RCT1Path); } if (gCustomRCT2DataPath.empty()) { - env->SetBasePath(DIRBASE::RCT2, Config::Get().general.RCT2Path); + env->SetBasePath(DirBase::rct2, Config::Get().general.RCT2Path); } // Log base paths - LOG_VERBOSE("DIRBASE::RCT1 : %s", env->GetDirectoryPath(DIRBASE::RCT1).c_str()); - LOG_VERBOSE("DIRBASE::RCT2 : %s", env->GetDirectoryPath(DIRBASE::RCT2).c_str()); - LOG_VERBOSE("DIRBASE::OPENRCT2: %s", env->GetDirectoryPath(DIRBASE::OPENRCT2).c_str()); - LOG_VERBOSE("DIRBASE::USER : %s", env->GetDirectoryPath(DIRBASE::USER).c_str()); - LOG_VERBOSE("DIRBASE::CONFIG : %s", env->GetDirectoryPath(DIRBASE::CONFIG).c_str()); - LOG_VERBOSE("DIRBASE::CACHE : %s", env->GetDirectoryPath(DIRBASE::CACHE).c_str()); + LOG_VERBOSE("DirBase::rct1 : %s", env->GetDirectoryPath(DirBase::rct1).c_str()); + LOG_VERBOSE("DirBase::rct2 : %s", env->GetDirectoryPath(DirBase::rct2).c_str()); + LOG_VERBOSE("DirBase::openrct2: %s", env->GetDirectoryPath(DirBase::openrct2).c_str()); + LOG_VERBOSE("DirBase::user : %s", env->GetDirectoryPath(DirBase::user).c_str()); + LOG_VERBOSE("DirBase::config : %s", env->GetDirectoryPath(DirBase::config).c_str()); + LOG_VERBOSE("DirBase::cache : %s", env->GetDirectoryPath(DirBase::cache).c_str()); return env; } diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index cffd7c33df..3812415301 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -16,18 +16,18 @@ namespace OpenRCT2 { - enum class DIRBASE : size_t + enum class DirBase : size_t { - RCT1, // Base directory for original RollerCoaster Tycoon 1 content. - RCT2, // Base directory for original RollerCoaster Tycoon 2 content. - OPENRCT2, // Base directory for OpenRCT2 installation. - USER, // Base directory for OpenRCT2 user content. - CONFIG, // Base directory for OpenRCT2 configuration. - CACHE, // Base directory for OpenRCT2 cache files. - DOCUMENTATION, // Base directory for OpenRCT2 doc files. + rct1, // Base directory for original RollerCoaster Tycoon 1 content. + rct2, // Base directory for original RollerCoaster Tycoon 2 content. + openrct2, // Base directory for OpenRCT2 installation. + user, // Base directory for OpenRCT2 user content. + config, // Base directory for OpenRCT2 configuration. + cache, // Base directory for OpenRCT2 cache files. + documentation, // Base directory for OpenRCT2 doc files. }; constexpr size_t kDirBaseCount = 7; - using DIRBASE_VALUES = u8string[kDirBaseCount]; + using DirBaseValues = u8string[kDirBaseCount]; enum class DIRID { @@ -80,15 +80,15 @@ namespace OpenRCT2 { virtual ~IPlatformEnvironment() = default; - virtual u8string GetDirectoryPath(DIRBASE base) const = 0; - virtual u8string GetDirectoryPath(DIRBASE base, DIRID did) const = 0; + virtual u8string GetDirectoryPath(DirBase base) const = 0; + virtual u8string GetDirectoryPath(DirBase base, DIRID did) const = 0; virtual u8string GetFilePath(PATHID pathid) const = 0; - virtual u8string FindFile(DIRBASE base, DIRID did, u8string_view fileName) const = 0; - virtual void SetBasePath(DIRBASE base, u8string_view path) = 0; + virtual u8string FindFile(DirBase base, DIRID did, u8string_view fileName) const = 0; + virtual void SetBasePath(DirBase base, u8string_view path) = 0; virtual bool IsUsingClassic() const = 0; }; - [[nodiscard]] std::unique_ptr CreatePlatformEnvironment(DIRBASE_VALUES basePaths); + [[nodiscard]] std::unique_ptr CreatePlatformEnvironment(DirBaseValues basePaths); [[nodiscard]] std::unique_ptr CreatePlatformEnvironment(); } // namespace OpenRCT2 diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index ea184f1d61..d2da5f2a65 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -414,7 +414,7 @@ namespace OpenRCT2 if (res != cmpData.spriteChanges.end()) { std::string outputPath = GetContext()->GetPlatformEnvironment()->GetDirectoryPath( - DIRBASE::USER, DIRID::LOG_DESYNCS); + DirBase::user, DIRID::LOG_DESYNCS); char uniqueFileName[128] = {}; snprintf(uniqueFileName, sizeof(uniqueFileName), "replay_desync_%u.txt", currentTicks); @@ -624,7 +624,7 @@ namespace OpenRCT2 fileName += ".parkrep"; } - std::string outPath = GetContext()->GetPlatformEnvironment()->GetDirectoryPath(DIRBASE::USER, DIRID::REPLAY); + std::string outPath = GetContext()->GetPlatformEnvironment()->GetDirectoryPath(DirBase::user, DIRID::REPLAY); std::string outFile = Path::Combine(outPath, fileName); bool loaded = false; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index a206735cc4..450185930f 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -253,7 +253,7 @@ namespace OpenRCT2::Audio static bool IsRCT1TitleMusicAvailable() { auto env = GetContext()->GetPlatformEnvironment(); - auto rct1path = env->GetDirectoryPath(DIRBASE::RCT1); + auto rct1path = env->GetDirectoryPath(DirBase::rct1); return !rct1path.empty(); } diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index d2d0622205..7480aa1f32 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -819,7 +819,7 @@ namespace OpenRCT2::Config u8string GetDefaultPath() { auto env = GetContext()->GetPlatformEnvironment(); - return Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"config.ini"); + return Path::Combine(env->GetDirectoryPath(DirBase::user), u8"config.ini"); } bool SaveToPath(u8string_view path) @@ -903,7 +903,7 @@ namespace OpenRCT2::Config } const std::string dest = Path::Combine( - GetContext()->GetPlatformEnvironment()->GetDirectoryPath(DIRBASE::CONFIG), "rct2"); + GetContext()->GetPlatformEnvironment()->GetDirectoryPath(DirBase::config), "rct2"); while (true) { diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 2cb167530d..09d4a7164a 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -451,7 +451,7 @@ bool GfxLoadG1(const IPlatformEnvironment& env) LOG_VERBOSE("GfxLoadG1(...)"); try { - auto path = env.FindFile(DIRBASE::RCT2, DIRID::DATA, u8"g1.dat"); + auto path = env.FindFile(DirBase::rct2, DIRID::DATA, u8"g1.dat"); auto fs = FileStream(path, FileMode::open); _g1.header = fs.ReadValue(); @@ -528,7 +528,7 @@ bool GfxLoadG2() auto env = GetContext()->GetPlatformEnvironment(); - std::string path = Path::Combine(env->GetDirectoryPath(DIRBASE::OPENRCT2), u8"g2.dat"); + std::string path = Path::Combine(env->GetDirectoryPath(DirBase::openrct2), u8"g2.dat"); try { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index b9f240ae1f..16e8f4170e 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1318,7 +1318,7 @@ static void ConsoleCommandLoadPark([[maybe_unused]] InteractiveConsole& console, { // no / or \ was included. File should be in save dir. auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - auto directory = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::SAVE); + auto directory = env->GetDirectoryPath(OpenRCT2::DirBase::user, OpenRCT2::DIRID::SAVE); savePath = Path::Combine(directory, argv[0]); } else @@ -1391,7 +1391,7 @@ static void ConsoleCommandReplayStartRecord(InteractiveConsole& console, const a name += ".parkrep"; } std::string outPath = OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath( - OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::REPLAY); + OpenRCT2::DirBase::user, OpenRCT2::DIRID::REPLAY); name = Path::Combine(outPath, name); // If ticks are specified by user use that otherwise maximum ticks specified by const. @@ -1517,7 +1517,7 @@ static void ConsoleCommandReplayNormalise(InteractiveConsole& console, const arg outputFile += ".parkrep"; } std::string outPath = OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath( - OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::REPLAY); + OpenRCT2::DirBase::user, OpenRCT2::DIRID::REPLAY); outputFile = Path::Combine(outPath, outputFile); auto* replayManager = OpenRCT2::GetContext()->GetReplayManager(); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 390e969726..35c1a95bea 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -118,7 +118,7 @@ static std::string ScreenshotGetParkName() static std::string ScreenshotGetDirectory() { auto env = GetContext()->GetPlatformEnvironment(); - return env->GetDirectoryPath(DIRBASE::USER, DIRID::SCREENSHOT); + return env->GetDirectoryPath(DirBase::user, DIRID::SCREENSHOT); } static std::pair ScreenshotGetDateTime() diff --git a/src/openrct2/localisation/LocalisationService.cpp b/src/openrct2/localisation/LocalisationService.cpp index 6f0871f740..f2426166ad 100644 --- a/src/openrct2/localisation/LocalisationService.cpp +++ b/src/openrct2/localisation/LocalisationService.cpp @@ -70,7 +70,7 @@ const char* LocalisationService::GetString(StringId id) const std::string LocalisationService::GetLanguagePath(uint32_t languageId) const { auto locale = std::string(LanguagesDescriptors[languageId].locale); - auto languageDirectory = _env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::LANGUAGE); + auto languageDirectory = _env->GetDirectoryPath(DirBase::openrct2, DIRID::LANGUAGE); auto languagePath = Path::Combine(languageDirectory, locale + u8".txt"); return languagePath; } diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 9526910710..b67340958a 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -1019,7 +1019,7 @@ void NetworkBase::SaveGroups() if (GetMode() == NETWORK_MODE_SERVER) { auto env = GetContext().GetPlatformEnvironment(); - auto path = Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"groups.json"); + auto path = Path::Combine(env->GetDirectoryPath(DirBase::user), u8"groups.json"); json_t jsonGroups = json_t::array(); for (auto& group : group_list) @@ -1079,7 +1079,7 @@ void NetworkBase::LoadGroups() group_list.clear(); auto env = GetContext().GetPlatformEnvironment(); - auto path = Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"groups.json"); + auto path = Path::Combine(env->GetDirectoryPath(DirBase::user), u8"groups.json"); json_t jsonGroupConfig; if (File::Exists(path)) @@ -1166,7 +1166,7 @@ void NetworkBase::AppendLog(std::ostream& fs, std::string_view s) void NetworkBase::BeginChatLog() { auto env = GetContext().GetPlatformEnvironment(); - auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_CHAT); + auto directory = env->GetDirectoryPath(DirBase::user, DIRID::LOG_CHAT); _chatLogPath = BeginLog(directory, "", _chatLogFilenameFormat); _chat_log_fs.open(fs::u8path(_chatLogPath), std::ios::out | std::ios::app); } @@ -1187,7 +1187,7 @@ void NetworkBase::CloseChatLog() void NetworkBase::BeginServerLog() { auto env = GetContext().GetPlatformEnvironment(); - auto directory = env->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_SERVER); + auto directory = env->GetDirectoryPath(DirBase::user, DIRID::LOG_SERVER); _serverLogPath = BeginLog(directory, ServerName, _serverLogFilenameFormat); _server_log_fs.open(fs::u8path(_serverLogPath), std::ios::out | std::ios::app | std::ios::binary); @@ -2556,7 +2556,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network { GameStateCompareData cmpData = snapshots->Compare(serverSnapshot, *desyncSnapshot); - std::string outputPath = GetContext().GetPlatformEnvironment()->GetDirectoryPath(DIRBASE::USER, DIRID::LOG_DESYNCS); + std::string outputPath = GetContext().GetPlatformEnvironment()->GetDirectoryPath(DirBase::user, DIRID::LOG_DESYNCS); Path::CreateDirectory(outputPath); @@ -4011,7 +4011,7 @@ void NetworkAppendServerLog(const utf8* text) static u8string NetworkGetKeysDirectory() { auto env = GetContext()->GetPlatformEnvironment(); - return Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"keys"); + return Path::Combine(env->GetDirectoryPath(DirBase::user), u8"keys"); } static u8string NetworkGetPrivateKeyPath(u8string_view playerName) diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index 089340c196..27dab0dee8 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -213,7 +213,7 @@ NetworkUser* NetworkUserManager::GetOrAddUser(const std::string& hash) u8string NetworkUserManager::GetStorePath() { auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - return Path::Combine(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER), kUserStoreFilename); + return Path::Combine(env->GetDirectoryPath(OpenRCT2::DirBase::user), kUserStoreFilename); } #endif diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index 0b392edd3e..a8c72bdfd7 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -243,7 +243,7 @@ bool ServerList::WriteFavourites(const std::vector& entries) co LOG_VERBOSE("server_list_write(%d, 0x%p)", entries.size(), entries.data()); auto env = GetContext()->GetPlatformEnvironment(); - auto path = Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"servers.cfg"); + auto path = Path::Combine(env->GetDirectoryPath(DirBase::user), u8"servers.cfg"); try { diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index d2fec7bf98..05c2d93af1 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -380,7 +380,7 @@ std::vector ImageTable::ParseRange(std::string s) std::string ImageTable::FindLegacyObject(const std::string& name) { const auto env = GetContext()->GetPlatformEnvironment(); - auto objectsPath = env->GetDirectoryPath(DIRBASE::RCT2, DIRID::OBJECT); + auto objectsPath = env->GetDirectoryPath(DirBase::rct2, DIRID::OBJECT); auto objectPath = Path::Combine(objectsPath, name); if (File::Exists(objectPath)) { diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index 9fb7f2300a..184066dc6b 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -227,7 +227,7 @@ ObjectAsset MusicObject::GetAsset(IReadObjectContext& context, std::string_view if (path.find("$RCT2:DATA/") == 0) { auto env = GetContext()->GetPlatformEnvironment(); - auto path2 = env->FindFile(DIRBASE::RCT2, DIRID::DATA, path.substr(11)); + auto path2 = env->FindFile(DirBase::rct2, DIRID::DATA, path.substr(11)); return ObjectAsset(path2); } diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 5930e0d4d4..6a27cc048d 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -86,8 +86,8 @@ public: : FileIndex( "object index", MAGIC_NUMBER, VERSION, env.GetFilePath(PATHID::CACHE_OBJECTS), std::string(PATTERN), std::vector{ - env.GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::OBJECT), - env.GetDirectoryPath(DIRBASE::USER, DIRID::OBJECT), + env.GetDirectoryPath(DirBase::openrct2, DIRID::OBJECT), + env.GetDirectoryPath(DirBase::user, DIRID::OBJECT), }) , _objectRepository(objectRepository) { @@ -586,7 +586,7 @@ private: std::string GetPathForNewObject(ObjectGeneration generation, std::string_view name) { // Get object directory and create it if it doesn't exist - auto userObjPath = _env->GetDirectoryPath(DIRBASE::USER, DIRID::OBJECT); + auto userObjPath = _env->GetDirectoryPath(DirBase::user, DIRID::OBJECT); Path::CreateDirectory(userObjPath); // Find a unique file name diff --git a/src/openrct2/object/ResourceTable.cpp b/src/openrct2/object/ResourceTable.cpp index 025aeff076..8b72500440 100644 --- a/src/openrct2/object/ResourceTable.cpp +++ b/src/openrct2/object/ResourceTable.cpp @@ -79,34 +79,34 @@ ResourceTable::SourceInfo ResourceTable::ParseSource(std::string_view source) else if (String::startsWith(base, "$G1")) { auto env = GetContext()->GetPlatformEnvironment(); - auto dataPath = env->GetDirectoryPath(DIRBASE::RCT2, DIRID::DATA); + auto dataPath = env->GetDirectoryPath(DirBase::rct2, DIRID::DATA); info.Kind = SourceKind::G1; - // info.Path = env->FindFile(DIRBASE::RCT2, DIRID::DATA, "g1.dat"); + // info.Path = env->FindFile(DirBase::rct2, DIRID::DATA, "g1.dat"); } else if (String::startsWith(base, "$CSG")) { auto env = GetContext()->GetPlatformEnvironment(); - auto dataPath = env->GetDirectoryPath(DIRBASE::RCT2, DIRID::DATA); + auto dataPath = env->GetDirectoryPath(DirBase::rct2, DIRID::DATA); info.Kind = SourceKind::Csg; - // info.Path = env->FindFile(DIRBASE::RCT2, DIRID::DATA, "g1.dat"); + // info.Path = env->FindFile(DirBase::rct2, DIRID::DATA, "g1.dat"); } else if (String::startsWith(base, "$RCT1:DATA/")) { auto env = GetContext()->GetPlatformEnvironment(); info.Kind = SourceKind::Data; - info.Path = env->FindFile(DIRBASE::RCT1, DIRID::DATA, fileName); + info.Path = env->FindFile(DirBase::rct1, DIRID::DATA, fileName); } else if (String::startsWith(base, "$RCT2:DATA/")) { auto env = GetContext()->GetPlatformEnvironment(); info.Kind = SourceKind::Data; - info.Path = env->FindFile(DIRBASE::RCT2, DIRID::DATA, fileName); + info.Path = env->FindFile(DirBase::rct2, DIRID::DATA, fileName); } else if (String::startsWith(base, "$RCT2:OBJDATA/")) { auto env = GetContext()->GetPlatformEnvironment(); info.Kind = SourceKind::ObjData; - info.Path = env->FindFile(DIRBASE::RCT2, DIRID::OBJECT, fileName); + info.Path = env->FindFile(DirBase::rct2, DIRID::OBJECT, fileName); } else if (!String::startsWith(base, "$")) { diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 6777c63e5a..6933b9c730 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -317,7 +317,7 @@ static bool OnCrash( static std::wstring GetDumpDirectory() { auto env = GetContext()->GetPlatformEnvironment(); - auto crashPath = env->GetDirectoryPath(DIRBASE::USER, DIRID::CRASH); + auto crashPath = env->GetDirectoryPath(DirBase::user, DIRID::CRASH); auto result = String::toWideChar(crashPath); return result; diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index d23df4752d..12ffae7f27 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -683,7 +683,7 @@ static u8string getScenarioSHA256(u8string_view scenarioPath) static u8string GetPatchFileName(u8string_view scenarioHash) { auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - auto scenarioPatches = env->GetDirectoryPath(OpenRCT2::DIRBASE::OPENRCT2, OpenRCT2::DIRID::SCENARIO_PATCHES); + auto scenarioPatches = env->GetDirectoryPath(OpenRCT2::DirBase::openrct2, OpenRCT2::DIRID::SCENARIO_PATCHES); auto scenarioPatchFile = OpenRCT2::Path::WithExtension(scenarioHash.substr(0, 7), ".parkpatch"); return OpenRCT2::Path::Combine(scenarioPatches, scenarioPatchFile); } diff --git a/src/openrct2/ride/TrackDesignRepository.cpp b/src/openrct2/ride/TrackDesignRepository.cpp index c2bd99c39f..acd64a17af 100644 --- a/src/openrct2/ride/TrackDesignRepository.cpp +++ b/src/openrct2/ride/TrackDesignRepository.cpp @@ -62,9 +62,9 @@ public: : FileIndex( "track design index", MAGIC_NUMBER, VERSION, env.GetFilePath(PATHID::CACHE_TRACKS), std::string(PATTERN), std::vector({ - env.GetDirectoryPath(DIRBASE::RCT1, DIRID::TRACK), - env.GetDirectoryPath(DIRBASE::RCT2, DIRID::TRACK), - env.GetDirectoryPath(DIRBASE::USER, DIRID::TRACK), + env.GetDirectoryPath(DirBase::rct1, DIRID::TRACK), + env.GetDirectoryPath(DirBase::rct2, DIRID::TRACK), + env.GetDirectoryPath(DirBase::user, DIRID::TRACK), })) { } @@ -257,7 +257,7 @@ public: std::string Install(const std::string& path, const std::string& name) override { std::string result; - std::string installDir = _env->GetDirectoryPath(DIRBASE::USER, DIRID::TRACK); + std::string installDir = _env->GetDirectoryPath(DirBase::user, DIRID::TRACK); std::string newPath = Path::Combine(installDir, name + Path::GetExtension(path)); if (File::Copy(path, newPath, false)) diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index c7692c9dd9..232c8bbf29 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -121,7 +121,7 @@ void ScenarioReset(GameState_t& gameState) // Set the last saved game path auto env = GetContext()->GetPlatformEnvironment(); - auto savePath = env->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE); + auto savePath = env->GetDirectoryPath(DirBase::user, DIRID::SAVE); gScenarioSavePath = Path::Combine(savePath, gameState.park.Name + u8".park"); gameState.currentExpenditure = 0; diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index a59b413e78..c54162b7c3 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -132,9 +132,9 @@ public: : FileIndex( "scenario index", MAGIC_NUMBER, VERSION, env.GetFilePath(PATHID::CACHE_SCENARIOS), std::string(PATTERN), std::vector({ - env.GetDirectoryPath(DIRBASE::RCT1, DIRID::SCENARIO), - env.GetDirectoryPath(DIRBASE::RCT2, DIRID::SCENARIO), - env.GetDirectoryPath(DIRBASE::USER, DIRID::SCENARIO), + env.GetDirectoryPath(DirBase::rct1, DIRID::SCENARIO), + env.GetDirectoryPath(DirBase::rct2, DIRID::SCENARIO), + env.GetDirectoryPath(DirBase::user, DIRID::SCENARIO), })) { } @@ -437,10 +437,10 @@ private: */ void ImportMegaPark() { - auto mpdatPath = _env->FindFile(DIRBASE::RCT1, DIRID::DATA, "mp.dat"); + auto mpdatPath = _env->FindFile(DirBase::rct1, DIRID::DATA, "mp.dat"); if (File::Exists(mpdatPath)) { - auto scenarioDirectory = _env->GetDirectoryPath(DIRBASE::USER, DIRID::SCENARIO); + auto scenarioDirectory = _env->GetDirectoryPath(DirBase::user, DIRID::SCENARIO); auto expectedSc21Path = Path::Combine(scenarioDirectory, "sc21.sc4"); auto sc21Path = Path::ResolveCasing(expectedSc21Path); if (!File::Exists(sc21Path)) diff --git a/src/openrct2/scenes/title/TitleSequenceManager.cpp b/src/openrct2/scenes/title/TitleSequenceManager.cpp index d8c3f2a84d..b7184831ef 100644 --- a/src/openrct2/scenes/title/TitleSequenceManager.cpp +++ b/src/openrct2/scenes/title/TitleSequenceManager.cpp @@ -255,13 +255,13 @@ namespace OpenRCT2::TitleSequenceManager static std::string GetDataSequencesPath() { auto env = GetContext()->GetPlatformEnvironment(); - return env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::SEQUENCE); + return env->GetDirectoryPath(DirBase::openrct2, DIRID::SEQUENCE); } static std::string GetUserSequencesPath() { auto env = GetContext()->GetPlatformEnvironment(); - return env->GetDirectoryPath(DIRBASE::USER, DIRID::SEQUENCE); + return env->GetDirectoryPath(DirBase::user, DIRID::SEQUENCE); } static bool IsNameReserved(const std::string& name) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index be64ae4062..70fd4705cf 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -592,7 +592,7 @@ std::vector ScriptEngine::GetPluginFiles() const { // Scan for .js files in plugin directory std::vector pluginFiles; - auto base = _env.GetDirectoryPath(DIRBASE::USER, DIRID::PLUGIN); + auto base = _env.GetDirectoryPath(DirBase::user, DIRID::PLUGIN); if (Path::DirectoryExists(base)) { auto pattern = Path::Combine(base, u8"*.js"); @@ -794,7 +794,7 @@ void ScriptEngine::SetupHotReloading() { try { - auto base = _env.GetDirectoryPath(DIRBASE::USER, DIRID::PLUGIN); + auto base = _env.GetDirectoryPath(DirBase::user, DIRID::PLUGIN); if (Path::DirectoryExists(base)) { _pluginFileWatcher = std::make_unique(base); diff --git a/test/tests/ScenarioPatcherTests.cpp b/test/tests/ScenarioPatcherTests.cpp index 34d61ffb0a..4925fe95b4 100644 --- a/test/tests/ScenarioPatcherTests.cpp +++ b/test/tests/ScenarioPatcherTests.cpp @@ -32,7 +32,7 @@ TEST(FetchAndApplyScenarioPatch, expected_json_format) ASSERT_TRUE(initialised); auto env = context->GetPlatformEnvironment(); - auto scenarioPatches = env->GetDirectoryPath(OpenRCT2::DIRBASE::OPENRCT2, OpenRCT2::DIRID::SCENARIO_PATCHES); + auto scenarioPatches = env->GetDirectoryPath(OpenRCT2::DirBase::openrct2, OpenRCT2::DIRID::SCENARIO_PATCHES); std::error_code ec; OpenRCT2::RCT12::SetDryRun(true);