mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
revert to r4531, but keep the changes from the following revisions: 4533,4550-4551,4556-4559
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4566 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -50,11 +50,8 @@ void PADConfigDialognJoy::UpdateGUIButtonMapping(int controller)
|
||||
// http://wiki.wxwidgets.org/Converting_everything_to_and_from_wxString
|
||||
wxString tmp;
|
||||
|
||||
// Assert
|
||||
//if (!ControlsCreated[i]) return;
|
||||
|
||||
// Update selected gamepad
|
||||
m_Joyname[controller]->SetValue(wxString::FromAscii(PadMapping[controller].Name.c_str()));
|
||||
m_Joyname[controller]->SetSelection(PadMapping[controller].ID);
|
||||
|
||||
tmp << PadMapping[controller].buttons[InputCommon::CTL_L_SHOULDER]; m_JoyShoulderL[controller]->SetValue(tmp); tmp.clear();
|
||||
tmp << PadMapping[controller].buttons[InputCommon::CTL_R_SHOULDER]; m_JoyShoulderR[controller]->SetValue(tmp); tmp.clear();
|
||||
@ -102,8 +99,7 @@ void PADConfigDialognJoy::UpdateGUIButtonMapping(int controller)
|
||||
tmp << PadMapping[controller].dpad2[InputCommon::CTL_D_PAD_LEFT]; m_JoyDpadLeft[controller]->SetValue(tmp); tmp.clear();
|
||||
tmp << PadMapping[controller].dpad2[InputCommon::CTL_D_PAD_RIGHT]; m_JoyDpadRight[controller]->SetValue(tmp); tmp.clear();
|
||||
}
|
||||
|
||||
NOTICE_LOG(PAD, "Loaded from PadMapping[%i] to slot %i", controller, controller);
|
||||
|
||||
}
|
||||
|
||||
/* Populate the PadMapping array with the dialog items settings (for example
|
||||
@ -121,21 +117,7 @@ void PADConfigDialognJoy::SaveButtonMapping(int controller, bool DontChangeId, i
|
||||
ToBlank(false);
|
||||
|
||||
// Set other settings
|
||||
if(!DontChangeId)
|
||||
{
|
||||
if (joyinfo.size() > m_Joyname[FromSlot]->GetSelection())
|
||||
{
|
||||
INFO_LOG(PAD, "%i: Changed PadMapping ID from %i to %i", controller, PadMapping[controller].ID, joyinfo.at(m_Joyname[FromSlot]->GetSelection()).ID);
|
||||
PadMapping[controller].ID = joyinfo.at(m_Joyname[FromSlot]->GetSelection()).ID;
|
||||
}
|
||||
//else
|
||||
// Assert
|
||||
PadMapping[controller].Name = m_Joyname[FromSlot]->GetValue().mb_str();
|
||||
}
|
||||
|
||||
NOTICE_LOG(PAD, "Saved PadMapping[%i] from slot %i", controller, FromSlot);
|
||||
|
||||
// Settings
|
||||
if(!DontChangeId) PadMapping[controller].ID = m_Joyname[FromSlot]->GetSelection();
|
||||
PadMapping[controller].controllertype = m_ControlType[FromSlot]->GetSelection();
|
||||
PadMapping[controller].triggertype = m_TriggerType[FromSlot]->GetSelection();
|
||||
PadMapping[controller].deadzone = m_Deadzone[FromSlot]->GetSelection();
|
||||
@ -282,13 +264,6 @@ void PADConfigDialognJoy::GetButtons(wxCommandEvent& event)
|
||||
|
||||
void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
{
|
||||
//INFO_LOG(PAD, "DoGetButtons: %i", GetId);
|
||||
|
||||
if (!SDLPolling || SDL_JoystickEventState(SDL_QUERY) == SDL_ENABLE) return;
|
||||
|
||||
// Turn off live updates because the change the joy handles
|
||||
LiveUpdates = false;
|
||||
|
||||
// =============================================
|
||||
// Collect the starting values
|
||||
// ----------------
|
||||
@ -305,7 +280,7 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
int Axes = SDL_JoystickNumAxes(joy);
|
||||
int Hats = SDL_JoystickNumHats(joy);
|
||||
|
||||
//NOTICE_LOG(PAD, "PadID: %i Axes: %i Handle: %i\n", PadID, joyinfo[PadID].NumAxes, joyinfo[PadID].joy);
|
||||
INFO_LOG(CONSOLE, "PadID: %i Axes: %i\n", PadID, joyinfo[PadID].NumAxes, joyinfo[PadID].joy);
|
||||
|
||||
// Get the controller and trigger type
|
||||
int ControllerType = PadMapping[Controller].controllertype;
|
||||
@ -368,8 +343,6 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
#if wxUSE_TIMER
|
||||
m_ButtonMappingTimer->Start( floor((double)(1000 / TimesPerSecond)) );
|
||||
#endif
|
||||
|
||||
//INFO_LOG(PAD, "Timer started");
|
||||
}
|
||||
|
||||
// ===============================================
|
||||
@ -380,7 +353,7 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
else
|
||||
{
|
||||
InputCommon::GetButton(
|
||||
joy, PadID,
|
||||
joy, PadID, Buttons, Axes, Hats,
|
||||
g_Pressed, value, type, pressed, Succeed, Stop,
|
||||
LeftRight, Axis, XInput, Button, Hat, NoTriggerFilter);
|
||||
}
|
||||
@ -395,7 +368,7 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
GetButtonWaitingTimer++;
|
||||
|
||||
// This is run every second
|
||||
if (GetButtonWaitingTimer % TimesPerSecond == 0)
|
||||
if(GetButtonWaitingTimer % TimesPerSecond == 0)
|
||||
{
|
||||
// Current time
|
||||
int TmpTime = Seconds - (GetButtonWaitingTimer / TimesPerSecond);
|
||||
@ -406,7 +379,7 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
}
|
||||
|
||||
// Time's up
|
||||
if ( (GetButtonWaitingTimer / TimesPerSecond) >= Seconds )
|
||||
if( (GetButtonWaitingTimer / TimesPerSecond) >= Seconds )
|
||||
{
|
||||
Stop = true;
|
||||
// Leave a blank mapping
|
||||
@ -414,10 +387,8 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
}
|
||||
|
||||
// If we got a button
|
||||
if (Succeed)
|
||||
if(Succeed)
|
||||
{
|
||||
//INFO_LOG(PAD, "Button mapping succeeded: %i", pressed);
|
||||
|
||||
Stop = true;
|
||||
// Write the number of the pressed button to the text box
|
||||
sprintf(format, "%d", pressed);
|
||||
@ -425,12 +396,10 @@ void PADConfigDialognJoy::DoGetButtons(int GetId)
|
||||
}
|
||||
|
||||
// Stop the timer
|
||||
if (Stop)
|
||||
if(Stop)
|
||||
{
|
||||
m_ButtonMappingTimer->Stop();
|
||||
GetButtonWaitingTimer = 0;
|
||||
LiveUpdates = true;
|
||||
//INFO_LOG(PAD, "Timer stopped");
|
||||
|
||||
/* Update the button mapping for all slots that use this device. (It doesn't make sense to have several slots
|
||||
controlled by the same device, but several DirectInput instances of different but identical devices may possible
|
||||
|
Reference in New Issue
Block a user