Mercurial > touhou
comparison anmviewer @ 405:402e96a0baeb
Make the anmviewer use the programmable pipeline too.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 24 Mar 2013 10:31:23 +0100 |
parents | dd2bd7283bec |
children | b0b8825296d0 |
comparison
equal
deleted
inserted
replaced
404:6c0cb3eee33e | 405:402e96a0baeb |
---|---|
23 from pytouhou.game.sprite import Sprite | 23 from pytouhou.game.sprite import Sprite |
24 from pytouhou.vm.anmrunner import ANMRunner | 24 from pytouhou.vm.anmrunner import ANMRunner |
25 from pytouhou.ui.anmrenderer import ANMRenderer | 25 from pytouhou.ui.anmrenderer import ANMRenderer |
26 | 26 |
27 | 27 |
28 def main(path, data, name, script, sprites): | 28 def main(path, data, name, script, sprites, fixed_pipeline): |
29 resource_loader = Loader() | 29 resource_loader = Loader() |
30 resource_loader.scan_archives(os.path.join(path, name) for name in data) | 30 resource_loader.scan_archives(os.path.join(path, name) for name in data) |
31 | 31 |
32 # Get out animation | 32 # Get out animation |
33 anm_wrapper = resource_loader.get_anm_wrapper(name.split(',')) | 33 anm_wrapper = resource_loader.get_anm_wrapper(name.split(',')) |
34 anm = ANMRenderer(resource_loader, anm_wrapper, script, sprites) | 34 anm = ANMRenderer(resource_loader, anm_wrapper, script, sprites, fixed_pipeline) |
35 anm.start() | 35 anm.start() |
36 | 36 |
37 | 37 |
38 parser = argparse.ArgumentParser(description='Viewer of ANM files, archives containing animations used in Touhou games.') | 38 parser = argparse.ArgumentParser(description='Viewer of ANM files, archives containing animations used in Touhou games.') |
39 | 39 |
40 parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files') | 40 parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files') |
41 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.') | 41 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.') |
42 parser.add_argument('--anm', metavar='ANM', required=True, help='Select an ANM') | 42 parser.add_argument('--anm', metavar='ANM', required=True, help='Select an ANM') |
43 parser.add_argument('--script', metavar='SCRIPT', type=int, default=0, help='First script to play') | 43 parser.add_argument('--script', metavar='SCRIPT', type=int, default=0, help='First script to play') |
44 parser.add_argument('--sprites', action='store_true', default=False, help='Display sprites instead of scripts.') | 44 parser.add_argument('--sprites', action='store_true', default=False, help='Display sprites instead of scripts.') |
45 parser.add_argument('--fixed-pipeline', action='store_true', help='Use the fixed pipeline instead of the new programmable one.') | |
45 | 46 |
46 args = parser.parse_args() | 47 args = parser.parse_args() |
47 | 48 |
48 main(args.path, tuple(args.data), args.anm, args.script, args.sprites) | 49 main(args.path, tuple(args.data), args.anm, args.script, args.sprites, |
50 args.fixed_pipeline) |