Mercurial > touhou
diff pytouhou/ui/gamerunner.pyx @ 428:f41a26971a19
Remove all Loader uses from outside pytouhou.games, and add a --no-music option to disable bgm.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 16 Jul 2013 21:17:22 +0200 |
parents | 0604f4fbbe3c |
children | 878273a984c4 |
line wrap: on
line diff
--- a/pytouhou/ui/gamerunner.pyx +++ b/pytouhou/ui/gamerunner.pyx @@ -71,9 +71,14 @@ class GameRunner(GameRenderer): self.save_keystates = save_keystates - game.music = MusicPlayer(game.resource_loader, bgms) - game.music.play(0) - game.sfx_player = SFXPlayer(game.resource_loader) if not self.skip else NullPlayer() + null_player = NullPlayer() + if bgms: + game.music = MusicPlayer(game.resource_loader, bgms) + game.music.play(0) + else: + game.music = null_player + + game.sfx_player = SFXPlayer(game.resource_loader) if not self.skip else null_player def set_input(self, replay=None):