mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +01:00
loop: Bug fix: Don't use 'system timer clock' when audio clock is valid
This commit is contained in:
parent
a92f77c207
commit
6f606c6bb1
@ -89,13 +89,15 @@ func (c *runContext) updateCount(now int64) int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if clock.IsValid() && c.lastClockFrame != clock.Now() {
|
if clock.IsValid() {
|
||||||
sync = true
|
if c.lastClockFrame != clock.Now() {
|
||||||
f := clock.Now()
|
sync = true
|
||||||
if c.frames < f {
|
f := clock.Now()
|
||||||
count = int(f - c.frames)
|
if c.frames < f {
|
||||||
|
count = int(f - c.frames)
|
||||||
|
}
|
||||||
|
c.lastClockFrame = f
|
||||||
}
|
}
|
||||||
c.lastClockFrame = f
|
|
||||||
} else {
|
} else {
|
||||||
if t > 5*int64(time.Second)/int64(FPS) {
|
if t > 5*int64(time.Second)/int64(FPS) {
|
||||||
// The previous time is too old. Let's assume that the window was unfocused.
|
// The previous time is too old. Let's assume that the window was unfocused.
|
||||||
|
Loading…
Reference in New Issue
Block a user