From: James Turner Date: Thu, 15 Sep 2011 08:54:00 +0000 (+0100) Subject: In joystick configurations, fall back to if no entry was provided, since... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2de3872d664cbe14f50b68bd39364effdd054167;p=flightgear.git In joystick configurations, fall back to if no entry was provided, since the number is frequently identical. --- diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt index eb9916107..4c5939d4a 100644 --- a/src/Input/CMakeLists.txt +++ b/src/Input/CMakeLists.txt @@ -18,6 +18,17 @@ set(SOURCES input.cxx ) +set(HEADERS + FGButton.hxx + FGCommonInput.hxx + FGDeviceConfigurationMap.hxx + FGEventInput.hxx + FGJoystickInput.hxx + FGKeyboardInput.hxx + FGMouseInput.hxx + input.hxx + ) + if(EVENT_INPUT) list(APPEND SOURCES ${EVENT_INPUT_SOURCES}) include_directories(${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) @@ -43,6 +54,6 @@ target_link_libraries(js_demo ${PLIB_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}) -flightgear_component(Input "${SOURCES}") +flightgear_component(Input "${SOURCES}" "${HEADERS}") install(TARGETS fgjs js_demo RUNTIME DESTINATION bin) diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 456747647..516679f25 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -217,10 +217,19 @@ void FGJoystickInput::postinit() if (num_node != 0) { n_axis = num_node->getIntValue(TGT_PLATFORM, -1); + #ifdef SG_MAC + // Mac falls back to Unix by default - avoids specifying many + // duplicate entries in joystick config files + if (n_axis < 0) { + n_axis = num_node->getIntValue("unix", -1); + } + #endif + // Silently ignore platforms that are not specified within the // section - if (n_axis < 0) - continue; + if (n_axis < 0) { + continue; + } } if (n_axis >= naxes) {