Mercurial > touhou
comparison pytouhou/ui/renderer.pyx @ 435:878273a984c4
Improve Matrix representation, using float[16] instead of imbricated python lists.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 07 Aug 2013 11:34:40 +0200 |
parents | 5d7bb2fd74f7 |
children | d56536ef28e8 |
comparison
equal
deleted
inserted
replaced
434:18e4b121646b | 435:878273a984c4 |
---|---|
65 ox, oy = element.x, element.y | 65 ox, oy = element.x, element.y |
66 key, (vertices, uvs, colors) = get_sprite_rendering_data(sprite) | 66 key, (vertices, uvs, colors) = get_sprite_rendering_data(sprite) |
67 rec = indices_by_texture.setdefault(key, []) | 67 rec = indices_by_texture.setdefault(key, []) |
68 | 68 |
69 # Pack data in buffer | 69 # Pack data in buffer |
70 (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4) = vertices | 70 x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4 = vertices |
71 left, right, bottom, top = uvs | 71 left, right, bottom, top = uvs |
72 r, g, b, a = colors | 72 r, g, b, a = colors |
73 self.vertex_buffer[nb_vertices] = Vertex(x1 + ox, y1 + oy, z1, left, bottom, r, g, b, a) | 73 self.vertex_buffer[nb_vertices] = Vertex(x1 + ox, y1 + oy, z1, left, bottom, r, g, b, a) |
74 self.vertex_buffer[nb_vertices+1] = Vertex(x2 + ox, y2 + oy, z2, right, bottom, r, g, b, a) | 74 self.vertex_buffer[nb_vertices+1] = Vertex(x2 + ox, y2 + oy, z2, right, bottom, r, g, b, a) |
75 self.vertex_buffer[nb_vertices+2] = Vertex(x3 + ox, y3 + oy, z3, right, top, r, g, b, a) | 75 self.vertex_buffer[nb_vertices+2] = Vertex(x3 + ox, y3 + oy, z3, right, top, r, g, b, a) |