mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Avoid div-by-zero
This commit is contained in:
parent
311a0a3de0
commit
56106e43d2
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
@ -165,7 +166,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
// TODO: this is wrong (elapsed clock time, not actual run time).
|
||||
double newUpdateFrameTime = gameHost.UpdateThread.Clock.ElapsedFrameTime;
|
||||
// use elapsed frame time rather then FramesPerSecond to better catch stutter frames.
|
||||
double newDrawFps = 1000 / gameHost.DrawThread.Clock.ElapsedFrameTime;
|
||||
double newDrawFps = 1000 / Math.Max(0.001, gameHost.DrawThread.Clock.ElapsedFrameTime);
|
||||
|
||||
const double spike_time_ms = 20;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user