]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/fgjs.cxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Input / fgjs.cxx
index 5527514d5d49c1098ce62963dd93dd18d27d0422..9a873ed51110c9ef13106f6fea695ce36d948d13 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <simgear/compiler.h>
 
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
-#  include <Winsock2.h>
+#ifdef _WIN32
+#  include <winsock2.h>
 #endif
 
 #include <math.h>
@@ -58,6 +58,7 @@ using std::string;
 
 #include "jsinput.h"
 
+using simgear::PropertyList;
 
 bool confirmAnswer() {
     char answer;
@@ -136,8 +137,8 @@ int main( int argc, char *argv[] ) {
         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;
@@ -164,8 +165,8 @@ int main( int argc, char *argv[] ) {
         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 );
@@ -233,12 +234,12 @@ static string fgScanForOption( const string& option, int argc, char **argv ) {
         free_hostname = true;
     }
 
-    SG_LOG(SG_GENERAL, SG_INFO, "Scanning command line for: " << option );
+    SG_LOG(SG_INPUT, SG_INFO, "Scanning command line for: " << option );
 
     int len = option.length();
 
     while ( i < argc ) {
-        SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
+        SG_LOG( SG_INPUT, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
 
         string arg = argv[i];
         if ( arg.find( option ) == 0 ) {
@@ -259,7 +260,7 @@ static string fgScanForOption( const string& option, const string& path ) {
         return "";
     }
 
-    SG_LOG( SG_GENERAL, SG_INFO, "Scanning " << path << " for: " << option );
+    SG_LOG( SG_INPUT, SG_INFO, "Scanning " << path << " for: " << option );
 
     int len = option.length();
 
@@ -338,9 +339,9 @@ string getFGRoot ( int argc, char **argv ) {
     // 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