GCPad/New Wiimote Plugin: Individual keyboard and mouse devices are now listed on Windows(2 player with 2 keyboards possible). Improved the ability to map multiple inputs to the same control. Inputs from different devices can be mapped to the same button (example: Mouse Left and XInput A). More advanced mappings such as "Button 1 or 2 and NOT button 3" are possible. I hope the GUI after right clicking a button isn't too confusing(may change it to be a bit more user friendly). Hopefully, I didn't break OSX stuff by 'const'ing a few functions.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5757 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2010-06-21 03:12:16 +00:00
parent fde15c1bc6
commit 9e3b653688
30 changed files with 1232 additions and 1163 deletions

View File

@ -62,7 +62,7 @@ ControllerEmu::ControlGroup::Control::~Control()
delete control_ref;
}
void ControllerEmu::UpdateReferences( ControllerInterface& devi )
void ControllerEmu::UpdateReferences(ControllerInterface& devi)
{
std::vector<ControlGroup*>::const_iterator
i = groups.begin(),
@ -73,7 +73,7 @@ void ControllerEmu::UpdateReferences( ControllerInterface& devi )
ci = (*i)->controls.begin(),
ce = (*i)->controls.end();
for ( ; ci!=ce; ++ci )
devi.UpdateReference( (*ci)->control_ref );
devi.UpdateReference((*ci)->control_ref, default_device);
// extension
if ( GROUP_TYPE_EXTENSION == (*i)->type )
@ -82,7 +82,7 @@ void ControllerEmu::UpdateReferences( ControllerInterface& devi )
ai = ((Extension*)*i)->attachments.begin(),
ae = ((Extension*)*i)->attachments.end();
for ( ; ai!=ae; ++ai )
(*ai)->UpdateReferences( devi );
(*ai)->UpdateReferences(devi);
}
}
}
@ -94,11 +94,11 @@ void ControllerEmu::UpdateDefaultDevice()
e = groups.end();
for ( ; i!=e; ++i )
{
std::vector<ControlGroup::Control*>::const_iterator
ci = (*i)->controls.begin(),
ce = (*i)->controls.end();
for ( ; ci!=ce; ++ci )
(*ci)->control_ref->device_qualifier = default_device;
//std::vector<ControlGroup::Control*>::const_iterator
//ci = (*i)->controls.begin(),
//ce = (*i)->controls.end();
//for ( ; ci!=ce; ++ci )
//(*ci)->control_ref->device_qualifier = default_device;
// extension
if ( GROUP_TYPE_EXTENSION == (*i)->type )
@ -135,19 +135,13 @@ void ControllerEmu::ControlGroup::LoadConfig(IniFile::Section *sec, const std::s
ce = controls.end();
for ( ; ci!=ce; ++ci )
{
// control and dev qualifier
sec->Get((group + (*ci)->name).c_str(), &(*ci)->control_ref->control_qualifier.name, "");
std::string dev;
sec->Get((group+(*ci)->name+"/Device").c_str(), &dev, defdev.c_str());
(*ci)->control_ref->device_qualifier.FromString(dev);
// control expression
sec->Get((group + (*ci)->name).c_str(), &(*ci)->control_ref->expression, "");
// range
sec->Get( (group+(*ci)->name+"/Range").c_str(), &(*ci)->control_ref->range, 100.0f);
(*ci)->control_ref->range /= 100;
// input mode
if ( (*ci)->control_ref->is_input )
sec->Get( (group+(*ci)->name+"/Mode").c_str(), &((ControllerInterface::InputReference*)((*ci)->control_ref))->mode, 0 );
}
// extensions
@ -205,22 +199,11 @@ void ControllerEmu::ControlGroup::SaveConfig( IniFile::Section *sec, const std::
ce = controls.end();
for ( ; ci!=ce; ++ci )
{
// control and dev qualifier
sec->Set( (group+(*ci)->name).c_str(), (*ci)->control_ref->control_qualifier.name, "");
sec->Set( (group+(*ci)->name+"/Device").c_str(), (*ci)->control_ref->device_qualifier.ToString(), defdev);
// control expression
sec->Set( (group+(*ci)->name).c_str(), (*ci)->control_ref->expression, "");
// range
sec->Set( (group+(*ci)->name+"/Range").c_str(), (*ci)->control_ref->range*100.0f, 100.0f);
// input mode
if ( (*ci)->control_ref->is_input )
{
const int mode = ((ControllerInterface::InputReference*)((*ci)->control_ref))->mode;
if (mode)
sec->Set((group+(*ci)->name+"/Mode").c_str(), mode);
else
sec->Delete((group+(*ci)->name+"/Mode").c_str());
}
}
// extensions