comparison pytouhou/ui/window.pyx @ 496:104c737ce8b3

Test target FPS for natural instead of non-zero.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 14 Oct 2013 12:20:39 +0200
parents 2276229282fd
children c622eaf64428
comparison
equal deleted inserted replaced
495:b32cef75df59 496:104c737ce8b3
62 62
63 self._ref_frame += 1 63 self._ref_frame += 1
64 self._fps_frame += 1 64 self._fps_frame += 1
65 65
66 target_tick = self._ref_tick 66 target_tick = self._ref_tick
67 if self._target_fps: 67 if self._target_fps > 0:
68 target_tick += <unsigned long>(self._ref_frame * 1000 / self._target_fps) 68 target_tick += <unsigned long>(self._ref_frame * 1000 / self._target_fps)
69 69
70 if current <= target_tick: 70 if current <= target_tick:
71 sdl.delay(target_tick - current) 71 sdl.delay(target_tick - current)
72 else: 72 else: