Added support for X360pad rumble

Need someone who has a X360pad to test.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4929 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2010-01-23 12:36:30 +00:00
parent 2098271bc8
commit 1ecbcb39ea
5 changed files with 163 additions and 90 deletions

View File

@ -35,6 +35,10 @@
#include "Encryption.h" // for extension encryption
#include "Config.h" // for g_Config
#ifdef _WIN32
#include "XInput.h"
#endif
extern SWiimoteInitialize g_WiimoteInitialize;
namespace WiiMoteEmu
@ -87,9 +91,16 @@ bool Search_Devices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_N
{
if (_NumPads > WiiMapping[i].ID)
if(_joyinfo.at(WiiMapping[i].ID).Good)
{
WiiMapping[i].joy = _joyinfo.at(WiiMapping[i].ID).joy;
#ifdef _WIN32
XINPUT_STATE xstate;
DWORD xresult = XInputGetState(WiiMapping[i].ID, &xstate);
if (xresult == ERROR_SUCCESS)
WiiMapping[i].TriggerType = InputCommon::CTL_TRIGGER_XINPUT;
#endif
}
}
return WasGotten;
}