diff eosd @ 503:c622eaf64428

Optimize GameRunner some more, fix replay, and remove Window dependency in Renderer.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 04 Oct 2013 14:27:11 +0200
parents 777544d11578
children 1bc014f9d572
line wrap: on
line diff
--- a/eosd
+++ b/eosd
@@ -166,7 +166,8 @@ def main(window, path, data, stage_num, 
     game_class = GameBossRush if boss_rush else Game
 
     common = Common(resource_loader, characters, continues, stage_num - 1)
-    runner = GameRunner(window, resource_loader, skip=skip_replay, con=con)
+    runner = GameRunner(window, common, resource_loader, skip_replay, con)
+    window.set_runner(runner)
     while True:
         first_player = common.players[0]
 
@@ -206,8 +207,7 @@ def main(window, path, data, stage_num, 
         hints_stage = hints.stages[stage_num - 1] if hints else None
 
         game = game_class(resource_loader, stage_num, rank, difficulty,
-                          common, prng=prng, hints=hints_stage,
-                          friendly_fire=friendly_fire)
+                          common, prng, hints_stage, friendly_fire)
 
         if not enable_particles:
             def new_particle(pos, anim, amp, number=1, reverse=False, duration=24):
@@ -219,7 +219,6 @@ def main(window, path, data, stage_num, 
 
         # Main loop
         runner.load_game(game, background, bgms, replay, save_keystates)
-        window.set_runner(runner)
         try:
             window.run()
             break