diff pytouhou/ui/opengl/sprite.pyx @ 601:016f6b937893

Make sample data build again.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 25 Oct 2014 18:57:10 +0200
parents e15672733c93
children
line wrap: on
line diff
--- a/pytouhou/ui/opengl/sprite.pyx
+++ b/pytouhou/ui/opengl/sprite.pyx
@@ -34,6 +34,16 @@ cdef RenderingData* get_sprite_rendering
     return <RenderingData*>sprite._rendering_data
 
 
+def get_sprite_vertices(Sprite sprite):
+    if sprite.changed:
+        render_sprite(sprite)
+    data = <RenderingData*>sprite._rendering_data
+    return [(data.pos[0], data.pos[1], data.pos[2]),
+            (data.pos[3], data.pos[4], data.pos[5]),
+            (data.pos[6], data.pos[7], data.pos[8]),
+            (data.pos[9], data.pos[10], data.pos[11])]
+
+
 cdef void render_sprite(Sprite sprite) nogil:
     cdef Matrix vertmat