]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGJoystickInput.cxx
Fix two bugs in the new autopilot code
[flightgear.git] / src / Input / FGJoystickInput.cxx
index 75dc88700a1a2b93c6f4e4caf5b34dfa5d3c1434..349782d5b5e3c890abfb46e89a7c45c3e79cd59a 100644 (file)
@@ -27,6 +27,8 @@
 #include <Main/fg_props.hxx>
 #include <Scripting/NasalSys.hxx>
 
+using simgear::PropertyList;
+
 FGJoystickInput::axis::axis ()
   : last_value(9999999),
     tolerance(0.002),
@@ -166,7 +168,7 @@ void FGJoystickInput::postinit()
     string module = str.str();
     nasalsys->createModule(module.c_str(), module.c_str(), "", 0);
 
-    vector<SGPropertyNode_ptr> nasal = js_node->getChildren("nasal");
+    PropertyList nasal = js_node->getChildren("nasal");
     unsigned int j;
     for (j = 0; j < nasal.size(); j++) {
       nasal[j]->setStringValue("module", module.c_str());
@@ -176,7 +178,7 @@ void FGJoystickInput::postinit()
     //
     // Initialize the axes.
     //
-    vector<SGPropertyNode_ptr> axes = js_node->getChildren("axis");
+    PropertyList axes = js_node->getChildren("axis");
     size_t nb_axes = axes.size();
     for (j = 0; j < nb_axes; j++ ) {
       const SGPropertyNode * axis_node = axes[j];
@@ -219,7 +221,7 @@ void FGJoystickInput::postinit()
     //
     // Initialize the buttons.
     //
-    vector<SGPropertyNode_ptr> buttons = js_node->getChildren("button");
+    PropertyList buttons = js_node->getChildren("button");
     char buf[32];
     for (j = 0; j < buttons.size() && j < nbuttons; j++) {
       const SGPropertyNode * button_node = buttons[j];
@@ -234,7 +236,7 @@ void FGJoystickInput::postinit()
           continue;
       }
 
-      sprintf(buf, "%d", n_but);
+      sprintf(buf, "%u", (unsigned)n_but);
       SG_LOG(SG_INPUT, SG_DEBUG, "Initializing button " << n_but);
       bindings[i].buttons[n_but].init(button_node, buf, module );