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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/background.py	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/bullet.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/effect.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/enemy.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/face.py	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/game.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/laser.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/orb.py	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/player.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/game/text.py	Fri Nov 08 18:47:00 2013 +0100
@@ -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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/games/eosd.py	Fri Nov 08 18:47:00 2013 +0100
@@ -24,7 +24,7 @@
 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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/ui/anmrenderer.pyx	Fri Nov 08 18:47:00 2013 +0100
@@ -16,7 +16,7 @@
          (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	Wed May 21 20:52:42 2014 +0200
+++ b/pytouhou/vm/__init__.py	Fri Nov 08 18:47:00 2013 +0100
@@ -0,0 +1,3 @@
+from anmrunner import ANMRunner
+from msgrunner import MSGRunner
+from eclrunner import ECLMainRunner
--- a/scripts/pytouhou	Wed May 21 20:52:42 2014 +0200
+++ b/scripts/pytouhou	Fri Nov 08 18:47:00 2013 +0100
@@ -65,16 +65,10 @@
 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.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):