]> git.mxchange.org Git - flightgear.git/commitdiff
Add calls to jsInit() which is a noop on all platforms but Mac.
authorcurt <curt>
Tue, 4 May 2004 19:02:19 +0000 (19:02 +0000)
committercurt <curt>
Tue, 4 May 2004 19:02:19 +0000 (19:02 +0000)
src/Input/fgjs.cxx
src/Input/input.cxx
src/Input/js_demo.cxx

index 8cce19be74ff327132900c09eef3ac1fee2b1d26..a98429c0b2f65a480b4f5cc76580db3d5f0d5322 100644 (file)
@@ -121,6 +121,8 @@ void writeButtonProperties(fstream &fs, int property,int joystick, int button) {
 
       
 int main(void) {
+  jsInit();
+
   jsSuper *jss=new jsSuper();
   jsInput *jsi=new jsInput(jss);
   jsi->displayValues(false);
index fffc334fc3f9c824576c130c66979a8188442e5b..0c5ce80fb07bdd8271690fef966f44369be4e841 100644 (file)
@@ -377,6 +377,7 @@ FGInput::_init_keyboard ()
 void
 FGInput::_init_joystick ()
 {
+  jsInit();
                                 // TODO: zero the old bindings first.
   SG_LOG(SG_INPUT, SG_DEBUG, "Initializing joystick bindings");
   SGPropertyNode * js_nodes = fgGetNode("/input/joysticks");
@@ -456,7 +457,7 @@ FGInput::_init_joystick ()
     vector<SGPropertyNode_ptr> axes = js_node->getChildren("axis");
     size_t nb_axes = axes.size();
     int j;
-    for (j = 0; j < nb_axes; j++) {
+    for (j = 0; j < (int)nb_axes; j++) {
       const SGPropertyNode * axis_node = axes[j];
       const SGPropertyNode * num_node = axis_node->getChild("number");
       size_t n_axis = axis_node->getIndex();
@@ -490,7 +491,7 @@ FGInput::_init_joystick ()
     //
     vector<SGPropertyNode_ptr> buttons = js_node->getChildren("button");
     char buf[32];
-    for (j = 0; (j < buttons.size()) && (j < nbuttons); j++) {
+    for (j = 0; (j < (int)buttons.size()) && (j < nbuttons); j++) {
       const SGPropertyNode * button_node = buttons[j];
       const SGPropertyNode * num_node = button_node->getChild("number");
       size_t n_but = button_node->getIndex();
index cb592a57325d985640b710e27abf79c1f375ffd1..189dd3d239f903b87892d3d6b3cdb40cec6f91c7 100644 (file)
@@ -17,6 +17,8 @@ int main ( int, char ** )
   float      *ax[Z] ;
   int i, j, t, useful[Z];
 
+  jsInit();
+
   for ( i = 0; i < Z; i++ )
       js[i] = new jsJoystick ( i ) ;