mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:05:29 +08:00
Merge branch 'master' into open-profile-hotkey
This commit is contained in:
commit
ce67820d87
@ -167,6 +167,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
// If the game goes into a suspended state (ie. debugger attached or backgrounded on a mobile device)
|
||||||
|
// we want to ignore really long periods of no processing.
|
||||||
|
if (updateClock.ElapsedFrameTime > 10000)
|
||||||
|
return;
|
||||||
|
|
||||||
mainContent.Width = Math.Max(mainContent.Width, counters.DrawWidth);
|
mainContent.Width = Math.Max(mainContent.Width, counters.DrawWidth);
|
||||||
|
|
||||||
// Handle the case where the window has become inactive or the user changed the
|
// Handle the case where the window has become inactive or the user changed the
|
||||||
@ -177,15 +182,15 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
// use elapsed frame time rather then FramesPerSecond to better catch stutter frames.
|
// use elapsed frame time rather then FramesPerSecond to better catch stutter frames.
|
||||||
bool hasDrawSpike = displayedFpsCount > (1000 / spike_time_ms) && drawClock.ElapsedFrameTime > spike_time_ms;
|
bool hasDrawSpike = displayedFpsCount > (1000 / spike_time_ms) && drawClock.ElapsedFrameTime > spike_time_ms;
|
||||||
|
|
||||||
// note that we use an elapsed time here of 1 intentionally.
|
const float damp_time = 100;
|
||||||
// this weights all updates equally. if we passed in the elapsed time, longer frames would be weighted incorrectly lower.
|
|
||||||
displayedFrameTime = Interpolation.DampContinuously(displayedFrameTime, updateClock.ElapsedFrameTime, hasUpdateSpike ? 0 : 100, 1);
|
displayedFrameTime = Interpolation.DampContinuously(displayedFrameTime, updateClock.ElapsedFrameTime, hasUpdateSpike ? 0 : damp_time, updateClock.ElapsedFrameTime);
|
||||||
|
|
||||||
if (hasDrawSpike)
|
if (hasDrawSpike)
|
||||||
// show spike time using raw elapsed value, to account for `FramesPerSecond` being so averaged spike frames don't show.
|
// show spike time using raw elapsed value, to account for `FramesPerSecond` being so averaged spike frames don't show.
|
||||||
displayedFpsCount = 1000 / drawClock.ElapsedFrameTime;
|
displayedFpsCount = 1000 / drawClock.ElapsedFrameTime;
|
||||||
else
|
else
|
||||||
displayedFpsCount = Interpolation.DampContinuously(displayedFpsCount, drawClock.FramesPerSecond, 100, Time.Elapsed);
|
displayedFpsCount = Interpolation.DampContinuously(displayedFpsCount, drawClock.FramesPerSecond, damp_time, Time.Elapsed);
|
||||||
|
|
||||||
if (Time.Current - lastUpdate > min_time_between_updates)
|
if (Time.Current - lastUpdate > min_time_between_updates)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user