Mercurial > touhou
comparison pytouhou/game/sprite.py @ 92:85f3b8ba3f24
Minor refactoring and optimizations. Drop stageviewer.
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Sun, 04 Sep 2011 17:33:40 +0200 |
parents | 630e9045e851 |
children | ca571697ec83 |
comparison
equal
deleted
inserted
replaced
91:f7525fa66bb0 | 92:85f3b8ba3f24 |
---|---|
158 self._uvs, self._vertices = uvs, zip(d[0], d[1], d[2]) | 158 self._uvs, self._vertices = uvs, zip(d[0], d[1], d[2]) |
159 self._changed = False | 159 self._changed = False |
160 | 160 |
161 | 161 |
162 def update(self, override_width=0, override_height=0, angle_base=0., force_rotation=False): | 162 def update(self, override_width=0, override_height=0, angle_base=0., force_rotation=False): |
163 self._changed = (self._changed | 163 if (override_width != self.width_override |
164 or override_width != self.width_override | 164 or override_height != self.height_override |
165 or override_height != self.height_override | 165 or self.angle != angle_base |
166 or self.angle != angle_base | 166 or self.force_rotation != force_rotation |
167 or self.force_rotation != force_rotation | 167 or self.scale_interpolator |
168 or self.scale_interpolator | 168 or self.fade_interpolator |
169 or self.fade_interpolator | 169 or self.offset_interpolator): |
170 or self.offset_interpolator) | |
171 | 170 |
172 self.width_override = override_width | 171 self._changed = True |
173 self.height_override = override_height | 172 self.width_override = override_width |
174 self.angle = angle_base | 173 self.height_override = override_height |
175 self.force_rotation = force_rotation | 174 self.angle = angle_base |
175 self.force_rotation = force_rotation | |
176 | 176 |
177 if self.rotations_speed_3d != (0., 0., 0.) or self.scale_speed != (0., 0.): | 177 if self.rotations_speed_3d != (0., 0., 0.) or self.scale_speed != (0., 0.): |
178 ax, ay, az = self.rotations_3d | 178 ax, ay, az = self.rotations_3d |
179 sax, say, saz = self.rotations_speed_3d | 179 sax, say, saz = self.rotations_speed_3d |
180 self.rotations_3d = ax + sax, ay + say, az + saz | 180 self.rotations_3d = ax + sax, ay + say, az + saz |