// so we can play with it.
if (x != m.x) {
int delta = x - m.x;
- for (int i = 0; i < mode.x_bindings[modifiers].size(); i++)
+ for (unsigned int i = 0; i < mode.x_bindings[modifiers].size(); i++)
mode.x_bindings[modifiers][i]->fire(double(delta), double(xsize));
}
if (y != m.y) {
int delta = y - m.y;
- for (int i = 0; i < mode.y_bindings[modifiers].size(); i++)
+ for (unsigned int i = 0; i < mode.y_bindings[modifiers].size(); i++)
mode.y_bindings[modifiers][i]->fire(double(delta), double(ysize));
}
continue;
} else {
#ifdef FG_PLIB_JOYSTICK_GETNAME
+ bool found_js = false;
const char * name = js->getName();
- std::cout << "Looking for bindings for joystick \""
- << name << '"' << std::endl;
+ SG_LOG(SG_INPUT, SG_INFO, "Looking for bindings for joystick \""
+ << name << '"');
vector<SGPropertyNode_ptr> nodes = js_nodes->getChildren("js-named");
- for (int i = 0; i < nodes.size(); i++) {
+ for (unsigned int i = 0; i < nodes.size(); i++) {
SGPropertyNode_ptr node = nodes[i];
- std::cout << " Trying \"" << node->getStringValue("name") << '"' << std::endl;
- if (!strcmp(node->getStringValue("name"), name)) {
- std::cout << " Found bindings" << std::endl;
- js_node = node;
- break;
- }
+ vector<SGPropertyNode_ptr> name_nodes = node->getChildren("name");
+ for (unsigned int j = 0; j < name_nodes.size(); j++) {
+ const char * js_name = name_nodes[j]->getStringValue();
+ SG_LOG(SG_INPUT, SG_INFO, " Trying \"" << js_name << '"');
+ if (!strcmp(js_name, name)) {
+ SG_LOG(SG_INPUT, SG_INFO, " Found bindings");
+ js_node = node;
+ found_js = true;
+ break;
+ }
+ }
+ if (found_js)
+ break;
}
#endif
}
////////////////////////////////////////////////////////////////////////
FGInput::mouse::mouse ()
- : nModes(1),
- current_mode(0),
- x(-1),
+ : x(-1),
y(-1),
+ nModes(1),
+ current_mode(0),
modes(0)
{
}