diff pytouhou/ui/sprite.pyx @ 279:3539520fff93

Fix sprite rotation/translation. ANM translations are done *after* rotation, lasers are handled differently.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 08 Feb 2012 18:43:39 +0100
parents f037bca24f2d
children f3099ebf4f61
line wrap: on
line diff
--- a/pytouhou/ui/sprite.pyx
+++ b/pytouhou/ui/sprite.pyx
@@ -38,8 +38,6 @@ cpdef object get_sprite_rendering_data(o
     if sprite.mirrored:
         vertmat.flip()
 
-    if sprite.allow_dest_offset:
-        vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
     rx, ry, rz = sprite.rotations_3d
     if sprite.automatic_orientation:
         rz += pi/2. - sprite.angle
@@ -53,6 +51,8 @@ cpdef object get_sprite_rendering_data(o
             vertmat.rotate_y(ry)
         if rz:
             vertmat.rotate_z(-rz) #TODO: minus, really?
+    if sprite.allow_dest_offset:
+        vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
     if sprite.corner_relative_placement: # Reposition
         vertmat.translate(width / 2., height / 2., 0.)