Mercurial > touhou
comparison pytouhou/ui/texture.pyx @ 429:40d5f3083ebc
Implement PCB’s ANM2 format and vm.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 03 Aug 2013 15:48:57 +0200 |
parents | 5d7bb2fd74f7 |
children | d56536ef28e8 |
comparison
equal
deleted
inserted
replaced
428:f41a26971a19 | 429:40d5f3083ebc |
---|---|
36 self.loader = loader | 36 self.loader = loader |
37 | 37 |
38 | 38 |
39 def load(self, anm_list): | 39 def load(self, anm_list): |
40 for anm in anm_list: | 40 for anm in anm_list: |
41 if not hasattr(anm, 'texture'): | 41 for entry in anm: |
42 texture = decode_png(self.loader, anm.first_name, anm.secondary_name) | 42 if not hasattr(entry, 'texture'): |
43 anm.texture = load_texture(texture) | 43 texture = decode_png(self.loader, entry.first_name, entry.secondary_name) |
44 entry.texture = load_texture(texture) | |
45 elif not isinstance(entry.texture, TextureId): | |
46 entry.texture = load_texture(entry.texture) | |
44 | 47 |
45 | 48 |
46 cdef decode_png(loader, first_name, secondary_name): | 49 cdef decode_png(loader, first_name, secondary_name): |
47 image_file = load_png(loader.get_file(os.path.basename(first_name))) | 50 image_file = load_png(loader.get_file(os.path.basename(first_name))) |
48 width, height = image_file.width, image_file.height | 51 width, height = image_file.width, image_file.height |