From: curt Date: Tue, 4 May 2004 19:02:19 +0000 (+0000) Subject: Add calls to jsInit() which is a noop on all platforms but Mac. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=72f75952738d2bd3e04f56477cd8272d7a3d4b68;p=flightgear.git Add calls to jsInit() which is a noop on all platforms but Mac. --- diff --git a/src/Input/fgjs.cxx b/src/Input/fgjs.cxx index 8cce19be7..a98429c0b 100644 --- a/src/Input/fgjs.cxx +++ b/src/Input/fgjs.cxx @@ -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); diff --git a/src/Input/input.cxx b/src/Input/input.cxx index fffc334fc..0c5ce80fb 100644 --- a/src/Input/input.cxx +++ b/src/Input/input.cxx @@ -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 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 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(); diff --git a/src/Input/js_demo.cxx b/src/Input/js_demo.cxx index cb592a573..189dd3d23 100644 --- a/src/Input/js_demo.cxx +++ b/src/Input/js_demo.cxx @@ -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 ) ;