comparison pytouhou/ui/sprite.pyx @ 449:d56536ef28e8

Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 03 Aug 2013 15:49:11 +0200
parents 723a3e67a223
children bfea9e9a6845
comparison
equal deleted inserted replaced
448:3bc37791f0a2 449:d56536ef28e8
65 uvs = (tx * x_1 + tox, 65 uvs = (tx * x_1 + tox,
66 (tx + tw) * x_1 + tox, 66 (tx + tw) * x_1 + tox,
67 ty * y_1 + toy, 67 ty * y_1 + toy,
68 (ty + th) * y_1 + toy) 68 (ty + th) * y_1 + toy)
69 69
70 key = sprite.anm.texture, sprite.blendfunc 70 key = MAX_TEXTURES * sprite.blendfunc + <long>sprite.anm.texture
71 r, g, b = sprite.color 71 r, g, b = sprite.color
72 values = tuple([x for x in vertmat.data[:12]]), uvs, (r, g, b, sprite.alpha) 72 values = tuple([x for x in vertmat.data[:12]]), uvs, (r, g, b, sprite.alpha)
73 sprite._rendering_data = key, values 73 sprite._rendering_data = key, values
74 sprite.changed = False 74 sprite.changed = False
75 75