Minor changes in file type handling

This commit is contained in:
Eduardo Bart
2013-01-27 23:23:53 -02:00
parent 4536c68f00
commit 773837da98
18 changed files with 43 additions and 50 deletions

View File

@@ -311,9 +311,16 @@ std::string ResourceManager::getUserDir()
return PHYSFS_getUserDir();
}
std::string ResourceManager::guessFileType(const std::string& filename, const std::string& type)
std::string ResourceManager::guessFilePath(const std::string& filename, const std::string& type)
{
if(g_resources.fileExists(filename))
if(isFileType(filename, type))
return filename;
return filename + "." + type;
}
bool ResourceManager::isFileType(const std::string& filename, const std::string& type)
{
if(stdext::ends_with(filename, std::string(".") + type))
return true;
return false;
}