mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +01:00
uidriver/mobile: Simplify updating logic
This commit is contained in:
parent
2c770f3644
commit
6cd74a9f4d
@ -269,19 +269,16 @@ func (u *UserInterface) scaleImpl() float64 {
|
||||
}
|
||||
|
||||
func (u *UserInterface) update(context driver.UIContext) error {
|
||||
render:
|
||||
for {
|
||||
t := time.NewTimer(500 * time.Millisecond)
|
||||
defer t.Stop()
|
||||
t := time.NewTimer(500 * time.Millisecond)
|
||||
defer t.Stop()
|
||||
|
||||
select {
|
||||
case <-renderCh:
|
||||
break render
|
||||
case <-t.C:
|
||||
context.SuspendAudio()
|
||||
continue
|
||||
}
|
||||
select {
|
||||
case <-renderCh:
|
||||
case <-t.C:
|
||||
context.SuspendAudio()
|
||||
<-renderCh
|
||||
}
|
||||
|
||||
context.ResumeAudio()
|
||||
|
||||
defer func() {
|
||||
|
Loading…
Reference in New Issue
Block a user