Refactor the OrderManager and world tick loop, improves input latency
This commit is contained in:
committed by
Matthias Mailänder
parent
616d9421d6
commit
f642cead44
@@ -578,26 +578,22 @@ namespace OpenRA
|
||||
orderManager.LastTickTime += integralTickTimestep >= TimestepJankThreshold ? integralTickTimestep : worldTimestep;
|
||||
|
||||
Sound.Tick();
|
||||
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, orderManager.TickImmediate);
|
||||
|
||||
if (world == null)
|
||||
return;
|
||||
|
||||
var isNetTick = LocalTick % NetTickScale == 0;
|
||||
|
||||
if (!isNetTick || orderManager.SendNetFrameOrdersAndCheckReady())
|
||||
{
|
||||
++orderManager.LocalFrameNumber;
|
||||
orderManager.TickPreGame();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Write("debug", "--Tick: {0} ({1})", LocalTick, isNetTick ? "net" : "local");
|
||||
// Collect orders first, we will dispatch them if we can this frame
|
||||
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, () =>
|
||||
{
|
||||
world.OrderGenerator.Tick(world);
|
||||
});
|
||||
|
||||
if (isNetTick)
|
||||
orderManager.Tick();
|
||||
|
||||
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, () =>
|
||||
{
|
||||
world.OrderGenerator.Tick(world);
|
||||
});
|
||||
if (orderManager.TryTick())
|
||||
{
|
||||
Log.Write("debug", "--Tick: {0} ({1})", LocalTick, orderManager.IsNetTick ? "net" : "local");
|
||||
|
||||
world.Tick();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user