diff --git a/src/ZunTimer.cpp b/src/ZunTimer.cpp index bd89b177..67c4aa9d 100644 --- a/src/ZunTimer.cpp +++ b/src/ZunTimer.cpp @@ -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; } } @@ -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)