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:
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
perfText.IsVisible = () => Game.Settings.Debug.PerfText;
|
perfText.IsVisible = () => Game.Settings.Debug.PerfText;
|
||||||
|
|
||||||
var fpsTimer = Stopwatch.StartNew();
|
var fpsTimer = Stopwatch.StartNew();
|
||||||
var fpsReferenceFrame = 0;
|
var fpsReferenceFrame = Game.RenderFrame;
|
||||||
var fps = 0;
|
var fps = 0;
|
||||||
perfText.GetText = () =>
|
perfText.GetText = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user