GCPad/New Wiimote: Fixed issue 2848 (profiles not saving). Renamed DInput mouse axes to "Axis [XYZ][-+]" from "Mouse XYZ...". Minor cleanup/warning removal.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5767 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2010-06-22 08:30:33 +00:00
parent 1b670a9825
commit 25aca8cc4a
5 changed files with 38 additions and 54 deletions

View File

@ -192,17 +192,15 @@ void ControlDialog::UpdateListContents()
{
control_lbox->Clear();
std::vector<ControllerInterface::Device*>::const_iterator di =
FindDevice(m_plugin.controller_interface.Devices(), m_devq);
if (m_plugin.controller_interface.Devices().end() != di)
ControllerInterface::Device* const dev = m_plugin.controller_interface.FindDevice(m_devq);
if (dev)
{
if (control_reference->is_input)
{
// for inputs
std::vector<ControllerInterface::Device::Input*>::const_iterator
i = (*di)->Inputs().begin(),
e = (*di)->Inputs().end();
i = dev->Inputs().begin(),
e = dev->Inputs().end();
for (; i!=e; ++i)
control_lbox->Append(WXSTR_FROM_STR((*i)->GetName()));
}
@ -210,8 +208,8 @@ void ControlDialog::UpdateListContents()
{
// for outputs
std::vector<ControllerInterface::Device::Output*>::const_iterator
i = (*di)->Outputs().begin(),
e = (*di)->Outputs().end();
i = dev->Outputs().begin(),
e = dev->Outputs().end();
for (; i!=e; ++i)
control_lbox->Append(WXSTR_FROM_STR((*i)->GetName()));
}
@ -411,15 +409,13 @@ void ControlDialog::DetectControl(wxCommandEvent& event)
wxButton* const btn = (wxButton*)event.GetEventObject();
const wxString lbl = btn->GetLabel();
std::vector<ControllerInterface::Device*>::const_iterator di =
FindDevice(m_plugin.controller_interface.Devices(), m_devq);
if (m_plugin.controller_interface.Devices().end() != di)
ControllerInterface::Device* const dev = m_plugin.controller_interface.FindDevice(m_devq);
if (dev)
{
btn->SetLabel(wxT("[ waiting ]"));
m_plugin.controls_crit.Enter(); // enter
ControllerInterface::Device::Control* const ctrl = control_reference->Detect(DETECT_WAIT_TIME, *di);
ControllerInterface::Device::Control* const ctrl = control_reference->Detect(DETECT_WAIT_TIME, dev);
// if we got input, select it in the list
if (ctrl)
@ -436,15 +432,13 @@ void GamepadPage::DetectControl( wxCommandEvent& event )
ControlButton* btn = (ControlButton*)event.GetEventObject();
// find device :/
const std::vector<ControllerInterface::Device*>::const_iterator di =
FindDevice(m_plugin.controller_interface.Devices(), controller->default_device);
if (m_plugin.controller_interface.Devices().end() != di)
ControllerInterface::Device* const dev = m_plugin.controller_interface.FindDevice(controller->default_device);
if (dev)
{
btn->SetLabel(wxT("[ waiting ]"));
m_plugin.controls_crit.Enter(); // enter
ControllerInterface::Device::Control* const ctrl = btn->control_reference->Detect(DETECT_WAIT_TIME, *di);
ControllerInterface::Device::Control* const ctrl = btn->control_reference->Detect(DETECT_WAIT_TIME, dev);
// if we got input, update expression and reference
if (ctrl)
@ -561,6 +555,7 @@ void GamepadPage::SaveProfile( wxCommandEvent& event )
{
std::string fname;
GamepadPage::GetProfilePath(fname);
File::CreateFullPath(fname.c_str());
if (false == fname.empty())
{