Adds Support for multiple GameCube Controllers

Conflicts:

	Source/Core/DolphinWX/Src/Frame.cpp
This commit is contained in:
Braden 2012-11-11 15:35:08 -06:00 committed by Rachel Bryk
parent 8a4b6f3d73
commit 59d6df7046
4 changed files with 64 additions and 7 deletions

View file

@ -328,6 +328,10 @@ CFrame::CFrame(wxFrame* parent,
m_LogWindow->Disable();
g_TASInputDlg = new TASInputDlg(this);
g_TASInputDlg1 = new TASInputDlg(this);
g_TASInputDlg2 = new TASInputDlg(this);
g_TASInputDlg3 = new TASInputDlg(this);
Movie::SetInputManip(TASManipFunction);
State::SetOnAfterLoadCallback(OnAfterLoadCallback);
@ -793,14 +797,41 @@ void OnAfterLoadCallback()
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
{
if (main_frame)
if (main_frame && controllerID == 0)
main_frame->g_TASInputDlg->GetValues(PadStatus, controllerID);
if (main_frame && controllerID == 1)
main_frame->g_TASInputDlg1->GetValues(PadStatus, controllerID);
if (main_frame && controllerID == 2)
main_frame->g_TASInputDlg2->GetValues(PadStatus, controllerID);
if (main_frame && controllerID == 3)
main_frame->g_TASInputDlg3->GetValues(PadStatus, controllerID);
}
bool TASInputHasFocus()
{
if(main_frame->g_TASInputDlg->HasFocus())
return true;
if(main_frame->g_TASInputDlg1->HasFocus())
return true;
if(main_frame->g_TASInputDlg2->HasFocus())
return true;
if(main_frame->g_TASInputDlg3->HasFocus())
return true;
return false;
}
void CFrame::OnKeyDown(wxKeyEvent& event)
{
if(Core::GetState() != Core::CORE_UNINITIALIZED &&
(RendererHasFocus() || g_TASInputDlg->HasFocus()))
(RendererHasFocus() || TASInputHasFocus()))
{
int WiimoteId = -1;
// Toggle fullscreen
@ -834,7 +865,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
else
{
unsigned int i = NUM_HOTKEYS;
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain || g_TASInputDlg->HasFocus())
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain || TASInputHasFocus())
{
for (i = 0; i < NUM_HOTKEYS; i++)
{