From bb634fcd2e5aabe3b8b68f7d01bdbb2e073b7589 Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 3 Jul 2007 18:24:45 +0000 Subject: [PATCH] make target RTT texture configurable as (ported from fg/plib, but doesn't yet work here) --- src/Instrumentation/wxradar.cxx | 13 ++++++++----- src/Instrumentation/wxradar.hxx | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Instrumentation/wxradar.cxx b/src/Instrumentation/wxradar.cxx index d039ba631..2727dd2ef 100644 --- a/src/Instrumentation/wxradar.cxx +++ b/src/Instrumentation/wxradar.cxx @@ -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; } diff --git a/src/Instrumentation/wxradar.hxx b/src/Instrumentation/wxradar.hxx index 5d8093f7a..ac22959a7 100644 --- a/src/Instrumentation/wxradar.hxx +++ b/src/Instrumentation/wxradar.hxx @@ -59,6 +59,7 @@ private: int _num; double _interval; double _time; + string _texture_path; typedef enum { ARC, MAP, PLAN, ROSE } DisplayMode; DisplayMode _display_mode; -- 2.39.5