1
0
Fork 0

Add calls to jsInit() which is a noop on all platforms but Mac.

This commit is contained in:
curt 2004-05-04 19:02:19 +00:00
parent 09d4176e96
commit 72f7595273
3 changed files with 7 additions and 2 deletions

View 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);

View 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();

View 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 ) ;