diff 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
line wrap: on
line diff
--- a/pytouhou/ui/texture.pyx
+++ b/pytouhou/ui/texture.pyx
@@ -38,9 +38,12 @@ class TextureManager(object):
 
     def load(self, anm_list):
         for anm in anm_list:
-            if not hasattr(anm, 'texture'):
-                texture = decode_png(self.loader, anm.first_name, anm.secondary_name)
-                anm.texture = load_texture(texture)
+            for entry in anm:
+                if not hasattr(entry, 'texture'):
+                    texture = decode_png(self.loader, entry.first_name, entry.secondary_name)
+                    entry.texture = load_texture(texture)
+                elif not isinstance(entry.texture, TextureId):
+                    entry.texture = load_texture(entry.texture)
 
 
 cdef decode_png(loader, first_name, secondary_name):