This should fix Issue 1798

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4760 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-12-31 17:42:55 +00:00
parent 40f4dd30c2
commit ba25f038af
5 changed files with 38 additions and 23 deletions

View File

@ -164,8 +164,8 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, in
else
{
// XInput triggers for Xbox360 pads
_PadState.axis[CTL_L_SHOULDER] = XInput::GetXI(0, _PadMapping.buttons[CTL_L_SHOULDER] - 1000);
_PadState.axis[CTL_R_SHOULDER] = XInput::GetXI(0, _PadMapping.buttons[CTL_R_SHOULDER] - 1000);
_PadState.axis[CTL_L_SHOULDER] = XInput::GetXI(Controller, _PadMapping.buttons[CTL_L_SHOULDER] - 1000);
_PadState.axis[CTL_R_SHOULDER] = XInput::GetXI(Controller, _PadMapping.buttons[CTL_R_SHOULDER] - 1000);
}
#endif
@ -326,7 +326,7 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
{
for(int i = 0; i <= InputCommon::XI_TRIGGER_R; i++)
{
if(XInput::GetXI(0, i))
if(XInput::GetXI(ControllerID, i))
{
pressed = i + 1000;
type = InputCommon::CTL_AXIS;

View File

@ -187,7 +187,7 @@ void WiimotePadConfigDialog::DoGetButtons(int _GetId)
else if (WiiMoteEmu::NumGoodPads > 0)
{
InputCommon::GetButton(
WiiMoteEmu::joyinfo[PadID].joy, PadID, WiiMoteEmu::joyinfo[PadID].NumButtons, WiiMoteEmu::joyinfo[PadID].NumAxes, WiiMoteEmu::joyinfo[PadID].NumHats,
WiiMoteEmu::WiiMapping[m_Page].joy, PadID, WiiMoteEmu::joyinfo[PadID].NumButtons, WiiMoteEmu::joyinfo[PadID].NumAxes, WiiMoteEmu::joyinfo[PadID].NumHats,
KeyPressed, value, type, pressed, Succeed, Stop,
LeftRight, Axis, XInput, Button, Hat, NoTriggerFilter);
}

View File

@ -129,10 +129,12 @@ PADConfigDialognJoy::PADConfigDialognJoy(wxWindow *parent, wxWindowID id, const
// Reset values
GetButtonWaitingID = 0; GetButtonWaitingTimer = 0;
// Start the constant timer
int TimesPerSecond = 10;
m_ConstantTimer->Start(1000 / TimesPerSecond);
if (NumGoodPads)
{
// Start the constant timer
int TimesPerSecond = 10;
m_ConstantTimer->Start(1000 / TimesPerSecond);
}
#endif
// wxEVT_KEY_DOWN is blocked for enter, tab and the directional keys
@ -166,6 +168,7 @@ void PADConfigDialognJoy::OnClose(wxCloseEvent& event)
// Close pads, unless we are running a game
//if (!g_EmulatorRunning) Shutdown();
g_FrameOpen = false;
EndModal(wxID_CLOSE);
}

View File

@ -48,6 +48,7 @@ std::vector<InputCommon::CONTROLLER_INFO> joyinfo;
InputCommon::CONTROLLER_STATE PadState[4];
InputCommon::CONTROLLER_MAPPING PadMapping[4];
bool g_EmulatorRunning = false;
bool g_FrameOpen = false;
int NumPads = 0, NumGoodPads = 0, LastPad = 0;
#ifdef _WIN32
HWND m_hWnd = NULL, m_hConsole = NULL; // Handle to window
@ -154,11 +155,13 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
// ------------------
void DllConfig(HWND _hParent)
{
// Init Joystick + Haptic (force feedback) subsystem on SDL 1.3
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
g_Config.Load(); // load settings
if (!g_EmulatorRunning)
{
g_Config.Load(); // load settings
// Init Joystick + Haptic (force feedback) subsystem on SDL 1.3
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
}
#if defined(HAVE_WX) && HAVE_WX
if (!m_ConfigFrame)
@ -168,9 +171,15 @@ void DllConfig(HWND _hParent)
// Only allow one open at a time
if (!m_ConfigFrame->IsShown())
{
g_FrameOpen = true;
m_ConfigFrame->ShowModal();
}
else
{
g_FrameOpen = false;
m_ConfigFrame->Hide();
}
#endif
}
@ -185,18 +194,20 @@ void Initialize(void *init)
g_PADInitialize = (SPADInitialize*)init;
g_EmulatorRunning = true;
#ifdef _WIN32
m_hWnd = (HWND)g_PADInitialize->hWnd;
#endif
#ifdef _WIN32
m_hWnd = (HWND)g_PADInitialize->hWnd;
#endif
#ifdef _DEBUG
DEBUG_INIT();
#endif
#ifdef _DEBUG
DEBUG_INIT();
#endif
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
g_Config.Load(); // load settings
if (!g_FrameOpen)
{
g_Config.Load(); // load settings
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
}
}
void Close_Devices()

View File

@ -95,6 +95,7 @@
#ifdef _WIN32
extern HWND m_hWnd, m_hConsole; // Handle to window
#endif
extern bool g_FrameOpen;
extern int NumPads, NumGoodPads, LastPad; // Number of goods pads
#endif