diff pytouhou/ui/gamerenderer.pyx @ 271:80e73b8245a4

Fix visibility handling
author Thibaut Girka <thib@sitedethib.com>
date Tue, 24 Jan 2012 00:56:31 +0100
parents 6bd565019f9a
children f037bca24f2d
line wrap: on
line diff
--- a/pytouhou/ui/gamerenderer.pyx
+++ b/pytouhou/ui/gamerenderer.pyx
@@ -80,8 +80,8 @@ cdef class GameRenderer(Renderer):
             self.setup_camera(0, 0, 1)
 
             glDisable(GL_FOG)
-            self.render_elements(chain(*(enemy.objects() for enemy in game.enemies)))
-            self.render_elements(game.enemies)
+            self.render_elements(chain(*(enemy.objects() for enemy in game.enemies if enemy._visible)))
+            self.render_elements(enemy for enemy in game.enemies if enemy._visible)
             self.render_elements(game.effects)
             self.render_elements(chain(game.players_bullets,
                                        game.players,