comparison 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
comparison
equal deleted inserted replaced
593:974decb8df4f 594:12756994a92c
112 if self.renderer is not None: 112 if self.renderer is not None:
113 filename = 'screenshot/frame%06d.ppm' % self.game.frame 113 filename = 'screenshot/frame%06d.ppm' % self.game.frame
114 self.renderer.capture(filename, self.width, self.height) 114 self.renderer.capture(filename, self.width, self.height)
115 115
116 116
117 cpdef bint update(self) except? False: 117 cpdef bint update(self, bint render) except? False:
118 cdef long keystate 118 cdef long keystate
119 capture = False 119 capture = False
120 120
121 if self.background is not None: 121 if self.background is not None:
122 self.background.update(self.game.frame) 122 self.background.update(self.game.frame)
176 176
177 labels = self.game.interface.labels 177 labels = self.game.interface.labels
178 if self.window is not None and 'framerate' in labels: 178 if self.window is not None and 'framerate' in labels:
179 labels['framerate'].set_text('%.2ffps' % self.window.get_fps()) 179 labels['framerate'].set_text('%.2ffps' % self.window.get_fps())
180 180
181 if not self.skip and self.renderer is not None: 181 if render and not self.skip and self.renderer is not None:
182 self.renderer.render(self.game) 182 self.renderer.render(self.game)
183 183
184 if capture: 184 if capture:
185 self.capture() 185 self.capture()
186 186