mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Reduce the size of vertices array
This commit is contained in:
parent
0c932fbf84
commit
92e56d53f1
2
image.go
2
image.go
@ -105,7 +105,7 @@ func (i *Image) DrawImage(image *Image, options *DrawImageOptions) (err error) {
|
|||||||
}
|
}
|
||||||
quads := &textureQuads{parts: parts, width: image.width, height: image.height}
|
quads := &textureQuads{parts: parts, width: image.width, height: image.height}
|
||||||
// TODO: Reuse one vertices instead of making here, but this would need locking.
|
// TODO: Reuse one vertices instead of making here, but this would need locking.
|
||||||
vertices := make([]int16, 16*graphics.MaxQuads)
|
vertices := make([]int16, parts.Len()*16)
|
||||||
n := quads.vertices(vertices)
|
n := quads.vertices(vertices)
|
||||||
if n == 0 {
|
if n == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user