X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCockpit%2Fhud.cxx;h=98b4f139493c6343c4ff93f719faaafcbd8cdccc;hb=029dda3297e3697438e1a58188527cbae90beebe;hp=9212f6e5fcf408898c40fe0b7fddebc4dca0f924;hpb=dbbad3cdf2c81a8e58d07681d92cb159e57e320e;p=flightgear.git diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 9212f6e5f..98b4f1394 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -44,7 +44,7 @@ #include // char related functions #include // strcmp() -#include +#include SG_GLU_H #include #include @@ -58,7 +58,7 @@ #include
#include -#if defined ( __sun__ ) || defined ( __sgi ) +#if defined (__sun) || defined ( __sgi ) extern "C" { extern void *memmove(void *, const void *, size_t); } @@ -585,6 +585,29 @@ readTBI(const SGPropertyNode * node) return p; } //end readTBI +static instr_item * +readRunway(const SGPropertyNode * node) { + name = node->getStringValue("name"); + x = node->getIntValue("x"); + y = node->getIntValue("y"); + width = node->getIntValue("width"); + height = node->getIntValue("height"); + scaling = node->getDoubleValue("scale"); + working = node->getBoolValue("working",true); + runway_instr *ri = new runway_instr(x,y,width,height,scaling,working); + double scale = node->getDoubleValue("arrow_scale",1.0); + ri->setDrawArrow((scale>0)?true:false); + ri->setDrawArrowAlways((scale>0)?node->getBoolValue("arrow_always"):false); + ri->setStippleOutline(node->getIntValue("outer_stipple",0xFFFF)); + ri->setStippleCenterline(node->getIntValue("center_stipple",0xFFFF)); + ri->setArrowRotationRadius(node->getDoubleValue("arrow_radius")); + ri->setArrowScale(scale); + ri->setLineScale(node->getDoubleValue("line_scale",1.0)); + ri->setScaleDist(node->getDoubleValue("scale_dist_nm")); + SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); + return (instr_item *) ri; +} + int readInstrument(const SGPropertyNode * node) { @@ -643,6 +666,18 @@ int readInstrument(const SGPropertyNode * node) }//for - tbis } + + const SGPropertyNode * rwy_group = node->getNode("runways"); + if (rwy_group != 0) { + int nRwy = rwy_group->nChildren(); + for (int j = 0; j < nRwy; j++) { + SG_LOG( SG_COCKPIT, SG_DEBUG, + "************** Reading runway properties" ); + HIptr = readRunway(rwy_group->getChild(j)); + HUD_deque.insert( HUD_deque.begin(), HIptr); + + }//for - runways + } return 0; }//end readinstrument