From 7e25a79968f446d75d1fd18a2213b4810bae612e Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 2 Nov 2013 12:57:10 -0400 Subject: [PATCH] Allowed control of displaying cloudmaps and atmospheres. --- punyverse/game.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/punyverse/game.py b/punyverse/game.py index e98fd85..01a5ea5 100644 --- a/punyverse/game.py +++ b/punyverse/game.py @@ -70,6 +70,8 @@ class Applet(pyglet.window.Window): self.running = True self.moving = True self.info_precise = False + self.atmosphere = True + self.cloud = not texture.badcard self.tick = self.world.tick_length self.ticks = [20, 40, 60, # Second range @@ -123,6 +125,8 @@ class Applet(pyglet.window.Window): key.D: attribute_toggler(self, 'debug'), key.O: attribute_toggler(self, 'orbit'), key.P: attribute_toggler(self, 'info_precise'), + key.C: attribute_toggler(self, 'cloud'), + key.X: attribute_toggler(self, 'atmosphere'), key.ENTER: attribute_toggler(self, self.running), key.INSERT: increment_tick, key.DELETE: decrement_tick, @@ -310,7 +314,7 @@ class Applet(pyglet.window.Window): glPopAttrib() glPopMatrix() - if hasattr(entity, 'atmosphere') and entity.atmosphere: + if self.atmosphere and hasattr(entity, 'atmosphere') and entity.atmosphere: glPushMatrix() x0, y0, z0 = entity.location dx, dy, dz = x - x0, y - y0, z - z0 @@ -325,7 +329,7 @@ class Applet(pyglet.window.Window): glCallList(entity.atmosphere) glPopMatrix() - if not texture.badcard and hasattr(entity, "cloudmap") and entity.cloudmap: + if self.cloud and hasattr(entity, "cloudmap") and entity.cloudmap: glPushMatrix() glEnable(GL_ALPHA_TEST) glTranslatef(*entity.location)