mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 15:30:35 +00:00
Shortcut IdentifyFile (which is now used by GameInfoCache) by trusting the file extensions.
This commit is contained in:
parent
e5050442be
commit
9e345132b9
@ -34,6 +34,16 @@ EmuFileType Identify_File(std::string &filename)
|
||||
return FILETYPE_ERROR;
|
||||
}
|
||||
|
||||
std::string extension = filename.substr(filename.size() - 4);
|
||||
if (!strcasecmp(extension.c_str(),".iso"))
|
||||
{
|
||||
return FILETYPE_PSP_ISO;
|
||||
}
|
||||
else if (!strcasecmp(extension.c_str(),".cso"))
|
||||
{
|
||||
return FILETYPE_PSP_ISO;
|
||||
}
|
||||
|
||||
// First, check if it's a directory with an EBOOT.PBP in it.
|
||||
FileInfo info;
|
||||
if (!getFileInfo(filename.c_str(), &info)) {
|
||||
@ -75,8 +85,6 @@ EmuFileType Identify_File(std::string &filename)
|
||||
|
||||
fclose(f);
|
||||
|
||||
std::string extension = filename.substr(filename.size() - 4);
|
||||
|
||||
if (id == 'FLE\x7F')
|
||||
{
|
||||
if (!strcasecmp(extension.c_str(), ".plf") || strstr(filename.c_str(),"BOOT.BIN") ||
|
||||
@ -110,14 +118,6 @@ EmuFileType Identify_File(std::string &filename)
|
||||
ERROR_LOG(LOADER, "A PBP with the wrong magic number?");
|
||||
return FILETYPE_PSP_PBP;
|
||||
}
|
||||
else if (!strcasecmp(extension.c_str(),".iso"))
|
||||
{
|
||||
return FILETYPE_PSP_ISO;
|
||||
}
|
||||
else if (!strcasecmp(extension.c_str(),".cso"))
|
||||
{
|
||||
return FILETYPE_PSP_ISO;
|
||||
}
|
||||
else if (!strcasecmp(extension.c_str(),".bin"))
|
||||
{
|
||||
return FILETYPE_UNKNOWN_BIN;
|
||||
|
Loading…
Reference in New Issue
Block a user