From 340bb58579cbc767c2d89b141b0ccdb6cb281311 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Thu, 9 Dec 2010 09:08:49 +0100 Subject: [PATCH] Export the 2d cloudlayer transparency to the property tree --- src/Environment/environment_mgr.cxx | 17 ++++++++++++++++- src/Environment/environment_mgr.hxx | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 7b276eb62..4d05fab29 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -156,7 +156,9 @@ FGEnvironmentMgr::bind () &FGEnvironmentMgr::get_cloud_layer_visibility_m, &FGEnvironmentMgr::set_cloud_layer_visibility_m); - + _tiedProperties.Tie( layerNode->getNode( "alpha",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_maxalpha, + &FGEnvironmentMgr::set_cloud_layer_maxalpha); } _tiedProperties.setRoot( fgGetNode("/sim/rendering", true ) ); @@ -332,6 +334,19 @@ FGEnvironmentMgr::set_cloud_layer_visibility_m (int index, double visibility_m) thesky->get_cloud_layer(index)->setVisibility_m(visibility_m); } +double +FGEnvironmentMgr::get_cloud_layer_maxalpha (int index ) const +{ + return thesky->get_cloud_layer(index)->getMaxAlpha(); +} + +void +FGEnvironmentMgr::set_cloud_layer_maxalpha (int index, double maxalpha) +{ + thesky->get_cloud_layer(index)->setMaxAlpha(maxalpha); +} + + void diff --git a/src/Environment/environment_mgr.hxx b/src/Environment/environment_mgr.hxx index 7b5ad76cb..d9c770319 100644 --- a/src/Environment/environment_mgr.hxx +++ b/src/Environment/environment_mgr.hxx @@ -89,6 +89,8 @@ private: void set_cloud_layer_coverage_type (int index, int type ); double get_cloud_layer_visibility_m (int index) const; void set_cloud_layer_visibility_m (int index, double visibility_m); + double get_cloud_layer_maxalpha (int index ) const; + void set_cloud_layer_maxalpha (int index, double maxalpha); FGEnvironment * _environment; // always the same, for now FGClouds *fgClouds;