mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08: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()
|
defer f.Close()
|
||||||
|
|
||||||
w, h := i.InternalSize()
|
pix := make([]byte, 4*i.width*i.height)
|
||||||
pix := make([]byte, 4*w*h)
|
|
||||||
if err := i.ReadPixels(pix); err != nil {
|
if err := i.ReadPixels(pix); err != nil {
|
||||||
return err
|
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)
|
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()
|
pix := make([]byte, 4*w*h)
|
||||||
if err != nil {
|
if err := dst.ReadPixels(pix); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
for j := 0; j < h/2; j++ {
|
for j := 0; j < h/2; j++ {
|
||||||
@ -107,8 +107,8 @@ func TestShader(t *testing.T) {
|
|||||||
s := graphicscommand.NewShader(&ir)
|
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)
|
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()
|
pix := make([]byte, 4*w*h)
|
||||||
if err != nil {
|
if err := dst.ReadPixels(pix); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
for j := 0; j < h; j++ {
|
for j := 0; j < h; j++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user