Mercurial > touhou
comparison pytouhou/game/background.py @ 430:c9433188ffdb
Remove AnmWrapper, since ANMs are lists of entries now.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 03 Aug 2013 15:49:04 +0200 |
parents | bdcf2077e368 |
children | 1222341ea22c |
comparison
equal
deleted
inserted
replaced
429:40d5f3083ebc | 430:c9433188ffdb |
---|---|
17 from pytouhou.vm.anmrunner import ANMRunner | 17 from pytouhou.vm.anmrunner import ANMRunner |
18 from pytouhou.game.sprite import Sprite | 18 from pytouhou.game.sprite import Sprite |
19 | 19 |
20 | 20 |
21 class Background(object): | 21 class Background(object): |
22 def __init__(self, stage, anm_wrapper): | 22 def __init__(self, stage, anm): |
23 self.stage = stage | 23 self.stage = stage |
24 self.anm_wrapper = anm_wrapper | 24 self.anm = anm |
25 self.last_frame = -1 | 25 self.last_frame = -1 |
26 | 26 |
27 self.models = [] | 27 self.models = [] |
28 self.object_instances = [] | 28 self.object_instances = [] |
29 self.anm_runners = [] | 29 self.anm_runners = [] |
51 self.models = [] | 51 self.models = [] |
52 for obj in self.stage.models: | 52 for obj in self.stage.models: |
53 quads = [] | 53 quads = [] |
54 for script_index, ox, oy, oz, width_override, height_override in obj.quads: | 54 for script_index, ox, oy, oz, width_override, height_override in obj.quads: |
55 sprite = Sprite(width_override, height_override) | 55 sprite = Sprite(width_override, height_override) |
56 anm_runner = ANMRunner(self.anm_wrapper, script_index, sprite) | 56 anm_runner = ANMRunner(self.anm, script_index, sprite) |
57 anm_runner.run_frame() | 57 anm_runner.run_frame() |
58 quads.append((ox, oy, oz, width_override, height_override, sprite)) | 58 quads.append((ox, oy, oz, width_override, height_override, sprite)) |
59 self.anm_runners.append(anm_runner) | 59 self.anm_runners.append(anm_runner) |
60 self.models.append(quads) | 60 self.models.append(quads) |
61 | 61 |