Stop TickUpdatable stuff during the pause

This commit is contained in:
UnicornFreedom 2025-08-20 03:21:44 +02:00
parent d533e33f2b
commit 8fc3759d88
No known key found for this signature in database
GPG Key ID: B4ED0DB6B940024F
2 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,7 @@ object OcelotDesktop extends LoggingConfiguration with Logging {
}
}
ticker.waitNext()
ticker.waitNext(!emulationPaused)
}
} catch {
case _: InterruptedException => // ignore

View File

@ -19,7 +19,7 @@ class Ticker extends Logging {
tickInterval = 1.second / 20
def waitNext(): Unit = {
def waitNext(count: Boolean = true): Unit = {
val deadline = lastTick + _tickIntervalNs
var time = System.nanoTime()
while (time < deadline) {
@ -32,6 +32,6 @@ class Ticker extends Logging {
}
lastTick = System.nanoTime()
tick += 1
if (count) tick += 1
}
}