From af03a744b68bb2375c45730ff67e3b8dc5848e70 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sat, 3 Jan 2015 13:42:46 -1000 Subject: [PATCH] rotate textures without looping --- src/mcedit2/rendering/blockmodels.pyx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mcedit2/rendering/blockmodels.pyx b/src/mcedit2/rendering/blockmodels.pyx index 9fdee64..89bf84a 100644 --- a/src/mcedit2/rendering/blockmodels.pyx +++ b/src/mcedit2/rendering/blockmodels.pyx @@ -397,10 +397,9 @@ cdef getBlockFaceVertices(box, face, tuple uv, textureRotation): (u2, v1), ] if textureRotation: - while textureRotation > 0: - tc = tc[1:] + tc[:1] - textureRotation -= 90 - + roll = textureRotation / 90 + roll %= 4 + tc = tc[roll:] + tc[:roll] tc = numpy.array(tc) if face == faces.FaceXDecreasing: