diff options
| author | JosJuice <josjuice@gmail.com> | 2022-01-09 22:27:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-09 22:27:18 +0100 |
| commit | 3da64875314e2a1743b8d6453403ef85e8b45eb4 (patch) | |
| tree | e97af4fd1e5319cb74567f7c434d5084d9e1c4a5 /Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | 36d605715d4045d6a556b4234d1d925f79c5eea3 (diff) | |
| parent | ca9bf3174f4acd4c9d78ac7c21b6aeaa1430b7ef (diff) | |
Merge pull request #10209 from Pokechu22/assert-fmt
Assertion and panic alert improvements
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index 596fd1f109..ac72d383be 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -10,6 +10,7 @@ #include <sstream> #include <type_traits> +#include "Common/HRWrap.h" #include "Common/Logging/Log.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/ControllerInterface/DInput/DInput.h" @@ -62,12 +63,14 @@ void InitJoystick(IDirectInput8* const idi8, HWND hwnd) { if (SUCCEEDED(js_device->SetDataFormat(&c_dfDIJoystick))) { - if (FAILED(js_device->SetCooperativeLevel(GetAncestor(hwnd, GA_ROOT), - DISCL_BACKGROUND | DISCL_EXCLUSIVE))) + HRESULT hr = js_device->SetCooperativeLevel(GetAncestor(hwnd, GA_ROOT), + DISCL_BACKGROUND | DISCL_EXCLUSIVE); + if (FAILED(hr)) { - WARN_LOG_FMT( - CONTROLLERINTERFACE, - "DInput: Failed to acquire device exclusively. Force feedback will be unavailable."); + WARN_LOG_FMT(CONTROLLERINTERFACE, + "DInput: Failed to acquire device exclusively. Force feedback will be " + "unavailable. {}", + Common::HRWrap(hr)); // Fall back to non-exclusive mode, with no rumble if (FAILED( js_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) |
