comparison pytouhou/game/sprite.py @ 75:b3bd421bb895

Handle a few more ECL instructions
author Thibaut Girka <thib@sitedethib.com>
date Tue, 30 Aug 2011 16:30:40 +0200
parents 6a08f44fa01b
children f5f9b5eb69a3
comparison
equal deleted inserted replaced
74:adac26098408 75:b3bd421bb895
86 self.offset_interpolator = Interpolator(self.dest_offset, formula) 86 self.offset_interpolator = Interpolator(self.dest_offset, formula)
87 self.offset_interpolator.set_interpolation_start(self.frame, self.dest_offset) 87 self.offset_interpolator.set_interpolation_start(self.frame, self.dest_offset)
88 self.offset_interpolator.set_interpolation_end(self.frame + duration - 1, (x, y, z)) 88 self.offset_interpolator.set_interpolation_end(self.frame + duration - 1, (x, y, z))
89 89
90 90
91 def update_vertices_uvs_colors(self, override_width=0, override_height=0): 91 def update_vertices_uvs_colors(self, override_width=0, override_height=0, angle_base=0.):
92 if self.fade_interpolator: 92 if self.fade_interpolator:
93 self.fade_interpolator.update(self.frame) 93 self.fade_interpolator.update(self.frame)
94 self.alpha = int(self.fade_interpolator.values[0]) 94 self.alpha = int(self.fade_interpolator.values[0])
95 95
96 if self.scale_interpolator: 96 if self.scale_interpolator:
113 height = override_height or (th * sy) 113 height = override_height or (th * sy)
114 114
115 vertmat.scale2d(width, height) 115 vertmat.scale2d(width, height)
116 if self.mirrored: 116 if self.mirrored:
117 vertmat.flip() 117 vertmat.flip()
118 if self.rotations_3d != (0., 0., 0.): 118
119 rx, ry, rz = self.rotations_3d 119 rx, ry, rz = self.rotations_3d
120 rz += angle_base
121
122 if (rx, ry, rz) != (0., 0., 0.):
120 if rx: 123 if rx:
121 vertmat.rotate_x(-rx) 124 vertmat.rotate_x(-rx)
122 if ry: 125 if ry:
123 vertmat.rotate_y(ry) 126 vertmat.rotate_y(ry)
124 if rz: 127 if rz: