comparison pytouhou/game/laser.pyx @ 491:2276229282fd

Fix gcc’s warnings with -Wall -Wextra.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 04 Oct 2013 14:32:28 +0200
parents 8038f1957b71
children b32cef75df59
comparison
equal deleted inserted replaced
490:1b532e7dd521 491:2276229282fd
164 self.anmrunner = None 164 self.anmrunner = None
165 165
166 self.end_offset += self.speed 166 self.end_offset += self.speed
167 167
168 length = <double>min(self.end_offset - self.start_offset, self.max_length) # TODO 168 length = <double>min(self.end_offset - self.start_offset, self.max_length) # TODO
169 width = 0.
169 if self.state == STARTING: 170 if self.state == STARTING:
170 if self.frame == self.start_duration: 171 if self.frame == self.start_duration:
171 self.frame = 0 172 self.frame = 0
172 self.state = STARTED 173 self.state = STARTED
173 else: 174 else:
174 width = self.width * float(self.frame) / self.start_duration #TODO 175 width = self.width * float(self.frame) / self.start_duration #TODO
175 if self.state == STARTED: 176 elif self.state == STARTED:
176 width = self.width #TODO 177 width = self.width #TODO
177 if self.frame == self.duration: 178 if self.frame == self.duration:
178 self.frame = 0 179 self.frame = 0
179 self.state = STOPPING 180 self.state = STOPPING
180 if self.state == STOPPING: 181 elif self.state == STOPPING:
181 if self.frame == self.stop_duration: 182 if self.frame == self.stop_duration:
182 width = 0.
183 self.removed = True 183 self.removed = True
184 else: 184 else:
185 width = self.width * (1. - float(self.frame) / self.stop_duration) #TODO 185 width = self.width * (1. - float(self.frame) / self.stop_duration) #TODO
186 186
187 offset = self.end_offset - length / 2. 187 offset = self.end_offset - length / 2.