comparison pytouhou/ui/sprite.pyx @ 240:02de1563fa18

Fix ANM wait, translation/rotation order, and partially implement ANM0 instruction 24
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jan 2012 23:51:01 +0100
parents 741860192b56
children f037bca24f2d
comparison
equal deleted inserted replaced
239:901489c21d19 240:02de1563fa18
42 if sprite.automatic_orientation: 42 if sprite.automatic_orientation:
43 rz += pi/2. - sprite.angle 43 rz += pi/2. - sprite.angle
44 elif sprite.force_rotation: 44 elif sprite.force_rotation:
45 rz += sprite.angle 45 rz += sprite.angle
46 46
47 if sprite.allow_dest_offset:
48 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
49 if (rx, ry, rz) != (0., 0., 0.): 47 if (rx, ry, rz) != (0., 0., 0.):
50 if rx: 48 if rx:
51 vertmat.rotate_x(-rx) 49 vertmat.rotate_x(-rx)
52 if ry: 50 if ry:
53 vertmat.rotate_y(ry) 51 vertmat.rotate_y(ry)
54 if rz: 52 if rz:
55 vertmat.rotate_z(-rz) #TODO: minus, really? 53 vertmat.rotate_z(-rz) #TODO: minus, really?
54 if sprite.allow_dest_offset:
55 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
56 if sprite.corner_relative_placement: # Reposition 56 if sprite.corner_relative_placement: # Reposition
57 vertmat.translate(width / 2., height / 2., 0.) 57 vertmat.translate(width / 2., height / 2., 0.)
58 58
59 x_1 = 1. / sprite.anm.size[0] 59 x_1 = 1. / sprite.anm.size[0]
60 y_1 = 1. / sprite.anm.size[1] 60 y_1 = 1. / sprite.anm.size[1]