Moved renderable cache to its own thread so GameFileCache doesn't interfere - better loading performance?

This commit is contained in:
dexy 2019-01-09 13:25:23 +11:00
parent f74fde1c67
commit 55ae14f1b0

View File

@ -4238,13 +4238,23 @@ namespace CodeWalker
EnableDLCModsUI();
Task.Run(() => {
while (formopen && !IsDisposed) //renderer content loop
{
bool rcItemsPending = Renderer.ContentThreadProc();
if (!rcItemsPending)
{
Thread.Sleep(1); //sleep if there's nothing to do
}
}
});
while (formopen && !IsDisposed) //main asset loop
{
bool fcItemsPending = gameFileCache.ContentThreadProc();
bool rcItemsPending = Renderer.ContentThreadProc();
if (!(fcItemsPending || rcItemsPending))
if (!fcItemsPending)
{
Thread.Sleep(1); //sleep if there's nothing to do
}