]> git.mxchange.org Git - flightgear.git/commitdiff
Make it possible to define a <target-platform> tag in the joystick configuration...
authorehofman <ehofman>
Tue, 27 Apr 2004 08:43:20 +0000 (08:43 +0000)
committerehofman <ehofman>
Tue, 27 Apr 2004 08:43:20 +0000 (08:43 +0000)
src/Input/input.cxx
src/Input/input.hxx

index 4a4853def30373a4f4b219ad5f86b7c61d9bbd11..04b356a38e57c7a33cb2b7f2fc1915bf1ad89639 100644 (file)
@@ -404,6 +404,12 @@ FGInput::_init_joystick ()
       vector<SGPropertyNode_ptr> nodes = js_nodes->getChildren("js-named");
       for (unsigned int i = 0; i < nodes.size(); i++) {
         SGPropertyNode_ptr node = nodes[i];
+        SGPropertyNode *tgt = node->getNode("target-platform", false);
+        if (tgt != NULL) {
+           if ((strcmp(tgt->getStringValue(), TGT_PLATFORM) != NULL) &&
+               (strcmp(tgt->getStringValue(), "All") != NULL))
+              continue;                // Different target platform
+        }
         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();
index 364b93872e99379ee68e5464b57b0827551b9d0a..e61d9c95d646d27d16e0e995608885aabaecbc40 100644 (file)
@@ -29,6 +29,7 @@
 #endif
 
 #include <plib/js.h>
+#include <plib/ul.h>
 
 #include <simgear/compiler.h>
 
@@ -48,6 +49,13 @@ SG_USING_STD(map);
 SG_USING_STD(vector);
 
 
+\f
+
+#if defined( UL_WIN32 )
+#define TGT_PLATFORM   "Windows"
+#else
+#define TGT_PLATFORM   "UNIX"
+#endif
 
 
 \f