]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_commands.cxx
Remove the last traces of metakit (hopefully) :-)
[flightgear.git] / src / Main / fg_commands.cxx
index d540faf4050ef75cffae49ea0e52612392a8d639..7bab5f6c8afe7eba1e49a3b7b8fa0d3d74b7771a 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "fg_init.hxx"
 #include "fg_commands.hxx"
+#include "fg_props.hxx"
 
 SG_USING_STD(string);
 SG_USING_STD(ifstream);
@@ -845,7 +846,29 @@ do_replay (const SGPropertyNode * arg)
 
 
 
-\f
+static bool
+do_decrease_visibility (const SGPropertyNode * arg)
+{
+    double new_value = fgGetDouble("/environment/visibility-m") * 0.9;
+    fgSetDouble("/environment/visibility-m", new_value);
+    fgDefaultWeatherValue("visibility-m", new_value);
+    globals->get_subsystem("environment")->reinit();
+
+    return true;
+}
+static bool
+do_increase_visibility (const SGPropertyNode * arg)
+{
+    double new_value = fgGetDouble("/environment/visibility-m") * 1.1;
+    fgSetDouble("/environment/visibility-m", new_value);
+    fgDefaultWeatherValue("visibility-m", new_value);
+    globals->get_subsystem("environment")->reinit();
+
+    return true;
+}
+
+
 ////////////////////////////////////////////////////////////////////////
 // Command setup.
 ////////////////////////////////////////////////////////////////////////
@@ -894,6 +917,8 @@ static struct {
     { "presets-commit", do_presets_commit },
     { "log-level", do_log_level },
     { "replay", do_replay },
+    { "decrease-visibility", do_decrease_visibility },
+    { "increase-visibility", do_increase_visibility },
     { 0, 0 }                   // zero-terminated
 };