mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
graphics: Bug fix: restoring needs to be done after main logic execution (#357)
This commit is contained in:
parent
5a4a82ab50
commit
cbc08d9c16
@ -143,11 +143,6 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
|||||||
if err := c.initializeIfNeeded(context); err != nil {
|
if err := c.initializeIfNeeded(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// TODO: Is it OK to restore images here? The images can be in 'stale' state after c.f().
|
|
||||||
// (#357)
|
|
||||||
if err := restorable.ResolveStalePixels(context); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
for i := 0; i < updateCount; i++ {
|
for i := 0; i < updateCount; i++ {
|
||||||
restorable.ClearVolatileImages()
|
restorable.ClearVolatileImages()
|
||||||
setRunningSlowly(i < updateCount-1)
|
setRunningSlowly(i < updateCount-1)
|
||||||
@ -161,6 +156,10 @@ func (c *graphicsContext) UpdateAndDraw(context *opengl.Context, updateCount int
|
|||||||
if err := c.drawToDefaultRenderTarget(context); err != nil {
|
if err := c.drawToDefaultRenderTarget(context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// TODO: Add tests to check if this behavior is correct (#357)
|
||||||
|
if err := restorable.ResolveStalePixels(context); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user