mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 00:09:24 +01:00
Fix DInput and SDL.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7345 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
bfe7b028ce
commit
a55e63c697
@ -545,7 +545,11 @@ ControllerInterface::Device::Output* ControllerInterface::Device::FindOutput(con
|
|||||||
ControllerInterface::Device::Input* ControllerInterface::FindInput(const std::string& name, const Device* def_dev) const
|
ControllerInterface::Device::Input* ControllerInterface::FindInput(const std::string& name, const Device* def_dev) const
|
||||||
{
|
{
|
||||||
if (def_dev)
|
if (def_dev)
|
||||||
return def_dev->FindInput(name);
|
{
|
||||||
|
Device::Input* const inp = def_dev->FindInput(name);
|
||||||
|
if (inp)
|
||||||
|
return inp;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<Device*>::const_iterator
|
std::vector<Device*>::const_iterator
|
||||||
di = m_devices.begin(),
|
di = m_devices.begin(),
|
||||||
|
@ -234,7 +234,7 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
|
|||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
for (u8 i = 0; i != js_caps.dwButtons; ++i)
|
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
|
// hats
|
||||||
for (u8 i = 0; i != js_caps.dwPOVs; ++i)
|
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)))
|
if (SUCCEEDED(m_device->GetProperty(DIPROP_RANGE, &range.diph)))
|
||||||
{
|
{
|
||||||
const LONG base = (range.lMin + range.lMax) / 2;
|
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
|
// each axis gets a negative and a positive input instance associated with it
|
||||||
AddInput(new Axis(offset, ax, base, range.lMin-base));
|
AddInput(new Axis(offset, ax, base, range.lMin-base));
|
||||||
@ -470,7 +470,7 @@ bool Joystick::UpdateOutput()
|
|||||||
std::string Joystick::Button::GetName() const
|
std::string Joystick::Button::GetName() const
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << "Button " << m_index;
|
ss << "Button " << (int)m_index;
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,14 +481,14 @@ std::string Joystick::Axis::GetName() const
|
|||||||
if (m_index < 6)
|
if (m_index < 6)
|
||||||
{
|
{
|
||||||
ss << "Axis " << (char)('X' + (m_index % 3));
|
ss << "Axis " << (char)('X' + (m_index % 3));
|
||||||
if ( m_index > 2 )
|
if (m_index > 2)
|
||||||
ss << 'r';
|
ss << 'r';
|
||||||
}
|
}
|
||||||
// slider
|
// slider
|
||||||
else
|
else
|
||||||
ss << "Slider " << m_index-6;
|
ss << "Slider " << (int)(m_index - 6);
|
||||||
|
|
||||||
ss << (m_range<0 ? '-' : '+');
|
ss << (m_range < 0 ? '-' : '+');
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,14 +241,14 @@ int Joystick::GetId() const
|
|||||||
std::string Joystick::Button::GetName() const
|
std::string Joystick::Button::GetName() const
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << "Button " << m_index;
|
ss << "Button " << (int)m_index;
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Joystick::Axis::GetName() const
|
std::string Joystick::Axis::GetName() const
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << "Axis " << m_index << (m_range<0 ? '-' : '+');
|
ss << "Axis " << (int)m_index << (m_range<0 ? '-' : '+');
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user