comparison stageviewer.py @ 21:bf225780973f

Small refactoring, and Rumia \o/
author Thibaut Girka <thib@sitedethib.com>
date Thu, 11 Aug 2011 12:39:12 +0200
parents 66ce9bb440ac
children a10e3f44a883
comparison
equal deleted inserted replaced
20:6ebf9539c077 21:bf225780973f
11 import pygame 11 import pygame
12 12
13 from pytouhou.formats.pbg3 import PBG3 13 from pytouhou.formats.pbg3 import PBG3
14 from pytouhou.formats.std import Stage 14 from pytouhou.formats.std import Stage
15 from pytouhou.formats.anm0 import Animations 15 from pytouhou.formats.anm0 import Animations
16 from pytouhou.game.sprite import AnmWrapper
16 from pytouhou.game.background import Background 17 from pytouhou.game.background import Background
17 from pytouhou.opengl.texture import TextureManager 18 from pytouhou.opengl.texture import TextureManager
18 19
19 import OpenGL 20 import OpenGL
20 OpenGL.FORWARD_COMPATIBLE_ONLY = True 21 OpenGL.FORWARD_COMPATIBLE_ONLY = True
47 archive = PBG3.read(file) 48 archive = PBG3.read(file)
48 texture_manager = TextureManager(archive) 49 texture_manager = TextureManager(archive)
49 50
50 stage = Stage.read(BytesIO(archive.extract('stage%d.std' % stage_num)), stage_num) 51 stage = Stage.read(BytesIO(archive.extract('stage%d.std' % stage_num)), stage_num)
51 background_anim = Animations.read(BytesIO(archive.extract('stg%dbg.anm' % stage_num))) 52 background_anim = Animations.read(BytesIO(archive.extract('stg%dbg.anm' % stage_num)))
52 background = Background(stage, background_anim) 53 background = Background(stage, AnmWrapper((background_anim,)))
53 54
54 print(background.stage.name) 55 print(background.stage.name)
55 56
56 frame = 0 57 frame = 0
57 58