pcsx2: support both pnach and PNACH extension (linux is case sensitive...)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5642 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2013-05-25 08:33:30 +00:00
parent dfd4e9b216
commit 832016f757
1 changed files with 35 additions and 33 deletions

View File

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