comparison scripts/pytouhou @ 547:e35bef07290d

Always import runners from pytouhou.vm, to allow their replacement.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 08 Nov 2013 18:47:00 +0100
parents 94dd9862c470
children 1e9ea6519f3c
comparison
equal deleted inserted replaced
546:94dd9862c470 547:e35bef07290d
63 63
64 64
65 import sys 65 import sys
66 import logging 66 import logging
67 67
68 if args.backend == 'opengl': 68
69 try: 69 if args.game == 'EoSD':
70 from pytouhou.ui.opengl.gamerenderer import GameRenderer 70 from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
71 opengl = True 71
72 except ImportError:
73 args.backend = 'sdl'
74
75 if args.backend == 'sdl':
76 from pytouhou.ui.sdl.gamerenderer import GameRenderer
77 opengl = False
78 72
79 from pytouhou.lib.sdl import SDL, show_simple_message_box 73 from pytouhou.lib.sdl import SDL, show_simple_message_box
80 from pytouhou.ui.window import Window 74 from pytouhou.ui.window import Window
81 from pytouhou.resource.loader import Loader 75 from pytouhou.resource.loader import Loader
82 from pytouhou.ui.gamerunner import GameRunner 76 from pytouhou.ui.gamerunner import GameRunner
86 from pytouhou.vm.msgrunner import NextStage 80 from pytouhou.vm.msgrunner import NextStage
87 from pytouhou.formats.hint import Hint 81 from pytouhou.formats.hint import Hint
88 from pytouhou.network import Network 82 from pytouhou.network import Network
89 83
90 84
91 if args.game == 'EoSD': 85 if args.backend == 'opengl':
92 from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game 86 try:
87 from pytouhou.ui.opengl.gamerenderer import GameRenderer
88 opengl = True
89 except ImportError:
90 args.backend = 'sdl'
91
92 if args.backend == 'sdl':
93 from pytouhou.ui.sdl.gamerenderer import GameRenderer
94 opengl = False
93 95
94 96
95 class GameBossRush(Game): 97 class GameBossRush(Game):
96 def run_iter(self, keystates): 98 def run_iter(self, keystates):
97 for i in range(20): 99 for i in range(20):