Hi!

First patch fixes a bug caused by the uninitialized _range_nm member.
If it happens to contain nan, this will never get overwritten.
Second patch adds support for filtering what should be displayed.

Comments welcome.

-- 
Csaba/Jester
Index: src/Instrumentation/wxradar.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.cxx,v
retrieving revision 1.20
diff -u -r1.20 wxradar.cxx
--- src/Instrumentation/wxradar.cxx     4 Oct 2007 20:40:29 -0000       1.20
+++ src/Instrumentation/wxradar.cxx     4 Dec 2007 23:01:24 -0000
@@ -84,7 +84,8 @@
     _sim_init_done ( false ),
     _resultTexture( 0 ),
     _wxEcho( 0 ),
-    _odg( 0 )
+    _odg( 0 ),
+    _range_nm( 40.0 )
 {
     const char *tacan_source = node->getStringValue("tacan-source",
             "/instrumentation/tacan");
Index: src/Instrumentation/wxradar.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.cxx,v
retrieving revision 1.20
diff -u -r1.20 wxradar.cxx
--- src/Instrumentation/wxradar.cxx     4 Oct 2007 20:40:29 -0000       1.20
+++ src/Instrumentation/wxradar.cxx     4 Dec 2007 23:01:24 -0000
@@ -172,6 +172,9 @@
     _radar_rotate_node      = n->getNode("rotate", true);
     _radar_font_node        = _Instrument->getNode("font", true);
     _radar_font_node->addChangeListener(this);
+    _radar_mask_node        = n->getNode("mask", true);
+    if (!_radar_mask_node->hasValue())
+        _radar_mask_node->setIntValue((1 << FGAIBase::MAX_OBJECTS) - 1);
     
     updateFont();
 
@@ -615,10 +618,14 @@
     double selected_radius = 0;
     double selected_bearing = 0;
     int selected_id = fgGetInt("/instrumentation/radar/selected-id", -1);
+    int type_mask = ~_radar_mask_node->getIntValue();
 
     for (; it != end; ++it) {
         FGAIBase *ac = *it;
+               
         int type       = ac->getType();
+        if ((1 << type) & type_mask) continue;
+       
         double lat     = ac->_getLatitude();
         double lon     = ac->_getLongitude();
         double alt     = ac->_getAltitude();
Index: src/Instrumentation/wxradar.hxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/wxradar.hxx,v
retrieving revision 1.15
diff -u -r1.15 wxradar.hxx
--- src/Instrumentation/wxradar.hxx     9 Sep 2007 23:22:14 -0000       1.15
+++ src/Instrumentation/wxradar.hxx     4 Dec 2007 23:01:24 -0000
@@ -106,6 +106,7 @@
     SGPropertyNode_ptr _radar_hdg_marker_node;
     SGPropertyNode_ptr _radar_rotate_node;
     SGPropertyNode_ptr _radar_font_node;
+    SGPropertyNode_ptr _radar_mask_node;
 
     SGPropertyNode_ptr _ai_enabled_node;
 
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to