mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user