1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Widen progress range for object loading proces

This commit is contained in:
Aaron van Geffen
2024-07-16 18:16:50 +02:00
parent a5054c68d1
commit e645fc7ac4
3 changed files with 6 additions and 6 deletions

View File

@@ -318,11 +318,11 @@ namespace OpenRCT2::Title
auto parkImporter = ParkImporter::Create(path);
auto result = parkImporter->Load(path);
ReportProgress(30);
ReportProgress(10);
auto& objectManager = GetContext()->GetObjectManager();
objectManager.LoadObjects(result.RequiredObjects, true);
ReportProgress(70);
ReportProgress(90);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();

View File

@@ -773,7 +773,7 @@ namespace OpenRCT2
SetProgress(0, 100, STR_STRING_M_PERCENT, true);
auto result = parkImporter->LoadFromStream(stream, info.Type == FILE_TYPE::SCENARIO, false, path.c_str());
SetProgress(30, 100, STR_STRING_M_PERCENT, true);
SetProgress(10, 100, STR_STRING_M_PERCENT, true);
// From this point onwards the currently loaded park will be corrupted if loading fails
// so reload the title screen if that happens.
@@ -781,7 +781,7 @@ namespace OpenRCT2
GameUnloadScripts();
_objectManager->LoadObjects(result.RequiredObjects, true);
SetProgress(70, 100, STR_STRING_M_PERCENT, true);
SetProgress(90, 100, STR_STRING_M_PERCENT, true);
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = ::GetGameState();

View File

@@ -561,8 +561,8 @@ private:
void ReportProgress(size_t numLoaded, size_t numRequired)
{
constexpr auto kObjectLoadMinProgress = 30;
constexpr auto kObjectLoadMaxProgress = 70;
constexpr auto kObjectLoadMinProgress = 10;
constexpr auto kObjectLoadMaxProgress = 90;
constexpr auto kObjectLoadProgressRange = kObjectLoadMaxProgress - kObjectLoadMinProgress;
const auto currentProgress = kObjectLoadMinProgress + (numLoaded * kObjectLoadProgressRange / numRequired);