From 41567d8fc840bc0d97466cab323cca488f0a0a04 Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Tue, 4 Mar 2014 17:14:13 +0000
Subject: [PATCH] Toggle cloud drawing on/off

---
 src/Scenery/scenery.cxx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx
index 09e0b502e..c05d6eeff 100644
--- a/src/Scenery/scenery.cxx
+++ b/src/Scenery/scenery.cxx
@@ -47,6 +47,8 @@
 #include <simgear/scene/util/OsgMath.hxx>
 #include <simgear/scene/util/SGSceneUserData.hxx>
 #include <simgear/scene/model/CheckSceneryVisitor.hxx>
+#include <simgear/scene/sky/sky.hxx>
+
 #include <simgear/bvh/BVHNode.hxx>
 #include <simgear/bvh/BVHLineSegmentVisitor.hxx>
 #include <simgear/structure/commands.hxx>
@@ -262,8 +264,8 @@ public:
     } else if (name == "aircraft") {
       _scenery->scene_graph->setChildValue(_scenery->aircraft_branch, b);
     } else if (name == "clouds") {
-      // clouds live elsewhere in the scene, bounce this to the correct
-      // place in FGRenderer
+      // clouds live elsewhere in the scene, but we handle them here
+      globals->get_renderer()->getSky()->set_clouds_enabled(b);
     } else if (name == "draw-otw") {
       // legacy setting but let's keep it working
       fgGetNode("/sim/rendering/draw-mask")->setBoolValue("terrain", b);