changeset 569:b21922a03830

Don’t render spellcard background when --no-background is passed.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 09 Jul 2014 16:46:55 +0200
parents e7a4731a278b
children f0252cf111d8
files pytouhou/ui/opengl/gamerenderer.pyx
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/ui/opengl/gamerenderer.pyx	Tue Jul 01 23:18:15 2014 +0200
+++ b/pytouhou/ui/opengl/gamerenderer.pyx	Wed Jul 09 16:46:55 2014 +0200
@@ -116,7 +116,9 @@
             glMatrixMode(GL_PROJECTION)
             glLoadIdentity()
 
-        if game is not None and game.spellcard_effect is not None:
+        if self.background_renderer is None:
+            glClear(GL_COLOR_BUFFER_BIT)
+        elif game is not None and game.spellcard_effect is not None:
             if is_legacy:
                 glMatrixMode(GL_MODELVIEW)
                 glLoadMatrixf(<GLfloat*>self.game_mvp)
@@ -126,7 +128,7 @@
                 self.game_shader.uniform_matrix('mvp', self.game_mvp)
 
             self.render_elements([game.spellcard_effect])
-        elif self.background_renderer is not None:
+        else:
             back = self.background
             x, y, z = back.position_interpolator.values
             dx, dy, dz = back.position2_interpolator.values
@@ -175,8 +177,6 @@
 
             free(mvp)
             self.background_renderer.render_background()
-        else:
-            glClear(GL_COLOR_BUFFER_BIT)
 
         if game is not None:
             if is_legacy: