diff --git a/src/OpenRCT2.cpp b/src/OpenRCT2.cpp index 8fa37a8943..d1587d5eb6 100644 --- a/src/OpenRCT2.cpp +++ b/src/OpenRCT2.cpp @@ -368,7 +368,8 @@ namespace OpenRCT2 utf8 path[260]; std::string basePaths[4]; - basePaths[(size_t)DIRBASE::RCT2] = std::string(gRCT2AddressAppPath); + basePaths[(size_t)DIRBASE::RCT1] = String::ToStd(gConfigGeneral.rct1_path); + basePaths[(size_t)DIRBASE::RCT2] = String::ToStd(gConfigGeneral.rct2_path); platform_get_openrct_data_path(path, sizeof(path)); basePaths[(size_t)DIRBASE::OPENRCT2] = std::string(path); platform_get_user_directory(path, nullptr, sizeof(path)); diff --git a/src/PlatformEnvironment.cpp b/src/PlatformEnvironment.cpp index 9f7dcfff31..1cc549916f 100644 --- a/src/PlatformEnvironment.cpp +++ b/src/PlatformEnvironment.cpp @@ -46,7 +46,6 @@ public: switch (base) { default: case DIRBASE::RCT1: - throw Exception("Not implemented"); case DIRBASE::RCT2: directoryName = DirectoryNamesRCT2[(size_t)did]; break; diff --git a/src/cmdline/RootCommands.cpp b/src/cmdline/RootCommands.cpp index 78511f1659..fefd5c8869 100644 --- a/src/cmdline/RootCommands.cpp +++ b/src/cmdline/RootCommands.cpp @@ -382,7 +382,7 @@ static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator * enumerator) // Update RCT2 path in config config_set_defaults(); config_open_default(); - String::DiscardDuplicate(&gConfigGeneral.game_path, path); + String::DiscardDuplicate(&gConfigGeneral.rct2_path, path); if (config_save_default()) { Console::WriteFormat("Updating RCT2 path to '%s'.", path); diff --git a/src/config.c b/src/config.c index a3a4bd99cd..b7ba5b25a6 100644 --- a/src/config.c +++ b/src/config.c @@ -182,7 +182,8 @@ config_property_definition _generalDefinitions[] = { { offsetof(general_configuration, fullscreen_mode), "fullscreen_mode", CONFIG_VALUE_TYPE_UINT8, 0, NULL }, { offsetof(general_configuration, fullscreen_height), "fullscreen_height", CONFIG_VALUE_TYPE_SINT32, -1, NULL }, { offsetof(general_configuration, fullscreen_width), "fullscreen_width", CONFIG_VALUE_TYPE_SINT32, -1, NULL }, - { offsetof(general_configuration, game_path), "game_path", CONFIG_VALUE_TYPE_STRING, { .value_string = NULL }, NULL }, + { offsetof(general_configuration, rct1_path), "rct1_path", CONFIG_VALUE_TYPE_STRING, { .value_string = NULL }, NULL }, + { offsetof(general_configuration, rct2_path), "game_path", CONFIG_VALUE_TYPE_STRING, { .value_string = NULL }, NULL }, { offsetof(general_configuration, landscape_smoothing), "landscape_smoothing", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL }, { offsetof(general_configuration, language), "language", CONFIG_VALUE_TYPE_UINT16, LANGUAGE_ENGLISH_UK, _languageEnum }, { offsetof(general_configuration, measurement_format), "measurement_format", CONFIG_VALUE_TYPE_UINT8, MEASUREMENT_FORMAT_METRIC, _measurementFormatEnum }, @@ -932,9 +933,9 @@ bool config_find_or_browse_install_directory() utf8 *installPath; if (config_find_rct2_path(path)) { - SafeFree(gConfigGeneral.game_path); - gConfigGeneral.game_path = malloc(strlen(path) + 1); - safe_strcpy(gConfigGeneral.game_path, path, MAX_PATH); + SafeFree(gConfigGeneral.rct2_path); + gConfigGeneral.rct2_path = malloc(strlen(path) + 1); + safe_strcpy(gConfigGeneral.rct2_path, path, MAX_PATH); } else { if (gOpenRCT2Headless) { return false; @@ -945,8 +946,8 @@ bool config_find_or_browse_install_directory() if (installPath == NULL) return false; - SafeFree(gConfigGeneral.game_path); - gConfigGeneral.game_path = installPath; + SafeFree(gConfigGeneral.rct2_path); + gConfigGeneral.rct2_path = installPath; if (platform_original_game_data_exists(installPath)) return true; diff --git a/src/config.h b/src/config.h index c031310b6d..31a18782eb 100644 --- a/src/config.h +++ b/src/config.h @@ -144,7 +144,8 @@ typedef struct general_configuration { uint8 play_intro; uint8 confirmation_prompt; uint8 screenshot_format; - utf8string game_path; + utf8string rct1_path; + utf8string rct2_path; sint8 measurement_format; sint8 temperature_format; sint8 currency_format; diff --git a/src/rct2.c b/src/rct2.c index 48f7f7ef46..6e4b16c4bc 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -218,8 +218,8 @@ int rct2_init_directories() if (str_is_null_or_empty(gCustomRCT2DataPath)) { // check install directory - if (!platform_original_game_data_exists(gConfigGeneral.game_path)) { - log_verbose("install directory does not exist or invalid directory selected, %s", gConfigGeneral.game_path); + if (!platform_original_game_data_exists(gConfigGeneral.rct2_path)) { + log_verbose("install directory does not exist or invalid directory selected, %s", gConfigGeneral.rct2_path); if (!config_find_or_browse_install_directory()) { utf8 path[MAX_PATH]; config_get_default_path(path, sizeof(path)); @@ -227,7 +227,7 @@ int rct2_init_directories() return 0; } } - safe_strcpy(gRCT2AddressAppPath, gConfigGeneral.game_path, sizeof(gRCT2AddressAppPath)); + safe_strcpy(gRCT2AddressAppPath, gConfigGeneral.rct2_path, sizeof(gRCT2AddressAppPath)); } else { safe_strcpy(gRCT2AddressAppPath, gCustomRCT2DataPath, sizeof(gRCT2AddressAppPath)); }