mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-03 06:24:27 +01:00
ebiten: Refactoring: Reduce calls of updateOffscreen
This commit is contained in:
parent
770661c609
commit
0aa98d3113
@ -175,8 +175,6 @@ func (c *uiContext) update() error {
|
||||
}
|
||||
|
||||
for i := 0; i < updateCount; i++ {
|
||||
c.updateOffscreen()
|
||||
|
||||
if err := hooks.RunBeforeUpdateHooks(); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -186,10 +184,7 @@ func (c *uiContext) update() error {
|
||||
uiDriver().ResetForFrame()
|
||||
}
|
||||
|
||||
// c.screen might be nil when updateCount is 0 in the initial state (#1039).
|
||||
if c.screen == nil {
|
||||
return nil
|
||||
}
|
||||
c.updateOffscreen()
|
||||
|
||||
if IsScreenClearedEveryFrame() {
|
||||
c.offscreen.Clear()
|
||||
|
Loading…
Reference in New Issue
Block a user