diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ebb0a41f35..48687c751c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,9 +1,11 @@ 0.2.1+ (in development) ------------------------------------------------------------------------ - Feature: [#7956, #7964] Add sprite font glyphs for Hungarian and some Czech letters. +- Feature: [#7980] Allow data path for RCT1 to be specified by a command line argument. - Fix: [#7975] Inspection flag not cleared for rides which are set to never be inspected (Original bug). - Improved: [#7730] Draw extreme vertical and lateral Gs red in the ride window's graph tab. - Improved: [#7930] Automatically create folders for custom content. +- Improved: [#7980] Show the full path of the scenario in the scenario select window. - Removed: [#7929] Support for scenario text objects. 0.2.1 (2018-08-26) diff --git a/distribution/man/openrct2.6 b/distribution/man/openrct2.6 index 42cee045e8..2f6ceb1dfe 100644 --- a/distribution/man/openrct2.6 +++ b/distribution/man/openrct2.6 @@ -126,6 +126,10 @@ Path to the user data directory (containing Path to the OpenRCT2 data directory (containing .Pa languages ) +.It Fl -rct1-data-path Ar path +path to the RollerCoaster Tycoon 1 data directory (containing +.Pa data/csg1.dat ) + .It Fl -rct2-data-path Ar path Path to the RollerCoaster Tycoon 2 data directory (containing .Pa data/g1.dat ) diff --git a/src/openrct2/OpenRCT2.cpp b/src/openrct2/OpenRCT2.cpp index 746a3a8ea6..175cb0e4d2 100644 --- a/src/openrct2/OpenRCT2.cpp +++ b/src/openrct2/OpenRCT2.cpp @@ -15,6 +15,7 @@ utf8 gOpenRCT2StartupActionPath[512] = { 0 }; utf8 gExePath[MAX_PATH]; utf8 gCustomUserDataPath[MAX_PATH] = { 0 }; utf8 gCustomOpenrctDataPath[MAX_PATH] = { 0 }; +utf8 gCustomRCT1DataPath[MAX_PATH] = { 0 }; utf8 gCustomRCT2DataPath[MAX_PATH] = { 0 }; utf8 gCustomPassword[MAX_PATH] = { 0 }; diff --git a/src/openrct2/OpenRCT2.h b/src/openrct2/OpenRCT2.h index 3f836d5a4b..99cca367a0 100644 --- a/src/openrct2/OpenRCT2.h +++ b/src/openrct2/OpenRCT2.h @@ -40,6 +40,7 @@ extern utf8 gOpenRCT2StartupActionPath[512]; extern utf8 gExePath[MAX_PATH]; extern utf8 gCustomUserDataPath[MAX_PATH]; extern utf8 gCustomOpenrctDataPath[MAX_PATH]; +extern utf8 gCustomRCT1DataPath[MAX_PATH]; extern utf8 gCustomRCT2DataPath[MAX_PATH]; extern utf8 gCustomPassword[MAX_PATH]; extern bool gOpenRCT2Headless; diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index cf3a560ea7..4d042e428e 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -131,6 +131,10 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() basePaths[(size_t)DIRBASE::DOCUMENTATION] = Platform::GetDocsPath(); // Override paths that have been specified via the command line + if (!String::IsNullOrEmpty(gCustomRCT1DataPath)) + { + basePaths[(size_t)DIRBASE::RCT1] = gCustomRCT1DataPath; + } if (!String::IsNullOrEmpty(gCustomRCT2DataPath)) { basePaths[(size_t)DIRBASE::RCT2] = gCustomRCT2DataPath; @@ -160,8 +164,14 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() { config_save(configPath.c_str()); } - env->SetBasePath(DIRBASE::RCT1, String::ToStd(gConfigGeneral.rct1_path)); - env->SetBasePath(DIRBASE::RCT2, String::ToStd(gConfigGeneral.rct2_path)); + if (String::IsNullOrEmpty(gCustomRCT1DataPath)) + { + env->SetBasePath(DIRBASE::RCT1, String::ToStd(gConfigGeneral.rct1_path)); + } + if (String::IsNullOrEmpty(gCustomRCT2DataPath)) + { + env->SetBasePath(DIRBASE::RCT2, String::ToStd(gConfigGeneral.rct2_path)); + } // Log base paths log_verbose("DIRBASE::RCT1 : %s", env->GetDirectoryPath(DIRBASE::RCT1).c_str()); diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index ecc39e0682..142625744b 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -54,6 +54,7 @@ static bool _headless = false; static utf8* _password = nullptr; static utf8* _userDataPath = nullptr; static utf8* _openrctDataPath = nullptr; +static utf8* _rct1DataPath = nullptr; static utf8* _rct2DataPath = nullptr; static bool _silentBreakpad = false; @@ -74,6 +75,7 @@ static constexpr const CommandLineOptionDefinition StandardOptions[] { CMDLINE_TYPE_STRING, &_password, NAC, "password", "password needed to join the server" }, { CMDLINE_TYPE_STRING, &_userDataPath, NAC, "user-data-path", "path to the user data directory (containing config.ini)" }, { CMDLINE_TYPE_STRING, &_openrctDataPath, NAC, "openrct-data-path", "path to the OpenRCT2 data directory (containing languages)" }, + { CMDLINE_TYPE_STRING, &_rct1DataPath, NAC, "rct1-data-path", "path to the RollerCoaster Tycoon 1 data directory (containing data/csg1.dat)" }, { CMDLINE_TYPE_STRING, &_rct2DataPath, NAC, "rct2-data-path", "path to the RollerCoaster Tycoon 2 data directory (containing data/g1.dat)" }, #ifdef USE_BREAKPAD { CMDLINE_TYPE_SWITCH, &_silentBreakpad, NAC, "silent-breakpad", "make breakpad crash reporting silent" }, @@ -208,6 +210,12 @@ exitcode_t CommandLine::HandleCommandDefault() Memory::Free(_openrctDataPath); } + if (_rct1DataPath != nullptr) + { + String::Set(gCustomRCT1DataPath, Util::CountOf(gCustomRCT1DataPath), _rct1DataPath); + Memory::Free(_rct1DataPath); + } + if (_rct2DataPath != nullptr) { String::Set(gCustomRCT2DataPath, Util::CountOf(gCustomRCT2DataPath), _rct2DataPath); diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 761f90af42..f6f03a7b78 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -146,9 +146,10 @@ private: std::vector files; for (const auto& directory : SearchPaths) { - log_verbose("FileIndex:Scanning for %s in '%s'", _pattern.c_str(), directory.c_str()); + auto absoluteDirectory = Path::GetAbsolute(directory); + log_verbose("FileIndex:Scanning for %s in '%s'", _pattern.c_str(), absoluteDirectory.c_str()); - auto pattern = Path::Combine(directory, _pattern); + auto pattern = Path::Combine(absoluteDirectory, _pattern); auto scanner = Path::ScanDirectory(pattern, true); while (scanner->Next()) {