rkruppe committed a81ac0c

Remove some more cruft from

Comments (0)

Files changed (1)

 from ttgx.model import gamestate
 from ttgx.meta import from_yaml
-log = logging.getLogger('ttg-demo')
-draw_count = 0
+log = logging.getLogger('ttgx-demo')
 def init():
-#XXX FPS and CPU time is incredibly high (>90% CPU, usually thousands of FPS,
-# sometimes tens of thousands).
-# Somehow, pyglet sucks at sleep()ing or doesn't even try.
-# Despite the docs praising the built-in event loop as less CPU-hungry,
-# it does as many updates as it can, so the end result is just as CPU-hungry.
-# (Though to be fair, it may avoid busy waits in some places and just use the
-#  free time for other drawing.)
-#TODO: dive into pyglet.event.EventLoop and come up with a better idle() that
-# respects FPS limits
-def run():
-    start_time =
-    end_time =
-    dt = end_time - start_time
-    pseudo_fps = draw_count / dt.total_seconds()
-        "%d draw() calls in %.2f seconds => %.2f FPS",
-        draw_count, dt.total_seconds(), pseudo_fps
-    )
 def exit(gsc):
     if gsc.game_active:
         log.error('Initialization failed:', exc_info=True)
-    run()
 if __name__ == '__main__':