Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Game.Loop:
  2. var logicInterval = worldRenderer != null && worldRenderer.World.Timestep != 0 ? worldRenderer.World.Timestep : Timestep;
  3.  
  4. // World.Timestep - 20 - 50ms, Timestep: 40 ms
  5. if (now >= nextLogic)
  6. {
  7. nextLogic += logicInterval;
  8.  
  9. LogicTick();
  10. }
  11.  
  12. LogicTick
  13. InnerLogicTick(OrderManager);
  14.  
  15. static void InnerLogicTick(OrderManager orderManager)
  16. if (uiTickDelta >= Timestep) // always Timestep (40), with logicInterval 50 (game slow speed) this isn't called each 40 ms as expected
  17. // Ui.LastTickTime and Viewport.TicksSinceLastMove are updated later, causing e.g. flickering of tooltip due to IsVisible = () => Viewport.TicksSinceLastMove >= TooltipDelay;
  18. Ui.Tick();
  19.  
  20. if (worldTimestep != 0 && worldTickDelta >= worldTimestep) // timestep consistent with Game.Loop logicInterval
  21. World.Tick(); // called e.g. each 20 - 50 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement