pcsx2: redo cheat loading on linux. Now it will be fully case insensitive.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5645 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2013-05-27 16:41:22 +00:00
parent 832016f757
commit ae5f9f812d
1 changed files with 3 additions and 8 deletions

View File

@ -182,9 +182,9 @@ static int LoadCheatsFiles(const wxDirName& folderName, wxString& fileSpec, cons
int before = cheatnumber;
wxString buffer;
wxTextFile f;
bool found = dir.GetFirst(&buffer, fileSpec, wxDIR_FILES);
bool found = dir.GetFirst(&buffer, L"*", wxDIR_FILES);
while (found) {
if (buffer.Matches(L"*.pnach") || buffer.Matches(L"*.PNACH")) {
if (buffer.Upper().Matches(fileSpec.Upper())) {
Console.WriteLn(Color_Gray, L"Found %s file: '%s'", friendlyName.c_str(), buffer.c_str());
int before = cheatnumber;
f.Open(Path::Combine(dir.GetName(), buffer));
@ -211,14 +211,9 @@ int LoadCheats(wxString name, const wxDirName& folderName, const wxString& frien
int loaded = 0;
wxString filespec = name + L"*.*";
wxString filespec = name + L"*.pnach";
loaded += LoadCheatsFiles(folderName, filespec, friendlyName);
if (wxFileName::IsCaseSensitive() && name != name.Upper()) {
filespec = name.Upper() + L"*.*";
loaded += LoadCheatsFiles(folderName, filespec, friendlyName);
}
Console.WriteLn((loaded ? Color_Green : Color_Gray), L"Overall %d %s loaded", loaded, friendlyName.c_str());
return loaded;
}