comparison pytouhou/ui/sprite.pyx @ 393:9e2cbb2c2c64

Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 06 Feb 2013 19:55:54 +0100
parents f3099ebf4f61
children c5ba11ede097
comparison
equal deleted inserted replaced
392:45e1a9a37e66 393:9e2cbb2c2c64
64 (tx + tw) * x_1 + tox, 1. - ((ty + th) * y_1 + toy), 64 (tx + tw) * x_1 + tox, 1. - ((ty + th) * y_1 + toy),
65 tx * x_1 + tox, 1. - ((ty + th) * y_1 + toy)] 65 tx * x_1 + tox, 1. - ((ty + th) * y_1 + toy)]
66 66
67 (x1, x2 , x3, x4), (y1, y2, y3, y4), (z1, z2, z3, z4), _ = vertmat.data 67 (x1, x2 , x3, x4), (y1, y2, y3, y4), (z1, z2, z3, z4), _ = vertmat.data
68 68
69 key = (sprite.anm.first_name, sprite.anm.secondary_name), sprite.blendfunc 69 key = sprite.anm.texture, sprite.blendfunc
70 r, g, b = sprite.color 70 r, g, b = sprite.color
71 values = ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)), uvs, [r, g, b, sprite.alpha] * 4 71 values = ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4)), uvs, [r, g, b, sprite.alpha] * 4
72 sprite._rendering_data = key, values 72 sprite._rendering_data = key, values
73 sprite.changed = False 73 sprite.changed = False
74 74