comparison eosd @ 530:64d9117b9209

Replace the --no-music option with --no-sound, disabling sound rendering altogether.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 27 Mar 2014 21:30:04 +0100
parents 5e3e0b09a531
children a7dc55ad9380
comparison
equal deleted inserted replaced
529:bd0c15d28dd6 530:64d9117b9209
40 parser.add_argument('--fps-limit', metavar='FPS', default=-1, type=int, help='Set fps limit. A value of 0 disables fps limiting, while a negative value limits to 60 fps if and only if vsync doesn’t work.') 40 parser.add_argument('--fps-limit', metavar='FPS', default=-1, type=int, help='Set fps limit. A value of 0 disables fps limiting, while a negative value limits to 60 fps if and only if vsync doesn’t work.')
41 parser.add_argument('--debug', action='store_true', help='Set unlimited continues, and perhaps other debug features.') 41 parser.add_argument('--debug', action='store_true', help='Set unlimited continues, and perhaps other debug features.')
42 parser.add_argument('--fixed-pipeline', action='store_true', help='Use the fixed pipeline instead of the new programmable one.') 42 parser.add_argument('--fixed-pipeline', action='store_true', help='Use the fixed pipeline instead of the new programmable one.')
43 parser.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).') 43 parser.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).')
44 parser.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).') 44 parser.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).')
45 parser.add_argument('--no-music', action='store_false', help='Disable background music.') 45 parser.add_argument('--no-sound', action='store_false', help='Disable music and SFX.')
46 parser.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.') 46 parser.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.')
47 parser.add_argument('--verbosity', metavar='VERBOSITY', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Select the wanted logging level.') 47 parser.add_argument('--verbosity', metavar='VERBOSITY', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Select the wanted logging level.')
48 parser.add_argument('--game', metavar='GAME', choices=['EoSD'], default='EoSD', help='Select the game engine to use.') 48 parser.add_argument('--game', metavar='GAME', choices=['EoSD'], default='EoSD', help='Select the game engine to use.')
49 parser.add_argument('--port', metavar='PORT', type=int, default=0, help='Local port to use for netplay') 49 parser.add_argument('--port', metavar='PORT', type=int, default=0, help='Local port to use for netplay')
50 parser.add_argument('--remote', metavar='REMOTE', default=None, help='Remote address') 50 parser.add_argument('--remote', metavar='REMOTE', default=None, help='Remote address')
108 Game.cleanup(self) 108 Game.cleanup(self)
109 109
110 110
111 def main(window, path, data, stage_num, rank, character, replay, save_filename, 111 def main(window, path, data, stage_num, rank, character, replay, save_filename,
112 skip_replay, boss_rush, debug, enable_background, enable_particles, 112 skip_replay, boss_rush, debug, enable_background, enable_particles,
113 enable_music, hints, verbosity, port, remote, friendly_fire): 113 hints, verbosity, port, remote, friendly_fire):
114 114
115 resource_loader = Loader(path) 115 resource_loader = Loader(path)
116 116
117 try: 117 try:
118 resource_loader.scan_archives(data) 118 resource_loader.scan_archives(data)
223 def new_particle(pos, anim, amp, number=1, reverse=False, duration=24): 223 def new_particle(pos, anim, amp, number=1, reverse=False, duration=24):
224 pass 224 pass
225 game.new_particle = new_particle 225 game.new_particle = new_particle
226 226
227 background = game.background if enable_background else None 227 background = game.background if enable_background else None
228 bgms = game.std.bgms if enable_music else None 228 runner.load_game(game, background, game.std.bgms, replay, save_keystates)
229 229
230 # Main loop
231 runner.load_game(game, background, bgms, replay, save_keystates)
232 try: 230 try:
231 # Main loop
233 window.run() 232 window.run()
234 break 233 break
235 except NextStage: 234 except NextStage:
236 if not story or stage_num == (7 if boss_rush else 6 if rank > 0 else 5): 235 if not story or stage_num == (7 if boss_rush else 6 if rank > 0 else 5):
237 break 236 break
252 if save_filename: 251 if save_filename:
253 with open(save_filename, 'wb+') as file: 252 with open(save_filename, 'wb+') as file:
254 save_replay.write(file) 253 save_replay.write(file)
255 254
256 255
257 with SDL(): 256 with SDL(sound=args.no_sound):
258 window = Window(double_buffer=(not args.single_buffer), 257 window = Window(double_buffer=(not args.single_buffer),
259 fps_limit=args.fps_limit, 258 fps_limit=args.fps_limit,
260 fixed_pipeline=args.fixed_pipeline, opengl=opengl) 259 fixed_pipeline=args.fixed_pipeline, opengl=opengl)
261 260
262 main(window, args.path, tuple(args.data), args.stage, args.rank, 261 main(window, args.path, tuple(args.data), args.stage, args.rank,
263 args.character, args.replay, args.save_replay, args.skip_replay, 262 args.character, args.replay, args.save_replay, args.skip_replay,
264 args.boss_rush, args.debug, args.no_background, args.no_particles, 263 args.boss_rush, args.debug, args.no_background, args.no_particles,
265 args.no_music, args.hints, args.verbosity, args.port, args.remote, 264 args.hints, args.verbosity, args.port, args.remote,
266 args.no_friendly_fire) 265 args.no_friendly_fire)
267 266
268 import gc 267 import gc
269 gc.collect() 268 gc.collect()