mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ebiten: Bug fix: Crash at examples/shader
This commit is contained in:
parent
d9cf1095d4
commit
530723ec66
6
image.go
6
image.go
@ -441,8 +441,11 @@ func (i *Image) DrawTrianglesWithShader(vertices []Vertex, indices []uint16, sha
|
||||
// The actual value is set at graphicscommand package.
|
||||
us = append([]interface{}{[]float32{0, 0}}, us...)
|
||||
|
||||
var bx0, by0, bx1, by1 float32
|
||||
var dx, dy, bx0, by0, bx1, by1 float32
|
||||
if firstImage != nil {
|
||||
dx = float32(firstImage.Bounds().Min.X)
|
||||
dy = float32(firstImage.Bounds().Min.Y)
|
||||
|
||||
w, h := firstImage.Size()
|
||||
bx0 = float32(0)
|
||||
by0 = float32(0)
|
||||
@ -450,7 +453,6 @@ func (i *Image) DrawTrianglesWithShader(vertices []Vertex, indices []uint16, sha
|
||||
by1 = float32(h)
|
||||
}
|
||||
|
||||
dx, dy := float32(firstImage.Bounds().Min.X), float32(firstImage.Bounds().Min.Y)
|
||||
vs := make([]float32, len(vertices)*graphics.VertexFloatNum)
|
||||
for i, v := range vertices {
|
||||
vs[i*graphics.VertexFloatNum] = v.DstX
|
||||
|
Loading…
Reference in New Issue
Block a user