X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCockpit%2Fmarker_beacon.cxx;h=eed3f1a032f83147c7bb337cac87d0136b3e2120;hb=56db994994a891acd491da24b4b36420b4e54a88;hp=1a0d6f327c4e9882bb59fe6ab1332ea1928ee98e;hpb=44be7da053ceab307651c8f93ac338ce37529a27;p=flightgear.git diff --git a/src/Cockpit/marker_beacon.cxx b/src/Cockpit/marker_beacon.cxx index 1a0d6f327..eed3f1a03 100644 --- a/src/Cockpit/marker_beacon.cxx +++ b/src/Cockpit/marker_beacon.cxx @@ -40,31 +40,6 @@ SG_USING_STD(string); -/** - * Boy, this is ugly! Make the VOR range vary by altitude difference. - */ -static double kludgeRange ( double stationElev, double aircraftElev, - double nominalRange) -{ - // Assume that the nominal range (usually - // 50nm) applies at a 5,000 ft difference. - // Just a wild guess! - double factor = ((aircraftElev*SG_METER_TO_FEET) - stationElev) / 5000.0; - double range = fabs(nominalRange * factor); - - // Clamp the range to keep it sane; for - // now, never less than 25% or more than - // 500% of nominal range. - if (range < nominalRange/4.0) { - range = nominalRange/4.0; - } else if (range > nominalRange*5.0) { - range = nominalRange*5.0; - } - - return range; -} - - // Constructor FGMarkerBeacon::FGMarkerBeacon() : lon_node(fgGetNode("/position/longitude-deg", true)), @@ -218,15 +193,15 @@ void FGMarkerBeacon::search() // cout << "OUTER MARKER" << endl; if ( last_beacon != FGMkrBeacon::OUTER ) { if ( ! globals->get_soundmgr()->exists( "outer-marker" ) ) { - FGSimpleSound *sound = beacon.get_outer(); + SGSimpleSound *sound = beacon.get_outer(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "outer-marker" ); } } - if ( audio_btn->getBoolValue() - && !globals->get_soundmgr()->is_playing("outer-marker") ) - { - globals->get_soundmgr()->play_looped( "outer-marker" ); + if ( audio_btn->getBoolValue() ) { + if ( !globals->get_soundmgr()->is_playing("outer-marker") ) { + globals->get_soundmgr()->play_looped( "outer-marker" ); + } } else { globals->get_soundmgr()->stop( "outer-marker" ); } @@ -235,15 +210,15 @@ void FGMarkerBeacon::search() // cout << "MIDDLE MARKER" << endl; if ( last_beacon != FGMkrBeacon::MIDDLE ) { if ( ! globals->get_soundmgr()->exists( "middle-marker" ) ) { - FGSimpleSound *sound = beacon.get_middle(); + SGSimpleSound *sound = beacon.get_middle(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "middle-marker" ); } } - if ( audio_btn->getBoolValue() - && !globals->get_soundmgr()->is_playing("middle-marker") ) - { - globals->get_soundmgr()->play_looped( "middle-marker" ); + if ( audio_btn->getBoolValue() ) { + if ( !globals->get_soundmgr()->is_playing("middle-marker") ) { + globals->get_soundmgr()->play_looped( "middle-marker" ); + } } else { globals->get_soundmgr()->stop( "middle-marker" ); } @@ -252,15 +227,15 @@ void FGMarkerBeacon::search() // cout << "INNER MARKER" << endl; if ( last_beacon != FGMkrBeacon::INNER ) { if ( ! globals->get_soundmgr()->exists( "inner-marker" ) ) { - FGSimpleSound *sound = beacon.get_inner(); + SGSimpleSound *sound = beacon.get_inner(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "inner-marker" ); } } - if ( audio_btn->getBoolValue() - && !globals->get_soundmgr()->is_playing("inner-marker") ) - { - globals->get_soundmgr()->play_looped( "inner-marker" ); + if ( audio_btn->getBoolValue() ) { + if ( !globals->get_soundmgr()->is_playing("inner-marker") ) { + globals->get_soundmgr()->play_looped( "inner-marker" ); + } } else { globals->get_soundmgr()->stop( "inner-marker" ); }