Add FILESYSTEM_isAssetMounted()

This function will check if a specific file is a mounted per-level
custom asset, instead of being a variable that's true if ANY file is a
mounted asset.
This commit is contained in:
Misa
2021-03-06 10:48:02 -08:00
committed by Ethan Lee
parent ca4afcc140
commit 34865a8ef1
2 changed files with 21 additions and 0 deletions

View File

@@ -361,6 +361,26 @@ void FILESYSTEM_unmountassets(void)
FILESYSTEM_assetsmounted = false;
}
bool FILESYSTEM_isAssetMounted(const char* filename)
{
const char* realDir;
/* Fast path */
if (assetDir[0] == '\0')
{
return false;
}
realDir = PHYSFS_getRealDir(filename);
if (realDir == NULL)
{
return false;
}
return SDL_strcmp(assetDir, realDir) == 0;
}
void FILESYSTEM_freeMemory(unsigned char **mem);
void FILESYSTEM_loadFileToMemory(