diff eosd @ 334:4eca6130f118

Add options to set FPS limit and disable double buffering
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jul 2012 01:07:41 +0200
parents d369a369204a
children bc162f60f0a0
line wrap: on
line diff
--- a/eosd
+++ b/eosd
@@ -49,7 +49,7 @@ class EoSDGameBossRush(EoSDGame):
 
 
 
-def main(path, data, stage_num, rank, character, replay, boss_rush):
+def main(path, data, stage_num, rank, character, replay, boss_rush, fps_limit, single_buffer):
     resource_loader = Loader(path)
     resource_loader.scan_archives(data)
 
@@ -71,7 +71,7 @@ def main(path, data, stage_num, rank, ch
 
     game_class = EoSDGameBossRush if boss_rush else EoSDGame
 
-    runner = GameRunner(resource_loader)
+    runner = GameRunner(resource_loader, fps_limit=fps_limit, double_buffer=(not single_buffer))
     while True:
         if replay:
             level = replay.levels[stage_num - 1]
@@ -131,7 +131,10 @@ parser.add_argument('-r', '--rank', meta
 parser.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).')
 parser.add_argument('--replay', metavar='REPLAY', help='Select a replay')
 parser.add_argument('-b', '--boss-rush', action='store_true', help='Fight only bosses')
+parser.add_argument('--single-buffer', action='store_true', help='Disable double buffering')
+parser.add_argument('--fps-limit', metavar='FPS', default=60, type=int, help='Set fps limit')
 
 args = parser.parse_args()
 
-main(args.path, tuple(args.data), args.stage, args.rank, args.character, args.replay, args.boss_rush)
+main(args.path, tuple(args.data), args.stage, args.rank, args.character,
+     args.replay, args.boss_rush, args.fps_limit, args.single_buffer)