comparison anmviewer @ 425:1104dc2553ee

Make the anmviewer use the new architecture.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 16 Jul 2013 21:07:15 +0200
parents b0b8825296d0
children c9433188ffdb
comparison
equal deleted inserted replaced
424:f4d76d3d6f2a 425:1104dc2553ee
17 import os 17 import os
18 18
19 import pyximport 19 import pyximport
20 pyximport.install() 20 pyximport.install()
21 21
22 from pytouhou.ui.window import Window
22 from pytouhou.resource.loader import Loader 23 from pytouhou.resource.loader import Loader
23 from pytouhou.game.sprite import Sprite
24 from pytouhou.vm.anmrunner import ANMRunner
25 from pytouhou.ui.anmrenderer import ANMRenderer 24 from pytouhou.ui.anmrenderer import ANMRenderer
26 25
27 26
28 def main(path, data, name, script, sprites, fixed_pipeline): 27 def main(path, data, name, script, sprites, fixed_pipeline):
29 resource_loader = Loader() 28 resource_loader = Loader()
30 resource_loader.scan_archives(os.path.join(path, name) for name in data) 29 resource_loader.scan_archives(os.path.join(path, name) for name in data)
31 30
31 window = Window((384, 448), fixed_pipeline=fixed_pipeline, sound=False)
32
32 # Get out animation 33 # Get out animation
33 anm_wrapper = resource_loader.get_anm_wrapper(name.split(',')) 34 anm_wrapper = resource_loader.get_anm_wrapper(name.split(','))
34 anm = ANMRenderer(resource_loader, anm_wrapper, script, sprites, fixed_pipeline) 35 anm = ANMRenderer(window, resource_loader, anm_wrapper, script, sprites)
35 anm.start() 36 window.set_runner(anm)
37 window.run()
36 38
37 39
38 parser = argparse.ArgumentParser(description='Viewer of ANM files, archives containing animations used in Touhou games.') 40 parser = argparse.ArgumentParser(description='Viewer of ANM files, archives containing animations used in Touhou games.')
39 41
40 parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files') 42 parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files')