]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/autopilotgroup.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / Autopilot / autopilotgroup.cxx
index 8cf389f8e2d85fb4e6da3d4a8d0a7ba23cc0a353..c60ea3010a6d2f8c27dc6ee0f22d51f74bfcedcc 100644 (file)
@@ -44,14 +44,18 @@ using simgear::PropertyList;
 class FGXMLAutopilotGroupImplementation : public FGXMLAutopilotGroup
 {
 public:
+    FGXMLAutopilotGroupImplementation(const std::string& nodeName) :
+        FGXMLAutopilotGroup(), _nodeName(nodeName) {}
     virtual void addAutopilot( const std::string & name, SGPropertyNode_ptr apNode, SGPropertyNode_ptr config );
     virtual void removeAutopilot( const std::string & name );
     void init();
+    InitStatus incrementalInit();
     void reinit();
     void update( double dt );
 private:
     void initFrom( SGPropertyNode_ptr rootNode, const char * childName );
     vector<string> _autopilotNames;
+    std::string _nodeName;
 
 };
 
@@ -98,14 +102,15 @@ void FGXMLAutopilotGroupImplementation::reinit()
     init();
 }
 
+SGSubsystem::InitStatus FGXMLAutopilotGroupImplementation::incrementalInit()
+{
+  init();
+  return INIT_DONE;
+}
+
 void FGXMLAutopilotGroupImplementation::init()
 {
-    static const char * nodeNames[] = {
-        "autopilot",
-        "property-rule"
-    };
-    for( unsigned i = 0; i < sizeof(nodeNames)/sizeof(nodeNames[0]); i++ )
-        initFrom( fgGetNode( "/sim/systems" ), nodeNames[i] );
+    initFrom( fgGetNode( "/sim/systems" ), _nodeName.c_str() );
 
     SGSubsystemGroup::bind();
     SGSubsystemGroup::init();
@@ -173,7 +178,7 @@ void FGXMLAutopilotGroup::addAutopilotFromFile( const std::string & name, SGProp
     }
 }
 
-FGXMLAutopilotGroup * FGXMLAutopilotGroup::createInstance()
+FGXMLAutopilotGroup * FGXMLAutopilotGroup::createInstance(const std::string& nodeName)
 {
-    return new FGXMLAutopilotGroupImplementation();
+    return new FGXMLAutopilotGroupImplementation(nodeName);
 }