Here's my take on the discussed problem: Add an alternative attribute
"n_win" to all "axis" definitions that should be different in Unix and
Windows. E.g.:

    <axis n="1">
    ...
    </axis>

    <axis n="2" n_win="3">
        <desc>Rudder</desc>
        ...
    </axis>

    <axis n="3" n_win="2">
        <desc>Throttle</desc>
        ...
    </axis>

i.e.: "n_win" overrides "n" on Windows.

An attribute "n_mac" can easily be added if necessary. No need for
extra files. 

Tested and seems to work. I had to fake a MICROS~1 OS, though,
because I'm a Linux only business.

m.





Index: props_io.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/props/props_io.cxx,v
retrieving revision 1.3
diff -u -p -r1.3 props_io.cxx
--- a/props_io.cxx      16 Oct 2003 14:53:14 -0000      1.3
+++ b/props_io.cxx      27 Apr 2004 18:16:04 -0000
@@ -27,6 +27,11 @@ SG_USING_STD(map);

 #define DEFAULT_MODE (SGPropertyNode::READ|SGPropertyNode::WRITE)

+#if defined(WIN32)
+static bool win32 = true;
+#else
+static bool win32 = false;
+#endif



 ////////////////////////////////////////////////////////////////////////
@@ -135,6 +140,7 @@ PropsVisitor::startElement (const char *
 {
   State &st = state();
   const char * attval;
+  const char * winval;

   if (_level == 0) {
     if (strcmp(name, "PropertyList")) {
@@ -164,7 +170,10 @@ PropsVisitor::startElement (const char *
     attval = atts.getValue("n");
     int index = 0;
     if (attval != 0) {
-      index = atoi(attval);
+      if (win32 && (winval = atts.getValue("n_win")))
+        index = atoi(winval);
+      else
+        index = atoi(attval);
       st.counters[name] = SG_MAX2(st.counters[name], index+1);
     } else {
       index = st.counters[name];


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to