X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_commands.cxx;h=de4336833a344159e85801549e415fe0cf77dfca;hb=4fe615fff546df5e381f7fc9ddae92dd3dc36251;hp=5c6af0b2b1d48ae576c031312989667c3ff25e06;hpb=826866b327521eb95a05fadbc4e3ea9cd4eb6870;p=flightgear.git diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 5c6af0b2b..de4336833 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #if defined(HAVE_PLIB_PSL) # include #endif @@ -331,7 +332,7 @@ do_load (const SGPropertyNode * arg) SG_LOG(SG_INPUT, SG_INFO, "Restored flight from " << file); return true; } else { - SG_LOG(SG_INPUT, SG_ALERT, "Cannot load flight from " << file); + SG_LOG(SG_INPUT, SG_WARN, "Cannot load flight from " << file); return false; } } @@ -1157,8 +1158,9 @@ do_play_audio_message (const SGPropertyNode * arg) FGFX *fx = (FGFX *)globals->get_subsystem("fx"); string path = arg->getStringValue("path"); string file = arg->getStringValue("file"); + double volume = arg->getDoubleValue("volume"); // cout << "playing " << path << " / " << file << endl; - fx->play_message( path, file ); + fx->play_message( path, file, volume ); return true; } @@ -1229,6 +1231,20 @@ do_replay (const SGPropertyNode * arg) } +/** + * Return terrain elevation for given longitude/latitude pair. + */ +static bool +do_terrain_elevation (const SGPropertyNode * arg) +{ + double lon = arg->getDoubleValue("longitude-deg", 0.0); + double lat = arg->getDoubleValue("latitude-deg", 0.0); + double elev; + bool ret = globals->get_scenery()->get_elevation_m(lat, lon, 10000.0, elev, 0, false); + const_cast(arg)->setDoubleValue("elevation-m", elev); + return ret; +} + static bool do_decrease_visibility (const SGPropertyNode * arg) @@ -1435,6 +1451,7 @@ static struct { { "presets-commit", do_presets_commit }, { "log-level", do_log_level }, { "replay", do_replay }, + { "terrain-elevation", do_terrain_elevation }, { "decrease-visibility", do_decrease_visibility }, { "increase-visibility", do_increase_visibility }, { "hud-init", do_hud_init },