mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 13:07:26 +01:00
graphics: Refactoring
This commit is contained in:
parent
f6be72fba2
commit
931e60902f
@ -223,6 +223,11 @@ func (i *imageImpl) flushPixelsIfNeeded(target *imageImpl, context *opengl.Conte
|
||||
if target.isDisposed() {
|
||||
return errors.New("ebiten: target is already disposed")
|
||||
}
|
||||
if context == nil {
|
||||
// context is null when this is not initialized yet.
|
||||
i.pixels.MakeInconsistent()
|
||||
return nil
|
||||
}
|
||||
if err := i.pixels.FlushIfNeeded(target.image, context); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -148,11 +148,6 @@ func (p *Pixels) FlushIfNeeded(target *graphics.Image, context *opengl.Context)
|
||||
if !p.hasHistoryWith(target) {
|
||||
return nil
|
||||
}
|
||||
if context == nil {
|
||||
// context is null when this is not initialized yet.
|
||||
p.MakeInconsistent()
|
||||
return nil
|
||||
}
|
||||
p.inconsistent = false
|
||||
var err error
|
||||
p.basePixels, err = p.image.Pixels(context)
|
||||
|
Loading…
Reference in New Issue
Block a user