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.
This commit is contained in:
RoosterDragon
2023-11-13 19:38:03 +00:00
committed by Gustas
parent 9534443771
commit 43f339b91e

View File

@@ -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 = () =>
{