fix sprite animations

Always the same texture was copied :)
This commit is contained in:
Moritz Zwerger 2023-12-10 00:45:23 +01:00
parent 83c67d795a
commit 0435e316d6
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -57,7 +57,7 @@ class SpriteTexture(private val original: Texture) : Texture {
for (i in 0 until animationProperties.frameCount) {
val buffer = original.create(size)
buffer.put(original, Vec2i(0, size.y), Vec2i.EMPTY, size)
buffer.put(original, Vec2i(0, i * size.y), Vec2i.EMPTY, size)
val splitTexture = MemoryTexture(size, mipmaps = this.original.mipmaps, buffer = buffer)