comparison pytouhou/game/sprite.py @ 85:3804f07d3b0e

Various optimizations
author Thibaut Girka <thib@sitedethib.com>
date Sat, 03 Sep 2011 23:34:12 +0200
parents f5f9b5eb69a3
children 630e9045e851
comparison
equal deleted inserted replaced
84:1a0c78e5a941 85:3804f07d3b0e
144 d = vertmat.data 144 d = vertmat.data
145 assert (d[3][0], d[3][1], d[3][2], d[3][3]) == (1., 1., 1., 1.) 145 assert (d[3][0], d[3][1], d[3][2], d[3][3]) == (1., 1., 1., 1.)
146 self._colors = [(self.color[0], self.color[1], self.color[2], self.alpha)] * 4 146 self._colors = [(self.color[0], self.color[1], self.color[2], self.alpha)] * 4
147 self._uvs, self._vertices = uvs, zip(d[0], d[1], d[2]) 147 self._uvs, self._vertices = uvs, zip(d[0], d[1], d[2])
148 148
149 self._changed = any((self.scale_interpolator, self.fade_interpolator, self.offset_interpolator))
150
149 151
150 def update(self): 152 def update(self):
151 if self.rotations_speed_3d != (0., 0., 0.) or self.scale_speed != (0., 0.): 153 if self.rotations_speed_3d != (0., 0., 0.) or self.scale_speed != (0., 0.):
152 ax, ay, az = self.rotations_3d 154 ax, ay, az = self.rotations_3d
153 sax, say, saz = self.rotations_speed_3d 155 sax, say, saz = self.rotations_speed_3d