nJoy: Config fix

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1791 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-01-05 06:35:59 +00:00
parent d6ad009d7a
commit 6517f80316
5 changed files with 9 additions and 8 deletions

View File

@ -41,6 +41,7 @@ Config::Config()
{
//memset(this, 0, sizeof(Config)); // Clear the memory
bSaveByID.resize(4); // Set vector size
bSquareToCircle.resize(4); // Set vector size
}
@ -231,7 +232,7 @@ void Config::Save(bool CheckedForDuplicates)
file.Set(SectionName.c_str(), "eventnum", joysticks[i].eventnum);
file.Set(SectionName.c_str(), "Diagonal", g_Config.SDiagonal);
file.Set(SectionName.c_str(), "SquareToCircle", g_Config.bSquareToCircle);
file.Set(SectionName.c_str(), "SquareToCircle", g_Config.bSquareToCircle.at(i));
}
file.Save("nJoy.ini");
@ -304,7 +305,7 @@ void Config::Load(bool config)
file.Get(SectionName.c_str(), "eventnum", &joysticks[i].eventnum, 0);
file.Get(SectionName.c_str(), "Diagonal", &g_Config.SDiagonal, "100%");
file.Get(SectionName.c_str(), "SquareToCircle", &g_Config.bSquareToCircle, false);
file.Get(SectionName.c_str(), "SquareToCircle", &Tmp, false); g_Config.bSquareToCircle.at(i) = Tmp;
}
}

View File

@ -31,7 +31,7 @@ struct Config
// Joystick
std::string SDiagonal;
bool bSquareToCircle;
std::vector<bool> bSquareToCircle;
};
extern Config g_Config;

View File

@ -80,7 +80,7 @@ void ConfigBox::PadGetStatus()
// Get adjusted values
int main_x_after = main_x, main_y_after = main_y;
if(g_Config.bSquareToCircle)
if(g_Config.bSquareToCircle.at(notebookpage))
{
std::vector<int> main_xy = Pad_Square_to_Circle(main_x, main_y);
main_x_after = main_xy.at(0);

View File

@ -225,7 +225,7 @@ void ConfigBox::ChangeSettings( wxCommandEvent& event )
g_Config.SDiagonal = m_CoBDiagonal[notebookpage]->GetLabel().mb_str();
case IDCB_MAINSTICK_S_TO_C:
g_Config.bSquareToCircle = m_CBS_to_C[notebookpage]->IsChecked();
g_Config.bSquareToCircle.at(notebookpage) = m_CBS_to_C[notebookpage]->IsChecked();
}
}
@ -265,8 +265,8 @@ void ConfigBox::DoEnableDisable(int _notebookpage)
m_CBShowAdvanced[_notebookpage]->SetValue(g_Config.bShowAdvanced);
// Advanced settings
m_CoBDiagonal[notebookpage]->SetValue(wxString::FromAscii(g_Config.SDiagonal.c_str()));
m_CBS_to_C[notebookpage]->SetValue(g_Config.bSquareToCircle);
m_CoBDiagonal[_notebookpage]->SetValue(wxString::FromAscii(g_Config.SDiagonal.c_str()));
m_CBS_to_C[_notebookpage]->SetValue(g_Config.bSquareToCircle.at(_notebookpage));
m_Controller[_notebookpage]->Refresh(); // Repaint the background

View File

@ -401,7 +401,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
int i_sub_stick_y = -joystate[_numPAD].axis[CTL_SUB_Y];
// Check if we should make adjustments
if(g_Config.bSquareToCircle)
if(g_Config.bSquareToCircle.at(_numPAD))
{
std::vector<int> main_xy = Pad_Square_to_Circle(i_main_stick_x, i_main_stick_y);
i_main_stick_x = main_xy.at(0);