mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/graphicscommand: bug fix: compile error, test failures
This commit is contained in:
parent
b22309a0e5
commit
4ca1220671
@ -223,8 +223,7 @@ func (i *Image) Dump(path string, blackbg bool, rect image.Rectangle) error {
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
w, h := i.InternalSize()
|
||||
pix := make([]byte, 4*w*h)
|
||||
pix := make([]byte, 4*i.width*i.height)
|
||||
if err := i.ReadPixels(pix); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ func TestClear(t *testing.T) {
|
||||
}
|
||||
dst.DrawTriangles([graphics.ShaderImageNum]*graphicscommand.Image{src}, [graphics.ShaderImageNum - 1][2]float32{}, vs, is, affine.ColorMIdentity{}, graphicsdriver.CompositeModeClear, graphicsdriver.FilterNearest, graphicsdriver.AddressUnsafe, dr, graphicsdriver.Region{}, nil, nil, false)
|
||||
|
||||
pix, err := dst.Pixels()
|
||||
if err != nil {
|
||||
pix := make([]byte, 4*w*h)
|
||||
if err := dst.ReadPixels(pix); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for j := 0; j < h/2; j++ {
|
||||
@ -107,8 +107,8 @@ func TestShader(t *testing.T) {
|
||||
s := graphicscommand.NewShader(&ir)
|
||||
dst.DrawTriangles([graphics.ShaderImageNum]*graphicscommand.Image{}, [graphics.ShaderImageNum - 1][2]float32{}, vs, is, affine.ColorMIdentity{}, graphicsdriver.CompositeModeSourceOver, graphicsdriver.FilterNearest, graphicsdriver.AddressUnsafe, dr, graphicsdriver.Region{}, s, nil, false)
|
||||
|
||||
pix, err := dst.Pixels()
|
||||
if err != nil {
|
||||
pix := make([]byte, 4*w*h)
|
||||
if err := dst.ReadPixels(pix); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for j := 0; j < h; j++ {
|
||||
|
Loading…
Reference in New Issue
Block a user