]> git.mxchange.org Git - flightgear.git/commitdiff
make target RTT texture configurable as <radar-texture-path>
authormfranz <mfranz>
Tue, 3 Jul 2007 18:24:45 +0000 (18:24 +0000)
committermfranz <mfranz>
Tue, 3 Jul 2007 18:24:45 +0000 (18:24 +0000)
(ported from fg/plib, but doesn't yet work here)

src/Instrumentation/wxradar.cxx
src/Instrumentation/wxradar.hxx

index d039ba63191337b87bf8f9887cc0c42f9d4dd640..2727dd2efbded81f1b7dd2a47cc013110be19b15 100644 (file)
@@ -60,8 +60,6 @@ typedef radar_list_type::iterator radar_list_iterator;
 typedef radar_list_type::const_iterator radar_list_const_iterator;
 
 
-// texture name to use in 2D and 3D instruments
-static const char *ODGAUGE_NAME = "Aircraft/Instruments/Textures/od_wxradar.rgb";
 static const float UNIT = 1.0f / 8.0f;  // 8 symbols in a row/column in the texture
 
 
@@ -95,7 +93,11 @@ wxRadarBg::init ()
 
     _Instrument = fgGetNode(branch.c_str(), _num, true );
     _serviceable_node = _Instrument->getNode("serviceable", true);
-    _resultTexture = FGTextureManager::createTexture( ODGAUGE_NAME );
+
+    // texture name to use in 2D and 3D instruments
+    _texture_path = _Instrument->getStringValue("radar-texture-path",
+            "Aircraft/Instruments/Textures/od_wxradar.rgb");
+    _resultTexture = FGTextureManager::createTexture(_texture_path.c_str());
 
     SGPath tpath(globals->get_fg_root());
     string path = _Instrument->getStringValue("echo-texture-path",
@@ -199,7 +201,7 @@ wxRadarBg::init ()
     _radarGeode->addDrawable(_geom);
     _odg->allocRT();
     // Texture in the 2D panel system
-    FGTextureManager::addTexture(ODGAUGE_NAME, _odg->getTexture());
+    FGTextureManager::addTexture(_texture_path.c_str(), _odg->getTexture());
 
     osg::Camera* camera = _odg->getCamera();
     camera->addChild(_radarGeode.get());
@@ -277,7 +279,8 @@ wxRadarBg::update (double delta_time_sec)
         // we must locate them and replace their handle by hand
         // only do that when the instrument is turned on
         //if ( _last_switchKnob == "off" )
-        //_odg->set_texture( ODGAUGE_NAME, _resultTexture->getHandle());
+        //_odg->set_texture(_texture_path.c_str(), _resultTexture->getHandle());
+
         _last_switchKnob = switchKnob;
     }
 
index 5d8093f7af46fd22865f4236b1064b8be51157b3..ac22959a749e5b554f72c7f933e40740c0dae384 100644 (file)
@@ -59,6 +59,7 @@ private:
     int _num;
     double _interval;
     double _time;
+    string _texture_path;
 
     typedef enum { ARC, MAP, PLAN, ROSE } DisplayMode;
     DisplayMode _display_mode;