A little bit less naive limiter

This commit is contained in:
ReinUsesLisp 2018-06-26 00:24:57 -03:00
parent d0cb042ff4
commit 3671fa1991

View file

@ -51,19 +51,25 @@ namespace Ryujinx
long TicksPerFrame = Stopwatch.Frequency / 60; long TicksPerFrame = Stopwatch.Frequency / 60;
long Ticks = 0;
while (Exists && !IsExiting) while (Exists && !IsExiting)
{ {
ProcessEvents(); ProcessEvents();
if (!IsExiting) if (!IsExiting)
{ {
if (Chrono.ElapsedTicks > TicksPerFrame) UpdateFrame();
{
UpdateFrame();
Ticks += Chrono.ElapsedTicks;
Chrono.Restart();
if (Ticks > TicksPerFrame)
{
RenderFrame(); RenderFrame();
Chrono.Restart(); Ticks -= TicksPerFrame;
} }
} }
} }