mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
ebiten: Refactoring
This commit is contained in:
parent
2fee1fae22
commit
99baaf18b0
3
image.go
3
image.go
@ -220,8 +220,7 @@ func (i *Image) ReplacePixels(p []uint8) error {
|
|||||||
}
|
}
|
||||||
// Don't set i.pixels here because i.pixels is used not every time.
|
// Don't set i.pixels here because i.pixels is used not every time.
|
||||||
i.pixels = nil
|
i.pixels = nil
|
||||||
l := 4 * i.width * i.height
|
if l := 4 * i.width * i.height; len(p) != l {
|
||||||
if len(p) != l {
|
|
||||||
return fmt.Errorf("ebiten: p's length must be %d", l)
|
return fmt.Errorf("ebiten: p's length must be %d", l)
|
||||||
}
|
}
|
||||||
return i.framebuffer.ReplacePixels(glContext, i.texture, p)
|
return i.framebuffer.ReplacePixels(glContext, i.texture, p)
|
||||||
|
Loading…
Reference in New Issue
Block a user