mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
GCPad/WiimoteNew: Reordered some stuff in DirectInput device enumeration.(makes certain gamepads work now, hopfully doesn't break other pads) (Thanks to YoD for helping debug) Also fixed something ridiculous in the input config dialog. :p
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6264 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f3b144d563
commit
cf5639af54
@ -206,6 +206,21 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
|
||||
, m_index(index)
|
||||
//, m_name(TStringToString(lpddi->tszInstanceName))
|
||||
{
|
||||
// seems this needs to be done before GetCapabilities
|
||||
// polled or buffered data
|
||||
DIPROPDWORD dipdw;
|
||||
dipdw.diph.dwSize = sizeof(DIPROPDWORD);
|
||||
dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
|
||||
dipdw.diph.dwObj = 0;
|
||||
dipdw.diph.dwHow = DIPH_DEVICE;
|
||||
dipdw.dwData = DATA_BUFFER_SIZE;
|
||||
// set the buffer size,
|
||||
// if we can't set the property, we can't use buffered data
|
||||
m_buffered = SUCCEEDED(m_device->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph));
|
||||
|
||||
// seems this needs to be done after SetProperty of buffer size
|
||||
m_device->Acquire();
|
||||
|
||||
// get joystick caps
|
||||
DIDEVCAPS js_caps;
|
||||
js_caps.dwSize = sizeof(js_caps);
|
||||
@ -218,17 +233,6 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
|
||||
|
||||
//m_must_poll = (js_caps.dwFlags & DIDC_POLLEDDATAFORMAT) != 0;
|
||||
|
||||
// polled or buffered data
|
||||
DIPROPDWORD dipdw;
|
||||
dipdw.diph.dwSize = sizeof(DIPROPDWORD);
|
||||
dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
|
||||
dipdw.diph.dwObj = 0;
|
||||
dipdw.diph.dwHow = DIPH_DEVICE;
|
||||
dipdw.dwData = DATA_BUFFER_SIZE;
|
||||
// set the buffer size,
|
||||
// if we can't set the property, we can't use buffered data
|
||||
m_buffered = SUCCEEDED(m_device->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph));
|
||||
|
||||
// buttons
|
||||
for ( unsigned int i = 0; i < js_caps.dwButtons; ++i )
|
||||
AddInput( new Button( i ) );
|
||||
@ -267,9 +271,6 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
|
||||
}
|
||||
}
|
||||
|
||||
// it seems this needs to be done after SetProperty...
|
||||
m_device->Acquire();
|
||||
|
||||
// TODO: check for DIDC_FORCEFEEDBACK in devcaps?
|
||||
|
||||
// get supported ff effects
|
||||
|
@ -19,10 +19,15 @@
|
||||
|
||||
void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
|
||||
{
|
||||
GamepadPage* const current_page = (GamepadPage*)m_pad_notebook->GetPage( m_pad_notebook->GetSelection() );
|
||||
|
||||
wxFont small_font(6, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
|
||||
|
||||
m_plugin.controller_interface.UpdateInput();
|
||||
// don't want game thread updating input when we are using it here
|
||||
if (false == m_plugin.controller_interface.update_lock.TryEnter())
|
||||
return;
|
||||
|
||||
GamepadPage* const current_page = (GamepadPage*)m_pad_notebook->GetPage(m_pad_notebook->GetSelection());
|
||||
|
||||
std::vector< ControlGroupBox* >::iterator
|
||||
g = current_page->control_groups.begin(),
|
||||
ge = current_page->control_groups.end();
|
||||
@ -31,12 +36,6 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
|
||||
// if this control group has a bitmap
|
||||
if ( (*g)->static_bitmap )
|
||||
{
|
||||
|
||||
m_plugin.controller_interface.UpdateInput();
|
||||
// don't want game thread updating input when we are using it here
|
||||
if (false == m_plugin.controller_interface.update_lock.TryEnter())
|
||||
return;
|
||||
|
||||
wxMemoryDC dc;
|
||||
wxBitmap bitmap((*g)->static_bitmap->GetBitmap());
|
||||
dc.SelectObject(bitmap);
|
||||
@ -343,9 +342,8 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
|
||||
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
(*g)->static_bitmap->SetBitmap(bitmap);
|
||||
|
||||
m_plugin.controller_interface.update_lock.Leave();
|
||||
}
|
||||
}
|
||||
|
||||
m_plugin.controller_interface.update_lock.Leave();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user