mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
graphics: Bug fix: Errors should be returned after checking the history
This commit is contained in:
parent
806eb44258
commit
b146e5d1b4
@ -92,15 +92,15 @@ func (p *pixels) hasHistoryWith(target *Image) bool {
|
||||
}
|
||||
|
||||
func (p *pixels) resetHistoryIfNeeded(image *graphics.Image, target *Image, context *opengl.Context) error {
|
||||
if context == nil {
|
||||
return errors.New("ebiten: OpenGL context is missing: before running the main loop, it is forbidden to manipulate images that is used as a drawing source once.")
|
||||
}
|
||||
if p.drawImageHistory == nil {
|
||||
return nil
|
||||
}
|
||||
if !p.hasHistoryWith(target) {
|
||||
return nil
|
||||
}
|
||||
if context == nil {
|
||||
return errors.New("ebiten: OpenGL context is missing: before running the main loop, it is forbidden to manipulate images that is used as a drawing source once.")
|
||||
}
|
||||
var err error
|
||||
p.basePixels, err = image.Pixels(context)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user