diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2011-03-14 21:07:28 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2011-03-14 21:07:28 +0000 |
| commit | a55e63c69713ecd297019fe26c28d35df947a419 (patch) | |
| tree | 3e9f81d9056218161fead0e5e4e877fad57e6340 /Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | bfe7b028ce5406df1f271b667e225725de1ea5db (diff) | |
Fix DInput and SDL.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7345 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp index 0867017ac1..796f948534 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp @@ -234,7 +234,7 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI // buttons for (u8 i = 0; i != js_caps.dwButtons; ++i) - AddInput(new Button(i, m_state_in.rgbButtons[m_index])); + AddInput(new Button(i, m_state_in.rgbButtons[i])); // hats for (u8 i = 0; i != js_caps.dwPOVs; ++i) @@ -264,7 +264,7 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI if (SUCCEEDED(m_device->GetProperty(DIPROP_RANGE, &range.diph))) { const LONG base = (range.lMin + range.lMax) / 2; - const LONG& ax = (&m_state_in.lX)[m_index]; + const LONG& ax = (&m_state_in.lX)[offset]; // each axis gets a negative and a positive input instance associated with it AddInput(new Axis(offset, ax, base, range.lMin-base)); @@ -470,7 +470,7 @@ bool Joystick::UpdateOutput() std::string Joystick::Button::GetName() const { std::ostringstream ss; - ss << "Button " << m_index; + ss << "Button " << (int)m_index; return ss.str(); } @@ -481,14 +481,14 @@ std::string Joystick::Axis::GetName() const if (m_index < 6) { ss << "Axis " << (char)('X' + (m_index % 3)); - if ( m_index > 2 ) + if (m_index > 2) ss << 'r'; } // slider else - ss << "Slider " << m_index-6; + ss << "Slider " << (int)(m_index - 6); - ss << (m_range<0 ? '-' : '+'); + ss << (m_range < 0 ? '-' : '+'); return ss.str(); } |
