diff pytouhou/ui/background.pyx @ 449:d56536ef28e8

Improve render_elements’ speed a lot, and fix it in some corner cases. Thanks liori!
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 03 Aug 2013 15:49:11 +0200
parents 878273a984c4
children 6e733ed817bd
line wrap: on
line diff
--- a/pytouhou/ui/background.pyx
+++ b/pytouhou/ui/background.pyx
@@ -90,7 +90,8 @@ cdef class BackgroundRenderer:
 
                 nb_vertices += 4
 
-        self.texture, self.blendfunc = key
+        self.texture = key % MAX_TEXTURES
+        self.blendfunc = key // MAX_TEXTURES
         self.nb_vertices = nb_vertices
         self.vertex_buffer = <Vertex*> realloc(vertex_buffer, nb_vertices * sizeof(Vertex))