diff pytouhou/ui/sprite.pyx @ 397:c5ba11ede097

Don’t duplicate values in sprite rendering data.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 06 Feb 2013 21:41:05 +0100
parents 9e2cbb2c2c64
children 3a7b36324611
line wrap: on
line diff
--- a/pytouhou/ui/sprite.pyx
+++ b/pytouhou/ui/sprite.pyx
@@ -59,16 +59,16 @@ cpdef object get_sprite_rendering_data(o
     x_1 = 1. / sprite.anm.size[0]
     y_1 = 1. / sprite.anm.size[1]
     tox, toy = sprite.texoffsets
-    uvs = [tx * x_1 + tox,         1. - (ty * y_1 + toy),
-           (tx + tw) * x_1 + tox,  1. - (ty * y_1 + toy),
-           (tx + tw) * x_1 + tox,  1. - ((ty + th) * y_1 + toy),
-           tx * x_1 + tox,         1. - ((ty + th) * y_1 + toy)]
+    uvs = (tx * x_1 + tox,
+           (tx + tw) * x_1 + tox,
+           1. - (ty * y_1 + toy),
+           1. - ((ty + th) * y_1 + toy))
 
     (x1, x2 , x3, x4), (y1, y2, y3, y4), (z1, z2, z3, z4), _ = vertmat.data
 
     key = sprite.anm.texture, sprite.blendfunc
     r, g, b = sprite.color
-    values = ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)), uvs, [r, g, b, sprite.alpha] * 4
+    values = ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)), uvs, (r, g, b, sprite.alpha)
     sprite._rendering_data = key, values
     sprite.changed = False