changeset 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
files pytouhou/game/background.py pytouhou/game/bullet.pyx pytouhou/game/effect.pyx pytouhou/game/enemy.pyx pytouhou/game/face.py pytouhou/game/game.pyx pytouhou/game/laser.pyx pytouhou/game/orb.py pytouhou/game/player.pyx pytouhou/game/text.py pytouhou/games/eosd.py pytouhou/ui/anmrenderer.pyx pytouhou/vm/__init__.py scripts/pytouhou
diffstat 14 files changed, 28 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/background.py
+++ b/pytouhou/game/background.py
@@ -14,7 +14,7 @@
 
 
 from pytouhou.utils.interpolator import Interpolator
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 from pytouhou.game.sprite import Sprite
 
 
--- a/pytouhou/game/bullet.pyx
+++ b/pytouhou/game/bullet.pyx
@@ -14,7 +14,7 @@
 
 from libc.math cimport cos, sin, atan2, M_PI as pi
 
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 from pytouhou.game.sprite cimport Sprite
 
 
--- a/pytouhou/game/effect.pyx
+++ b/pytouhou/game/effect.pyx
@@ -13,7 +13,7 @@
 ##
 
 from pytouhou.game.sprite cimport Sprite
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 from pytouhou.game.game cimport Game
 
--- a/pytouhou/game/enemy.pyx
+++ b/pytouhou/game/enemy.pyx
@@ -14,7 +14,7 @@
 
 from libc.math cimport cos, sin, atan2, M_PI as pi
 
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 from pytouhou.game.sprite import Sprite
 from pytouhou.game.bullet cimport Bullet, LAUNCHED
 from pytouhou.game.laser cimport Laser, PlayerLaser
--- a/pytouhou/game/face.py
+++ b/pytouhou/game/face.py
@@ -15,7 +15,7 @@
 
 from pytouhou.game.element import Element
 from pytouhou.game.sprite import Sprite
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 
 class Face(Element):
--- a/pytouhou/game/game.pyx
+++ b/pytouhou/game/game.pyx
@@ -12,7 +12,7 @@
 ## GNU General Public License for more details.
 ##
 
-from pytouhou.vm.msgrunner import MSGRunner
+from pytouhou.vm import MSGRunner
 
 from pytouhou.game.element cimport Element
 from pytouhou.game.bullet cimport Bullet, LAUNCHED, CANCELLED
--- a/pytouhou/game/laser.pyx
+++ b/pytouhou/game/laser.pyx
@@ -15,7 +15,7 @@
 from libc.math cimport cos, sin, M_PI as pi
 
 from pytouhou.game.game cimport Game
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 
 cdef class LaserLaunchAnim(Element):
--- a/pytouhou/game/orb.py
+++ b/pytouhou/game/orb.py
@@ -12,7 +12,7 @@
 ## GNU General Public License for more details.
 ##
 
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 
 class Orb(Element):
--- a/pytouhou/game/player.pyx
+++ b/pytouhou/game/player.pyx
@@ -15,7 +15,7 @@
 from libc.math cimport M_PI as pi
 
 from pytouhou.game.sprite cimport Sprite
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 from pytouhou.game.bullettype cimport BulletType
 from pytouhou.game.bullet cimport Bullet
 from pytouhou.game.lasertype cimport LaserType
--- a/pytouhou/game/text.py
+++ b/pytouhou/game/text.py
@@ -12,7 +12,7 @@
 ## GNU General Public License for more details.
 ##
 
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 
 class Glyph(Element):
--- a/pytouhou/games/eosd.py
+++ b/pytouhou/games/eosd.py
@@ -24,7 +24,7 @@ from pytouhou.game.effect import Effect
 from pytouhou.game.text import Text, Counter, Gauge, NativeText
 from pytouhou.game.background import Background
 
-from pytouhou.vm.eclrunner import ECLMainRunner
+from pytouhou.vm import ECLMainRunner
 
 
 class EoSDCommon(object):
--- a/pytouhou/ui/anmrenderer.pyx
+++ b/pytouhou/ui/anmrenderer.pyx
@@ -16,7 +16,7 @@ from pytouhou.lib.opengl cimport \
          (glClearColor, glClear, GL_COLOR_BUFFER_BIT)
 
 from pytouhou.game.sprite import Sprite
-from pytouhou.vm.anmrunner import ANMRunner
+from pytouhou.vm import ANMRunner
 
 from pytouhou.utils.helpers import get_logger
 from pytouhou.utils.maths cimport perspective, setup_camera
--- a/pytouhou/vm/__init__.py
+++ b/pytouhou/vm/__init__.py
@@ -0,0 +1,3 @@
+from anmrunner import ANMRunner
+from msgrunner import MSGRunner
+from eclrunner import ECLMainRunner
--- a/scripts/pytouhou
+++ b/scripts/pytouhou
@@ -65,16 +65,10 @@ args = parser.parse_args()
 import sys
 import logging
 
-if args.backend == 'opengl':
-    try:
-        from pytouhou.ui.opengl.gamerenderer import GameRenderer
-        opengl = True
-    except ImportError:
-        args.backend = 'sdl'
 
-if args.backend == 'sdl':
-    from pytouhou.ui.sdl.gamerenderer import GameRenderer
-    opengl = False
+if args.game == 'EoSD':
+    from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
+
 
 from pytouhou.lib.sdl import SDL, show_simple_message_box
 from pytouhou.ui.window import Window
@@ -88,8 +82,16 @@ from pytouhou.formats.hint import Hint
 from pytouhou.network import Network
 
 
-if args.game == 'EoSD':
-    from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
+if args.backend == 'opengl':
+    try:
+        from pytouhou.ui.opengl.gamerenderer import GameRenderer
+        opengl = True
+    except ImportError:
+        args.backend = 'sdl'
+
+if args.backend == 'sdl':
+    from pytouhou.ui.sdl.gamerenderer import GameRenderer
+    opengl = False
 
 
 class GameBossRush(Game):