comparison pytouhou/ui/opengl/sprite.pyx @ 515:b3193b43a86c

Add an indirection layer for textures, to cope with drivers assigning them random names.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 06 Dec 2013 19:02:42 +0100
parents 3d4410de78e1
children 6e3b3d5d4691
comparison
equal deleted inserted replaced
514:3d4410de78e1 515:b3193b43a86c
63 uvs = (tx * x_1 + tox, 63 uvs = (tx * x_1 + tox,
64 (tx + tw) * x_1 + tox, 64 (tx + tw) * x_1 + tox,
65 ty * y_1 + toy, 65 ty * y_1 + toy,
66 (ty + th) * y_1 + toy) 66 (ty + th) * y_1 + toy)
67 67
68 key = ((<Texture>sprite.anm.texture).texture << 1) | sprite.blendfunc 68 key = ((<Texture>sprite.anm.texture).key << 1) | sprite.blendfunc
69 r, g, b = sprite.color 69 r, g, b = sprite.color
70 values = tuple([x for x in vertmat.data[:12]]), uvs, (r, g, b, sprite.alpha) 70 values = tuple([x for x in vertmat.data[:12]]), uvs, (r, g, b, sprite.alpha)
71 sprite._rendering_data = key, values 71 sprite._rendering_data = key, values
72 sprite.changed = False 72 sprite.changed = False
73 73