mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 00:02:54 +08:00
Tidy up ProcessFrame
and privatise const
This commit is contained in:
parent
b564c34dbc
commit
2f5be6efca
@ -16,7 +16,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
||||
/// <summary>
|
||||
/// The catch up rate.
|
||||
/// </summary>
|
||||
public const double CATCHUP_RATE = 2;
|
||||
private const double catchup_rate = 2;
|
||||
|
||||
private readonly GameplayClockContainer masterClock;
|
||||
|
||||
@ -68,7 +68,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
||||
{
|
||||
}
|
||||
|
||||
public double Rate => IsCatchingUp ? CATCHUP_RATE : 1;
|
||||
public double Rate => IsCatchingUp ? catchup_rate : 1;
|
||||
|
||||
double IAdjustableClock.Rate
|
||||
{
|
||||
@ -76,13 +76,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
double IClock.Rate => Rate;
|
||||
|
||||
public void ProcessFrame()
|
||||
{
|
||||
ElapsedFrameTime = 0;
|
||||
FramesPerSecond = 0;
|
||||
|
||||
if (IsRunning)
|
||||
{
|
||||
double elapsedSource = masterClock.ElapsedFrameTime;
|
||||
@ -92,6 +87,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
||||
ElapsedFrameTime = elapsed;
|
||||
FramesPerSecond = masterClock.FramesPerSecond;
|
||||
}
|
||||
else
|
||||
{
|
||||
ElapsedFrameTime = 0;
|
||||
FramesPerSecond = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public double ElapsedFrameTime { get; private set; }
|
||||
|
Loading…
Reference in New Issue
Block a user