Skip to content

Commit

Permalink
Address roblabla's comments
Browse files Browse the repository at this point in the history
Signed-off-by: Mary Guillemard <[email protected]>
  • Loading branch information
marysaka committed Mar 10, 2024
1 parent d10289c commit c08906c
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/ZunTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ void ZunTimer::Increment(i32 value)
if (g_Supervisor.framerateMultiplier > 0.99f)
{
this->current = this->current + value;

return;
}
else

if (value < 0)
{
Decrement(-value);

return;
}

this->previous = this->current;
this->subFrame = g_Supervisor.effectiveFramerateMultiplier * (float)value + this->subFrame;

while (this->subFrame >= 1.0f)
{
if (value < 0)
{
Decrement(-value);
}
else
{
this->previous = this->current;
this->subFrame = g_Supervisor.effectiveFramerateMultiplier * (float)value + this->subFrame;

while (this->subFrame >= 1.0f)
{
this->current++;
this->subFrame = this->subFrame - 1.0f;
}
}
this->current++;
this->subFrame = this->subFrame - 1.0f;
}
}

Expand All @@ -40,24 +40,24 @@ void ZunTimer::Decrement(i32 value)
if (g_Supervisor.framerateMultiplier > 0.99f)
{
this->current = this->current - value;

return;
}
else

if (value < 0)
{
Increment(-value);

return;
}

this->previous = this->current;
this->subFrame = this->subFrame - g_Supervisor.effectiveFramerateMultiplier * (float)value;

while (this->subFrame < 0.0f)
{
if (value < 0)
{
Increment(-value);
}
else
{
this->previous = this->current;
this->subFrame = this->subFrame - g_Supervisor.effectiveFramerateMultiplier * (float)value;

while (this->subFrame < 0.0f)
{
this->current--;
this->subFrame = this->subFrame + 1.0f;
}
}
this->current--;
this->subFrame = this->subFrame + 1.0f;
}
}
#pragma optimize("s", off)

0 comments on commit c08906c

Please sign in to comment.