diff --git a/src/Libs/Systems.Debugging/Diagnostics/FrameCounter.cs b/src/Libs/Systems.Debugging/Diagnostics/FrameCounter.cs index 0f5cba4..9c5eeb4 100644 --- a/src/Libs/Systems.Debugging/Diagnostics/FrameCounter.cs +++ b/src/Libs/Systems.Debugging/Diagnostics/FrameCounter.cs @@ -5,7 +5,7 @@ namespace Systems.Debugging.Diagnostics; public class FrameCounter(Scellecs.Morpeh.World world) : ISystem { - private const float UpdateFrequencyInSec = .02f; + private const float UpdateFrequencyInSec = .0875f; private float _elapsedTime; private int _framesCount; @@ -20,13 +20,13 @@ public void OnUpdate(float deltaTime) ++_framesCount; _elapsedTime += deltaTime; - if (_elapsedTime < UpdateFrequencyInSec) - { - return; - } + if (_elapsedTime < UpdateFrequencyInSec) return; - ref WorldMetaComponent worldMeta = - ref World.Filter.With().Build().First().GetComponent(); + ref WorldMetaComponent worldMeta = ref World.Filter + .With() + .Build() + .First() + .GetComponent(); worldMeta.FramesPerSec = _framesCount / _elapsedTime; _framesCount = 0; diff --git a/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs b/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs index cd9fe47..16f7ea0 100644 --- a/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs +++ b/src/Libs/Systems.Debugging/Render/RenderFramesPerSec.cs @@ -20,7 +20,7 @@ public void OnUpdate(float deltaTime) ImGui.Begin("Diagnostics", ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoDocking); - ImGui.Text($"FPS: {world.FramesPerSec}"); + ImGui.Text($"FPS: {world.FramesPerSec:F2}"); ImGui.End(); } diff --git a/src/Libs/Systems.Debugging/World/SystemsList.cs b/src/Libs/Systems.Debugging/World/SystemsList.cs index e8dd5f0..1de1338 100644 --- a/src/Libs/Systems.Debugging/World/SystemsList.cs +++ b/src/Libs/Systems.Debugging/World/SystemsList.cs @@ -22,12 +22,15 @@ public void OnUpdate(float deltaTime) return; } - DrawSystemsGroup("Initializers", systemsEngine.Initializers.GetInitializersInfo()); - DrawSystemsGroup("Systems", systemsEngine.Systems.GetSystemsInfo()); - DrawSystemsGroup("FixedSystems", systemsEngine.FixedSystems.GetFixedSystemsInfo()); - DrawSystemsGroup("CleanupSystems", systemsEngine.CleanupSystems.GetCleanupSystemsInfo()); - DrawSystemsGroup("RenderSystems", systemsEngine.RenderSystems.GetSystemsInfo()); - DrawSystemsGroup("LateSystems", systemsEngine.LateSystems.GetLateSystemsInfo()); + DrawSystemsGroup("1. Initializers", systemsEngine.Initializers.GetInitializersInfo()); + + DrawSystemsGroup("2. FixedSystems", systemsEngine.FixedSystems.GetFixedSystemsInfo()); + DrawSystemsGroup("3. Systems", systemsEngine.Systems.GetSystemsInfo()); + DrawSystemsGroup("4. LateSystems", systemsEngine.LateSystems.GetLateSystemsInfo()); + + DrawSystemsGroup("5. RenderSystems", systemsEngine.RenderSystems.GetSystemsInfo()); + + DrawSystemsGroup("[Undetermined] CleanupSystems", systemsEngine.CleanupSystems.GetCleanupSystemsInfo()); ImGui.TreePop(); }