diff pytouhou/ui/opengl/renderer.pyx @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents a6a191e371c7
children ec972eb44391
line wrap: on
line diff
--- a/pytouhou/ui/opengl/renderer.pyx
+++ b/pytouhou/ui/opengl/renderer.pyx
@@ -130,12 +130,12 @@ cdef class Renderer:
         glBindBuffer(GL_ARRAY_BUFFER, 0)
 
 
-    cdef void render_elements(self, elements) except *:
+    cdef bint render_elements(self, elements) except True:
         cdef Element element
 
         nb_elements = find_objects(self, elements)
         if not nb_elements:
-            return
+            return False
 
         nb_vertices = 0
         memset(self.last_indices, 0, sizeof(self.last_indices))
@@ -232,7 +232,7 @@ cdef class Renderer:
             glPopDebugGroup()
 
 
-    cdef void render_quads(self, rects, colors, GLuint texture) except *:
+    cdef bint render_quads(self, rects, colors, GLuint texture) except True:
         # There is nothing that batch more than two quads on the same texture, currently.
         cdef Vertex buf[8]
         cdef unsigned short indices[12]