mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Initialise script engine off main thread (#22230)
* Initialise script engine off main thread * Do not run ScriptEngine.Tick() during initialisation/preloading * Add 'Loading plugin engine…' string * Add changelog entry --------- Co-authored-by: Bas <Basssiiie@users.noreply.github.com>
This commit is contained in:
@@ -523,18 +523,14 @@ namespace OpenRCT2
|
||||
|
||||
// TODO: preload the title scene in another (parallel) job.
|
||||
preloaderScene->AddJob([this]() { InitialiseRepositories(); });
|
||||
preloaderScene->AddJob([this]() { InitialiseScriptEngine(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
InitialiseRepositories();
|
||||
InitialiseScriptEngine();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
_scriptEngine.Initialise();
|
||||
#endif
|
||||
|
||||
_uiContext->Initialise();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -574,6 +570,17 @@ namespace OpenRCT2
|
||||
OpenProgress(STR_LOADING_GENERIC);
|
||||
}
|
||||
|
||||
void InitialiseScriptEngine()
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
OpenProgress(STR_LOADING_PLUGIN_ENGINE);
|
||||
_scriptEngine.Initialise();
|
||||
_uiContext->InitialiseScriptExtensions();
|
||||
|
||||
OpenProgress(STR_LOADING_GENERIC);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
void InitialiseDrawingEngine() final override
|
||||
{
|
||||
@@ -1349,7 +1356,10 @@ namespace OpenRCT2
|
||||
|
||||
ChatUpdate();
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
_scriptEngine.Tick();
|
||||
if (GetActiveScene() != GetPreloaderScene())
|
||||
{
|
||||
_scriptEngine.Tick();
|
||||
}
|
||||
#endif
|
||||
_stdInOutConsole.ProcessEvalQueue();
|
||||
_uiContext->Tick();
|
||||
|
||||
Reference in New Issue
Block a user