diff pytouhou/ui/gamerunner.pyx @ 594:12756994a92c

Make frameskip actually skip the rendering part, not just the buffer swap.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 18 Oct 2014 18:04:43 +0200
parents 19d930f9e3f0
children 3c2f96f1d715
line wrap: on
line diff
--- a/pytouhou/ui/gamerunner.pyx
+++ b/pytouhou/ui/gamerunner.pyx
@@ -114,7 +114,7 @@ cdef class GameRunner(Runner):
             self.renderer.capture(filename, self.width, self.height)
 
 
-    cpdef bint update(self) except? False:
+    cpdef bint update(self, bint render) except? False:
         cdef long keystate
         capture = False
 
@@ -178,7 +178,7 @@ cdef class GameRunner(Runner):
         if self.window is not None and 'framerate' in labels:
             labels['framerate'].set_text('%.2ffps' % self.window.get_fps())
 
-        if not self.skip and self.renderer is not None:
+        if render and not self.skip and self.renderer is not None:
             self.renderer.render(self.game)
 
         if capture: