From 5eca3dbd930421eed1d9cc45bb6fee15e4672b00 Mon Sep 17 00:00:00 2001 From: danij Date: Fri, 7 Nov 2014 23:02:50 +0000 Subject: [PATCH] Windows|Joystick|DirectInput|InputSystem|Client: Don't log errors regarding nonexistent joystick controls In this case the errors are due to our basic DirectInput init not taking the time to enumerate the available controls before trying to configure their properties. The current plan is to switch to using SDL2 for all input in 1.16 so simply ignore these specific errors for now. --- .../client/src/windows/joystick_win32.cpp | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/doomsday/client/src/windows/joystick_win32.cpp b/doomsday/client/src/windows/joystick_win32.cpp index 672eb77a04..4e547e9fac 100644 --- a/doomsday/client/src/windows/joystick_win32.cpp +++ b/doomsday/client/src/windows/joystick_win32.cpp @@ -1,8 +1,7 @@ -/** @file joystick_win32.cpp Joystick input for Windows. - * @ingroup input +/** @file joystick_win32.cpp Joystick input for Windows. * * @authors Copyright © 2003-2013 Jaakko Keränen - * @authors Copyright © 2005-2013 Daniel Swanson + * @authors Copyright © 2005-2014 Daniel Swanson * * @par License * GPL: http://www.gnu.org/licenses/gpl.html @@ -152,8 +151,11 @@ dd_bool Joystick_Init() hr = didJoy->SetProperty(DIPROP_RANGE, DIPropRange(DIPH_BYOFFSET, joyProp[i], IJOY_AXISMIN, IJOY_AXISMAX)); if(FAILED(hr)) { - LOGDEV_INPUT_VERBOSE("Failed to set axis '%s' range (0x%x: %s)") - << axisName[i] << hr << DirectInput_ErrorMsg(hr); + if(hr != DIERR_NOTFOUND) + { + LOGDEV_INPUT_VERBOSE("Failed to set axis '%s' range (0x%x: %s)") + << axisName[i] << hr << DirectInput_ErrorMsg(hr); + } } } @@ -161,16 +163,22 @@ dd_bool Joystick_Init() hr = didJoy->SetProperty(DIPROP_DEADZONE, DIPropDWord(DIPH_DEVICE)); if(FAILED(hr)) { - LOGDEV_INPUT_WARNING("Failed to set dead zone (0x%x: %s)") - << hr << DirectInput_ErrorMsg(hr); + if(hr != DIERR_NOTFOUND) + { + LOGDEV_INPUT_WARNING("Failed to set dead zone (0x%x: %s)") + << hr << DirectInput_ErrorMsg(hr); + } } // Set absolute mode. hr = didJoy->SetProperty(DIPROP_AXISMODE, DIPropDWord(DIPH_DEVICE, 0, DIPROPAXISMODE_ABS)); if(FAILED(hr)) { - LOGDEV_INPUT_WARNING("Failed to set absolute axis mode (0x%x: %s)") - << hr << DirectInput_ErrorMsg(hr); + if(hr != DIERR_NOTFOUND) + { + LOGDEV_INPUT_WARNING("Failed to set absolute axis mode (0x%x: %s)") + << hr << DirectInput_ErrorMsg(hr); + } } // Acquire it.