Revert pr#3660

https://github.com/dolphin-emu/dolphin/pull/3660
This commit is contained in:
mimimi085181 2016-06-26 10:54:49 +02:00
parent 330289cf71
commit 4f9fe41ee6
3 changed files with 56 additions and 29 deletions

View File

@ -713,23 +713,23 @@ bool NetPlayClient::StartGame(const std::string& path)
m_dialog->BootGame(path); m_dialog->BootGame(path);
if (SConfig::GetInstance().bWii) if (SConfig::GetInstance().bWii)
{ {
for (unsigned int i = 0; i < 4; ++i) for (unsigned int i = 0; i < 4; ++i)
WiimoteReal::ChangeWiimoteSource(i, WiimoteReal::ChangeWiimoteSource(i,
m_wiimote_map[i] > 0 ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE); m_wiimote_map[i] > 0 ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE);
// Needed to prevent locking up at boot if (when) the wiimotes connect out of order. // Needed to prevent locking up at boot if (when) the wiimotes connect out of order.
NetWiimote nw; NetWiimote nw;
nw.resize(4, 0); nw.resize(4, 0);
for (unsigned int w = 0; w < 4; ++w) for (unsigned int w = 0; w < 4; ++w)
{ {
if (m_wiimote_map[w] != -1) if (m_wiimote_map[w] != -1)
// probably overkill, but whatever // probably overkill, but whatever
for (unsigned int i = 0; i < 7; ++i) for (unsigned int i = 0; i < 7; ++i)
m_wiimote_buffer[w].Push(nw); m_wiimote_buffer[w].Push(nw);
} }
} }
UpdateDevices(); UpdateDevices();

View File

@ -483,6 +483,7 @@ void NetPlayDialog::OnAssignPads(wxCommandEvent&)
pmd.ShowModal(); pmd.ShowModal();
netplay_server->SetPadMapping(pmd.GetModifiedPadMappings()); netplay_server->SetPadMapping(pmd.GetModifiedPadMappings());
netplay_server->SetWiimoteMapping(pmd.GetModifiedWiimoteMappings());
} }
void NetPlayDialog::OnKick(wxCommandEvent&) void NetPlayDialog::OnKick(wxCommandEvent&)

View File

@ -11,11 +11,9 @@
#include "Core/NetPlayServer.h" #include "Core/NetPlayServer.h"
#include "DolphinWX/NetPlay/PadMapDialog.h" #include "DolphinWX/NetPlay/PadMapDialog.h"
// Removed Wiimote UI elements due to Wiimotes being flat out broken in netplay.
PadMapDialog::PadMapDialog(wxWindow* parent, NetPlayServer* server, NetPlayClient* client) PadMapDialog::PadMapDialog(wxWindow* parent, NetPlayServer* server, NetPlayClient* client)
: wxDialog(parent, wxID_ANY, _("Controller Ports")), m_pad_mapping(server->GetPadMapping()), : wxDialog(parent, wxID_ANY, _("Controller Ports")), m_pad_mapping(server->GetPadMapping()),
m_player_list(client->GetPlayers()) m_wii_mapping(server->GetWiimoteMapping()), m_player_list(client->GetPlayers())
{ {
wxBoxSizer* const h_szr = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* const h_szr = new wxBoxSizer(wxHORIZONTAL);
h_szr->AddSpacer(10); h_szr->AddSpacer(10);
@ -52,6 +50,34 @@ PadMapDialog::PadMapDialog(wxWindow* parent, NetPlayServer* server, NetPlayClien
h_szr->AddSpacer(10); h_szr->AddSpacer(10);
} }
for (unsigned int i = 0; i < 4; ++i)
{
wxBoxSizer* const v_szr = new wxBoxSizer(wxVERTICAL);
v_szr->Add(new wxStaticText(this, wxID_ANY, (wxString(_("Wiimote ")) + (wxChar)('1' + i))), 1,
wxALIGN_CENTER_HORIZONTAL);
m_map_cbox[i + 4] =
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, player_names);
m_map_cbox[i + 4]->Bind(wxEVT_CHOICE, &PadMapDialog::OnAdjust, this);
if (m_wii_mapping[i] == -1)
{
m_map_cbox[i + 4]->Select(0);
}
else
{
for (unsigned int j = 0; j < m_player_list.size(); j++)
{
if (m_wii_mapping[i] == m_player_list[j]->pid)
m_map_cbox[i + 4]->Select(j + 1);
}
}
v_szr->Add(m_map_cbox[i + 4], 1);
h_szr->Add(v_szr, 1, wxTOP | wxEXPAND, 20);
h_szr->AddSpacer(10);
}
wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL);
main_szr->Add(h_szr); main_szr->Add(h_szr);
main_szr->AddSpacer(5); main_szr->AddSpacer(5);
@ -66,9 +92,9 @@ PadMappingArray PadMapDialog::GetModifiedPadMappings() const
return m_pad_mapping; return m_pad_mapping;
} }
PadMappingArray PadMapDialog::GetModifiedWiimoteMappings() const PadMappingArray PadMapDialog::GetModifiedWiimoteMappings() const
{ {
return m_wii_mapping; return m_wii_mapping;
} }
void PadMapDialog::OnAdjust(wxCommandEvent& WXUNUSED(event)) void PadMapDialog::OnAdjust(wxCommandEvent& WXUNUSED(event))
@ -80,11 +106,11 @@ void PadMapDialog::OnAdjust(wxCommandEvent& WXUNUSED(event))
m_pad_mapping[i] = m_player_list[player_idx - 1]->pid; m_pad_mapping[i] = m_player_list[player_idx - 1]->pid;
else else
m_pad_mapping[i] = -1; m_pad_mapping[i] = -1;
player_idx = m_map_cbox[i + 4]->GetSelection(); player_idx = m_map_cbox[i + 4]->GetSelection();
if (player_idx > 0) if (player_idx > 0)
m_wii_mapping[i] = m_player_list[player_idx - 1]->pid; m_wii_mapping[i] = m_player_list[player_idx - 1]->pid;
else else
m_wii_mapping[i] = -1; m_wii_mapping[i] = -1;
} }
} }