mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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.
|
||||
i.pixels = nil
|
||||
l := 4 * i.width * i.height
|
||||
if len(p) != l {
|
||||
if l := 4 * i.width * i.height; len(p) != l {
|
||||
return fmt.Errorf("ebiten: p's length must be %d", l)
|
||||
}
|
||||
return i.framebuffer.ReplacePixels(glContext, i.texture, p)
|
||||
|
Loading…
Reference in New Issue
Block a user