GCAdapter: Add a setting to toggle rumble

This commit is contained in:
mathieui 2015-04-27 00:42:12 +02:00
parent 57f458fe9b
commit ec7445d66b
5 changed files with 16 additions and 2 deletions

View File

@ -354,6 +354,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend); core->Set("GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend);
core->Set("GPUDeterminismMode", m_LocalCoreStartupParameter.m_strGPUDeterminismMode); core->Set("GPUDeterminismMode", m_LocalCoreStartupParameter.m_strGPUDeterminismMode);
core->Set("GameCubeAdapter", m_GameCubeAdapter); core->Set("GameCubeAdapter", m_GameCubeAdapter);
core->Set("AdapterRumble", m_AdapterRumble);
} }
void SConfig::SaveMovieSettings(IniFile& ini) void SConfig::SaveMovieSettings(IniFile& ini)
@ -621,6 +622,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("GFXBackend", &m_LocalCoreStartupParameter.m_strVideoBackend, ""); core->Get("GFXBackend", &m_LocalCoreStartupParameter.m_strVideoBackend, "");
core->Get("GPUDeterminismMode", &m_LocalCoreStartupParameter.m_strGPUDeterminismMode, "auto"); core->Get("GPUDeterminismMode", &m_LocalCoreStartupParameter.m_strGPUDeterminismMode, "auto");
core->Get("GameCubeAdapter", &m_GameCubeAdapter, true); core->Get("GameCubeAdapter", &m_GameCubeAdapter, true);
core->Get("AdapterRumble", &m_AdapterRumble, true);
} }
void SConfig::LoadMovieSettings(IniFile& ini) void SConfig::LoadMovieSettings(IniFile& ini)

View File

@ -116,6 +116,7 @@ struct SConfig : NonCopyable
// Input settings // Input settings
bool m_BackgroundInput; bool m_BackgroundInput;
bool m_GameCubeAdapter; bool m_GameCubeAdapter;
bool m_AdapterRumble;
SysConf* m_SYSCONF; SysConf* m_SYSCONF;

View File

@ -392,7 +392,7 @@ void Input(int chan, GCPadStatus* pad)
void Output(int chan, u8 rumble_command) void Output(int chan, u8 rumble_command)
{ {
if (s_handle == nullptr || !SConfig::GetInstance().m_GameCubeAdapter) if (s_handle == nullptr || !SConfig::GetInstance().m_GameCubeAdapter || !SConfig::GetInstance().m_AdapterRumble)
return; return;
// Skip over rumble commands if it has not changed or the controller is wireless // Skip over rumble commands if it has not changed or the controller is wireless

View File

@ -155,10 +155,16 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer()
wxCheckBox* const gamecube_adapter = new wxCheckBox(this, wxID_ANY, _("Direct Connect")); wxCheckBox* const gamecube_adapter = new wxCheckBox(this, wxID_ANY, _("Direct Connect"));
gamecube_adapter->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnGameCubeAdapter, this); gamecube_adapter->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnGameCubeAdapter, this);
wxCheckBox* const gamecube_rumble = new wxCheckBox(this, wxID_ANY, _("Rumble"));
gamecube_rumble->SetValue(SConfig::GetInstance().m_AdapterRumble);
gamecube_rumble->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnAdapterRumble, this);
m_adapter_status = new wxStaticText(this, wxID_ANY, _("Adapter Not Detected")); m_adapter_status = new wxStaticText(this, wxID_ANY, _("Adapter Not Detected"));
gamecube_adapter_sizer->Add(m_adapter_status, 0, wxEXPAND); gamecube_adapter_group->Add(m_adapter_status, 0, wxEXPAND);
gamecube_adapter_sizer->Add(gamecube_adapter, 0, wxEXPAND); gamecube_adapter_sizer->Add(gamecube_adapter, 0, wxEXPAND);
gamecube_adapter_sizer->Add(gamecube_rumble, 0, wxEXPAND);
gamecube_adapter_group->Add(gamecube_adapter_sizer, 0, wxEXPAND); gamecube_adapter_group->Add(gamecube_adapter_sizer, 0, wxEXPAND);
gamecube_static_sizer->Add(gamecube_adapter_group, 0, wxEXPAND); gamecube_static_sizer->Add(gamecube_adapter_group, 0, wxEXPAND);

View File

@ -74,6 +74,11 @@ private:
SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked(); SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked();
event.Skip(); event.Skip();
} }
void OnAdapterRumble(wxCommandEvent& event)
{
SConfig::GetInstance().m_AdapterRumble = event.IsChecked();
}
wxStaticBoxSizer* CreateGamecubeSizer(); wxStaticBoxSizer* CreateGamecubeSizer();
wxStaticBoxSizer* CreateWiimoteConfigSizer(); wxStaticBoxSizer* CreateWiimoteConfigSizer();