From 43f339b91ed809e60ed618f205ab5c0c0c810dad Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Mon, 13 Nov 2023 19:38:03 +0000 Subject: [PATCH] Fix FPS counter showing initial high figure. When the widget is created, use the current frame as reference rather than always using zero. That avoids the first FPS reading from a new widget calculating as if all frames rendered since the game started occurred in the first second. --- OpenRA.Mods.Common/Widgets/Logic/PerfDebugLogic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/PerfDebugLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/PerfDebugLogic.cs index da201a08f0..ab6f44c012 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/PerfDebugLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/PerfDebugLogic.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic perfText.IsVisible = () => Game.Settings.Debug.PerfText; var fpsTimer = Stopwatch.StartNew(); - var fpsReferenceFrame = 0; + var fpsReferenceFrame = Game.RenderFrame; var fps = 0; perfText.GetText = () => {