mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 02:59:19 +01:00
Stop TickUpdatable stuff during the pause
This commit is contained in:
parent
d533e33f2b
commit
8fc3759d88
@ -181,7 +181,7 @@ object OcelotDesktop extends LoggingConfiguration with Logging {
|
||||
}
|
||||
}
|
||||
|
||||
ticker.waitNext()
|
||||
ticker.waitNext(!emulationPaused)
|
||||
}
|
||||
} catch {
|
||||
case _: InterruptedException => // ignore
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user