mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-25 08:22:54 +08:00
Moved renderable cache to its own thread so GameFileCache doesn't interfere - better loading performance?
This commit is contained in:
parent
f74fde1c67
commit
55ae14f1b0
16
WorldForm.cs
16
WorldForm.cs
@ -4238,13 +4238,23 @@ namespace CodeWalker
|
|||||||
EnableDLCModsUI();
|
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
|
while (formopen && !IsDisposed) //main asset loop
|
||||||
{
|
{
|
||||||
bool fcItemsPending = gameFileCache.ContentThreadProc();
|
bool fcItemsPending = gameFileCache.ContentThreadProc();
|
||||||
|
|
||||||
bool rcItemsPending = Renderer.ContentThreadProc();
|
if (!fcItemsPending)
|
||||||
|
|
||||||
if (!(fcItemsPending || rcItemsPending))
|
|
||||||
{
|
{
|
||||||
Thread.Sleep(1); //sleep if there's nothing to do
|
Thread.Sleep(1); //sleep if there's nothing to do
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user