mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/atlas: assume backend.image is never nil
This commit is contained in:
parent
c29d4b24bb
commit
94a93f8032
@ -638,7 +638,7 @@ func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte
|
||||
}
|
||||
|
||||
func (i *Image) readPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte, region image.Rectangle) error {
|
||||
if i.backend == nil || i.backend.image == nil {
|
||||
if i.backend == nil {
|
||||
for i := range pixels {
|
||||
pixels[i] = 0
|
||||
}
|
||||
@ -869,9 +869,6 @@ func SwapBuffers(graphicsDriver graphicsdriver.Graphics) error {
|
||||
debug.Logf("Internal image sizes:\n")
|
||||
imgs := make([]*graphicscommand.Image, 0, len(theBackends))
|
||||
for _, backend := range theBackends {
|
||||
if backend.image == nil {
|
||||
continue
|
||||
}
|
||||
imgs = append(imgs, backend.image)
|
||||
}
|
||||
graphicscommand.LogImagesInfo(imgs)
|
||||
@ -942,9 +939,6 @@ func DumpImages(graphicsDriver graphicsdriver.Graphics, dir string) (string, err
|
||||
|
||||
images := make([]*graphicscommand.Image, 0, len(theBackends))
|
||||
for _, backend := range theBackends {
|
||||
if backend.image == nil {
|
||||
continue
|
||||
}
|
||||
images = append(images, backend.image)
|
||||
}
|
||||
return graphicscommand.DumpImages(images, graphicsDriver, dir)
|
||||
|
Loading…
Reference in New Issue
Block a user