static const char *odgauge_name = "Aircraft/Instruments/Textures/od_wxradar.rgb";
wxRadarBg::wxRadarBg ( SGPropertyNode *node) :
- name("wxRadar"),
- num(0),
+ _name(node->getStringValue("name", "wxRadar")),
+ _num(node->getIntValue("number", 0)),
resultTexture( 0 ),
wxEcho( 0 ),
last_switchKnob( "off" ),
sim_init_done ( false ),
odg( 0 )
-{
- int i;
- for ( i = 0; i < node->nChildren(); ++i ) {
- SGPropertyNode *child = node->getChild(i);
- string cname = child->getName();
- string cval = child->getStringValue();
- if ( cname == "name" ) {
- name = cval;
- } else if ( cname == "number" ) {
- num = child->getIntValue();
- } else {
- SG_LOG( SG_INSTR, SG_WARN, "Error in wxRadar config logic" );
- if ( name.length() ) {
- SG_LOG( SG_INSTR, SG_WARN, "Section = " << name );
- }
- }
- }
-}
-
-wxRadarBg::wxRadarBg ()
{
}
wxRadarBg::init ()
{
string branch;
- branch = "/instrumentation/" + name;
+ branch = "/instrumentation/" + _name;
- _Instrument = fgGetNode(branch.c_str(), num, true );
+ _Instrument = fgGetNode(branch.c_str(), _num, true );
_serviceable_node = _Instrument->getChild("serviceable", 0, true);
resultTexture = FGTextureManager::createTexture( odgauge_name );
SGPath tpath(globals->get_fg_root());
tpath.append("Aircraft/Instruments/Textures/wxecho.rgb");
// no mipmap or else alpha will mix with pixels on the border of shapes, ruining the effect
- wxEcho = new ssgTexture( tpath.c_str(), false, false, false);
+
+ // OSGFIXME
+// wxEcho = new ssgTexture( tpath.c_str(), false, false, false);
+ wxEcho = new osg::Texture2D;
_Instrument->setFloatValue("trk", 0.0);
_Instrument->setFloatValue("tilt", 0.0);
void
wxRadarBg::update (double delta_time_sec)
{
+ //OSGFIXME
+#if 0
if ( ! sim_init_done ) {
if ( ! fgGetBool("sim/sceneryloaded", false) )
return;
// 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( odgauge_name, resultTexture.get());
last_switchKnob = switchKnob;
}
FGViewer *current__view = globals->get_current_view();
const float symbolSize = 1.0f / 8.0f ;
// draw the radar echo, we do that in 3 passes, one for each color level
// this is to 'merge' same colors together
- glBindTexture(GL_TEXTURE_2D, wxEcho->getHandle() );
+ // OSGFIXME
+// glBindTexture(GL_TEXTURE_2D, wxEcho->getHandle() );
glColor3f(1.0f, 1.0f, 1.0f);
glBegin( GL_QUADS );
glEnable(GL_ALPHA_TEST);
}
glPopMatrix();
- odg->endCapture( resultTexture->getHandle() );
+ odg->endCapture( resultTexture.get() );
+#endif
}