Skip to content

Commit

Permalink
GCAdapter: Add a setting to toggle vibration
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieui committed Apr 26, 2015
1 parent 65c3a82 commit 8e987ad
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Source/Core/Core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend);
core->Set("GPUDeterminismMode", m_LocalCoreStartupParameter.m_strGPUDeterminismMode);
core->Set("GameCubeAdapter", m_GameCubeAdapter);
core->Set("AdapterVibration", m_AdapterVibration);
}

void SConfig::SaveMovieSettings(IniFile& ini)
Expand Down Expand Up @@ -621,6 +622,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("GFXBackend", &m_LocalCoreStartupParameter.m_strVideoBackend, "");
core->Get("GPUDeterminismMode", &m_LocalCoreStartupParameter.m_strGPUDeterminismMode, "auto");
core->Get("GameCubeAdapter", &m_GameCubeAdapter, true);
core->Get("AdapterVibration", &m_AdapterVibration, true);
}

void SConfig::LoadMovieSettings(IniFile& ini)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ struct SConfig : NonCopyable
// Input settings
bool m_BackgroundInput;
bool m_GameCubeAdapter;
bool m_AdapterVibration;

SysConf* m_SYSCONF;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/SI_GCAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void Input(int chan, GCPadStatus* pad)

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_AdapterVibration)
return;

// Skip over rumble commands if it has not changed or the controller is wireless
Expand Down
10 changes: 8 additions & 2 deletions Source/Core/DolphinWX/ControllerConfigDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,20 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer()
gamecube_static_sizer->AddSpacer(5);

wxStaticBoxSizer* const gamecube_adapter_group = new wxStaticBoxSizer(wxHORIZONTAL, this, _("GameCube Adapter"));
wxBoxSizer* const gamecube_adapter_sizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* const gamecube_adapter_sizer = new wxBoxSizer(wxHORIZONTAL);

wxCheckBox* const gamecube_adapter = new wxCheckBox(this, wxID_ANY, _("Direct Connect"));
gamecube_adapter->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnGameCubeAdapter, this);

wxCheckBox* const gamecube_vibration = new wxCheckBox(this, wxID_ANY, _("Vibration"));
gamecube_vibration->SetValue(SConfig::GetInstance().m_AdapterVibration);
gamecube_vibration->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnAdapterVibration, this);

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_vibration, 0, wxEXPAND);
gamecube_adapter_group->Add(gamecube_adapter_sizer, 0, wxEXPAND);
gamecube_static_sizer->Add(gamecube_adapter_group, 0, wxEXPAND);

Expand Down
6 changes: 6 additions & 0 deletions Source/Core/DolphinWX/ControllerConfigDiag.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class ControllerConfigDiag : public wxDialog
SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked();
event.Skip();
}
void OnAdapterVibration(wxCommandEvent& event)
{
SConfig::GetInstance().m_AdapterVibration = event.IsChecked();
event.Skip();
}


private:
wxStaticBoxSizer* CreateGamecubeSizer();
Expand Down

0 comments on commit 8e987ad

Please sign in to comment.