1
0
Fork 0

Make it possible to define a <target-platform> tag in the joystick configuration file. This would make it possible to have different configuration files for Windows. Possible values are: Windows, UNIX or All. Not specifying the tag equals to 'All'.

This commit is contained in:
ehofman 2004-04-27 08:43:20 +00:00
parent 0483333a6b
commit baa49ad145
2 changed files with 14 additions and 0 deletions

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

View 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);
#if defined( UL_WIN32 )
#define TGT_PLATFORM "Windows"
#else
#define TGT_PLATFORM "UNIX"
#endif