comparison pytouhou/ui/sprite.pyx @ 236:741860192b56

Implement ANM0 interrupts “Instruction” 22 is used as a label for interrupts. If the normal animation is interrupted, it goes straight to the matched instruction. Interrupt -1 matches all interrupts.
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jan 2012 19:47:34 +0100
parents ab6e6909ce04
children 02de1563fa18
comparison
equal deleted inserted replaced
235:e59bd7979ddc 236:741860192b56
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])
47 if (rx, ry, rz) != (0., 0., 0.): 49 if (rx, ry, rz) != (0., 0., 0.):
48 if rx: 50 if rx:
49 vertmat.rotate_x(-rx) 51 vertmat.rotate_x(-rx)
50 if ry: 52 if ry:
51 vertmat.rotate_y(ry) 53 vertmat.rotate_y(ry)
52 if rz: 54 if rz:
53 vertmat.rotate_z(-rz) #TODO: minus, really? 55 vertmat.rotate_z(-rz) #TODO: minus, really?
54 if sprite.corner_relative_placement: # Reposition 56 if sprite.corner_relative_placement: # Reposition
55 vertmat.translate(width / 2., height / 2., 0.) 57 vertmat.translate(width / 2., height / 2., 0.)
56 if sprite.allow_dest_offset:
57 vertmat.translate(sprite.dest_offset[0], sprite.dest_offset[1], sprite.dest_offset[2])
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]
61 tox, toy = sprite.texoffsets 61 tox, toy = sprite.texoffsets
62 uvs = [tx * x_1 + tox, 1. - (ty * y_1 + toy), 62 uvs = [tx * x_1 + tox, 1. - (ty * y_1 + toy),