restorable: Bug fix: indices has to be copied

This commit is contained in:
Hajime Hoshi 2019-09-29 01:30:26 +09:00
parent 492149c463
commit 4feb0a4f3e

View File

@ -413,10 +413,14 @@ func (i *Image) appendDrawTrianglesHistory(image *Image, vertices []float32, ind
} }
// All images must be resolved and not stale each after frame. // All images must be resolved and not stale each after frame.
// So we don't have to care if image is stale or not here. // So we don't have to care if image is stale or not here.
// vertices is generated at ebiten package and doesn't have to be copied so far.
is := make([]uint16, len(indices))
copy(is, indices)
item := &drawTrianglesHistoryItem{ item := &drawTrianglesHistoryItem{
image: image, image: image,
vertices: vertices, vertices: vertices,
indices: indices, indices: is,
colorm: colorm, colorm: colorm,
mode: mode, mode: mode,
filter: filter, filter: filter,