comparison pytouhou/ui/gamerunner.py @ 323:2fcdb8966957

Display lives and bombs.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 13 Jun 2012 22:53:57 +0200
parents 61adb5453e46
children 16ed1ab1e14b
comparison
equal deleted inserted replaced
322:4e8192aadcaa 323:2fcdb8966957
176 glLoadIdentity() 176 glLoadIdentity()
177 gluOrtho2D(0., float(self.width), float(self.height), 0.) 177 gluOrtho2D(0., float(self.width), float(self.height), 0.)
178 glViewport(0, 0, self.width, self.height) 178 glViewport(0, 0, self.width, self.height)
179 179
180 items = [item for item in interface.items if item.anmrunner and item.anmrunner.running] 180 items = [item for item in interface.items if item.anmrunner and item.anmrunner.running]
181 labels = interface.labels 181 labels = interface.labels.values()
182
182 if items: 183 if items:
183 # Force rendering of labels 184 # Redraw all the interface
184 self.render_elements(items) 185 self.render_elements(items)
185 self.render_elements(chain(*(label.objects()
186 for label in labels.itervalues())))
187 else: 186 else:
188 self.render_elements(chain(*(label.objects() 187 # Redraw only changed labels
189 for label in labels.itervalues() 188 labels = [label for label in labels if label.changed]
190 if label.changed))) 189
191 for label in interface.labels.itervalues(): 190 self.render_elements(labels)
191 self.render_elements(chain(*(label.objects() for label in labels)))
192 for label in labels:
192 label.changed = False 193 label.changed = False
193 194