Mercurial > touhou
comparison pytouhou/ui/background.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 |
---|---|
77 | 77 |
78 for ox, oy, oz, model_id, model in background.object_instances: | 78 for ox, oy, oz, model_id, model in background.object_instances: |
79 for ox2, oy2, oz2, width_override, height_override, sprite in model: | 79 for ox2, oy2, oz2, width_override, height_override, sprite in model: |
80 #TODO: view frustum culling | 80 #TODO: view frustum culling |
81 key, (vertices, uvs, colors) = get_sprite_rendering_data(sprite) | 81 key, (vertices, uvs, colors) = get_sprite_rendering_data(sprite) |
82 (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), (x4, y4, z4) = vertices | 82 x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4 = vertices |
83 left, right, bottom, top = uvs | 83 left, right, bottom, top = uvs |
84 r, g, b, a = colors | 84 r, g, b, a = colors |
85 | 85 |
86 vertex_buffer[nb_vertices] = Vertex(x1 + ox + ox2, y1 + oy + oy2, z1 + oz + oz2, left, bottom, r, g, b, a) | 86 vertex_buffer[nb_vertices] = Vertex(x1 + ox + ox2, y1 + oy + oy2, z1 + oz + oz2, left, bottom, r, g, b, a) |
87 vertex_buffer[nb_vertices+1] = Vertex(x2 + ox + ox2, y2 + oy + oy2, z2 + oz + oz2, right, bottom, r, g, b, a) | 87 vertex_buffer[nb_vertices+1] = Vertex(x2 + ox + ox2, y2 + oy + oy2, z2 + oz + oz2, right, bottom, r, g, b, a) |