mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
clock: Bug fix: function registerd OnStart might not be called
Fixes #645
This commit is contained in:
parent
d5ca4c3953
commit
3d24ffe3e0
@ -30,7 +30,7 @@ var (
|
||||
fpsCount = 0
|
||||
tpsCount = 0
|
||||
|
||||
started bool
|
||||
onStartCalled bool
|
||||
onStart func()
|
||||
|
||||
m sync.Mutex
|
||||
@ -132,11 +132,11 @@ func Update(tps int) int {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
if !started {
|
||||
if !onStartCalled {
|
||||
if onStart != nil {
|
||||
onStart()
|
||||
onStartCalled = true
|
||||
}
|
||||
started = true
|
||||
}
|
||||
|
||||
n := now()
|
||||
|
Loading…
Reference in New Issue
Block a user