comparison 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
comparison
equal deleted inserted replaced
524:7f016dfbdfb1 525:43ecf0f98f4d
24 24
25 25
26 cdef void load(self, dict anms): 26 cdef void load(self, dict anms):
27 for anm in sorted(anms.values(), key=is_ascii): 27 for anm in sorted(anms.values(), key=is_ascii):
28 for entry in anm: 28 for entry in anm:
29 if not hasattr(entry, 'texture'): 29 if entry.texture is None:
30 texture = decode_png(self.loader, entry.first_name, entry.secondary_name) 30 texture = decode_png(self.loader, entry.first_name, entry.secondary_name)
31 #elif not isinstance(entry.texture, self.texture_class): 31 #elif not isinstance(entry.texture, self.texture_class):
32 # texture = entry.texture 32 # texture = entry.texture
33 entry.texture = self.load_texture(texture) 33 entry.texture = self.load_texture(texture)
34 anms.clear() 34 anms.clear()