1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Load the save previews in the background

This commit is contained in:
Matt
2025-04-05 17:36:25 +03:00
committed by GitHub
parent cd86eb659c
commit 3983e42115
5 changed files with 393 additions and 15 deletions

View File

@@ -160,6 +160,8 @@ namespace OpenRCT2
std::thread::id _mainThreadId{};
Timer _forcedUpdateTimer;
BackgroundWorker _backgroundWorker;
public:
// Singleton of Context.
// Remove this when GetContext() is no longer called so that
@@ -1333,6 +1335,8 @@ namespace OpenRCT2
_ticksAccumulator -= kGameUpdateTimeMS;
}
_backgroundWorker.dispatchCompleted();
ContextHandleInput();
WindowUpdateAll();
@@ -1366,6 +1370,8 @@ namespace OpenRCT2
tweener.PostTick();
}
_backgroundWorker.dispatchCompleted();
ContextHandleInput();
WindowUpdateAll();
@@ -1550,6 +1556,11 @@ namespace OpenRCT2
{
return _timeScale;
}
BackgroundWorker& GetBackgroundWorker() override
{
return _backgroundWorker;
}
};
Context* Context::Instance = nullptr;