#include <simgear/compiler.h>
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
-# include <Winsock2.h>
+#ifdef _WIN32
+# include <winsock2.h>
#endif
#include <math.h>
#include "jsinput.h"
+using simgear::PropertyList;
bool confirmAnswer() {
char answer;
cout << "Usage:" << endl;
cout << " --help\t\t\tShow this help" << endl;
exit(0);
+ } else if (strncmp("--fg-root=", argv[i], 10) == 0) {
+ // used later
} else {
cout << "Unknown option \"" << argv[i] << "\"" << endl;
exit(0);
cout << e.getFormattedMessage ();
}
- vector<SGPropertyNode_ptr> axes = templatetree->getChildren("axis");
- for(vector<SGPropertyNode_ptr>::iterator iter = axes.begin(); iter != axes.end(); iter++) {
+ PropertyList axes = templatetree->getChildren("axis");
+ for(PropertyList::iterator iter = axes.begin(); iter != axes.end(); iter++) {
cout << "Move the control you wish to use for " << (*iter)->getStringValue("desc")
<< " " << (*iter)->getStringValue("direction") << endl;
cout << "Pressing a button skips this axis" << endl;
cout << endl;
}
- vector<SGPropertyNode_ptr> buttons = templatetree->getChildren("button");
- for(vector<SGPropertyNode_ptr>::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
+ PropertyList buttons = templatetree->getChildren("button");
+ for(PropertyList::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
cout << "Press the button you wish to use for " << (*iter)->getStringValue("desc") << endl;
cout << "Moving a joystick axis skips this button" << endl;
fflush( stdout );
delete jsi;
delete[] xfs;
delete jss;
+ delete[] jstree;
return 1;
}
// find fg-root any other way.
if ( root.empty() ) {
#if defined( __CYGWIN__ )
- root = "/FlightGear";
-#elif defined( WIN32 )
- root = "\\FlightGear";
+ root = "../data";
+#elif defined( _WIN32 )
+ root = "..\\data";
#elif defined(OSX_BUNDLE)
/* the following code looks for the base package directly inside
the application bundle. This can be changed fairly easily by