New GCPad/Wiimote: Hopefully fixed lock up issues with DirectInput devices. Wiimote tilt should work with keyboard keys/gamepad buttons now as well as IR Forward/Backward(which was added). Made input detection buttons display "[ waiting ]" while waiting for input. minor fixes/cleanups.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5651 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2010-06-12 02:08:01 +00:00
parent d937b73d9c
commit ff5081942a
9 changed files with 121 additions and 70 deletions

View File

@ -18,14 +18,11 @@ namespace ciface
namespace SDL
{
// just a struct with an int that is set to ZERO by default
struct ZeroedInt{ZeroedInt():value(0){}unsigned int value;};
void Init( std::vector<ControllerInterface::Device*>& devices )
{
// this is used to number the joysticks
// multiple joysticks with the same name shall get unique ids starting at 0
std::map<std::string, ZeroedInt> name_counts;
std::map<std::string, int> name_counts;
if (SDL_Init( SDL_INIT_FLAGS ) >= 0)
{
@ -35,7 +32,7 @@ void Init( std::vector<ControllerInterface::Device*>& devices )
SDL_Joystick* dev = SDL_JoystickOpen(i);
if ( dev )
{
Joystick* js = new Joystick(dev, i, name_counts[SDL_JoystickName(i)].value++);
Joystick* js = new Joystick(dev, i, name_counts[SDL_JoystickName(i)]++);
// only add if it has some inputs/outputs
if ( js->Inputs().size() || js->Outputs().size() )
devices.push_back( js );