diff pytouhou/game/enemy.pyx @ 527:db28538cd399

Use Sprite C arrays instead of their tuple representation where it makes sense.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 18 Dec 2013 18:19:08 +0100
parents 292fea5c584e
children 53fa73932e9a
line wrap: on
line diff
--- a/pytouhou/game/enemy.pyx
+++ b/pytouhou/game/enemy.pyx
@@ -310,14 +310,12 @@ cdef class Enemy(Element):
 
 
     cdef bint is_visible(self, long screen_width, long screen_height):
-        cdef double tw, th
-
         if self.sprite is not None:
             if self.sprite.corner_relative_placement:
                 raise Exception #TODO
-            _, _, tw, th = self.sprite.texcoords
+            tw, th = self.sprite._texcoords[2], self.sprite._texcoords[3]
         else:
-            tw, th = 0, 0
+            tw, th = 0., 0.
 
         x, y = self.x, self.y
         max_x = tw / 2