Automatically connect the appropriate controllers for netplay.

This commit is contained in:
Rachel Bryk 2013-07-19 15:53:20 -04:00
parent 0e1efd7d38
commit 919e54c695
3 changed files with 8 additions and 0 deletions

View File

@ -262,6 +262,8 @@ void Init()
if (Movie::IsRecordingInput() || Movie::IsPlayingInput())
AddDevice(Movie::IsUsingPad(i) ? (Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
else if (NetPlay::GetNetPlayPtr())
AddDevice(NetPlay::IsUsingPad(i) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i);
else
AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
}

View File

@ -391,3 +391,8 @@ NetPlay* NetPlay::GetNetPlayPtr()
{
return netplay_ptr;
}
bool NetPlay::IsUsingPad(int pad)
{
return netplay_ptr->m_local_player->pad_map[pad] != -1;
}

View File

@ -120,6 +120,7 @@ public:
u8 GetPadNum(u8 numPAD);
static NetPlay* GetNetPlayPtr();
static bool IsUsingPad(int pad);
protected:
//void GetBufferedPad(const u8 pad_nb, NetPad* const netvalues);