mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +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 {
|
func (u *UserInterface) update(context driver.UIContext) error {
|
||||||
render:
|
t := time.NewTimer(500 * time.Millisecond)
|
||||||
for {
|
defer t.Stop()
|
||||||
t := time.NewTimer(500 * time.Millisecond)
|
|
||||||
defer t.Stop()
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-renderCh:
|
case <-renderCh:
|
||||||
break render
|
case <-t.C:
|
||||||
case <-t.C:
|
context.SuspendAudio()
|
||||||
context.SuspendAudio()
|
<-renderCh
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context.ResumeAudio()
|
context.ResumeAudio()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user