Set game source path when using virtual archive in Android.

This will also prevent double `love.filesystem.setSource()` call
in that case.
This commit is contained in:
Miku AuahDark
2021-11-05 15:22:03 +08:00
parent 3a18a2ab0d
commit 1bb22d2e90
+7 -5
View File
@@ -232,15 +232,13 @@ bool Filesystem::setSource(const char *source)
PHYSFS_Io *gameLoveIO;
bool hasFusedGame = love::android::checkFusedGame((void **) &gameLoveIO);
bool isAAssetMounted = false;
if (hasFusedGame)
{
if (gameLoveIO)
{
// Actually we should just be able to mount gameLoveIO, but that's experimental.
gameLoveIO->destroy(gameLoveIO);
goto oldschool;
}
else
{
if (!love::android::initializeVirtualArchive())
@@ -248,11 +246,15 @@ bool Filesystem::setSource(const char *source)
SDL_Log("Unable to mount AAsset: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
return false;
}
// See love::android::initializeVirtualArchive()
new_search_path = "ASET.AASSET";
isAAssetMounted = true;
}
}
else
if (!isAAssetMounted)
{
oldschool:
new_search_path = love::android::getSelectedGameFile();
// try mounting first, if that fails, load to memory and mount