diff pytouhou/ui/sdl/texture.pyx @ 525:43ecf0f98f4d

Precalculate the inverse of the texture size at ANM load, to not recalculate at every sprite change.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 18 Dec 2013 18:15:45 +0100
parents b39ad30c6620
children b895ed2de71f
line wrap: on
line diff
--- a/pytouhou/ui/sdl/texture.pyx
+++ b/pytouhou/ui/sdl/texture.pyx
@@ -26,7 +26,7 @@ cdef class TextureManager:
     cdef void load(self, dict anms):
         for anm in sorted(anms.values(), key=is_ascii):
             for entry in anm:
-                if not hasattr(entry, 'texture'):
+                if entry.texture is None:
                     texture = decode_png(self.loader, entry.first_name, entry.secondary_name)
                 #elif not isinstance(entry.texture, self.texture_class):
                 #    texture = entry.texture