Mercurial > touhou
diff pytouhou/ui/opengl/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 | dec43940f092 |
children | 1be60813f7cb |
line wrap: on
line diff
--- a/pytouhou/ui/opengl/texture.pyx +++ b/pytouhou/ui/opengl/texture.pyx @@ -39,7 +39,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