mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Android: Fixed assets/game.love fusing not being recognized.
Fixes love2d/love-android#267.
This commit is contained in:
@@ -385,18 +385,20 @@ struct AssetInfo: public love::filesystem::physfs::PhysfsIo<AssetInfo>
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetInfo *duplicate() const
|
AssetInfo(const AssetInfo &other)
|
||||||
|
: assetManager(other.assetManager)
|
||||||
|
, size(strlen(other.filename) + 1)
|
||||||
{
|
{
|
||||||
AAsset *newAsset = AAssetManager_open(assetManager, filename, AASSET_MODE_RANDOM);
|
asset = AAssetManager_open(assetManager, other.filename, AASSET_MODE_RANDOM);
|
||||||
|
|
||||||
if (newAsset == nullptr)
|
if (asset == nullptr)
|
||||||
{
|
{
|
||||||
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
PHYSFS_setErrorCode(PHYSFS_ERR_OS_ERROR);
|
||||||
return nullptr;
|
throw new love::Exception("Unable to duplicate AssetInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
AAsset_seek64(asset, tell(), SEEK_SET);
|
filename = new (std::nothrow) char[size];
|
||||||
return fromAAsset(assetManager, filename, asset);
|
memcpy(filename, other.filename, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
~AssetInfo() override
|
~AssetInfo() override
|
||||||
|
|||||||
@@ -245,8 +245,14 @@ bool Filesystem::setSource(const char *source)
|
|||||||
if (hasFusedGame)
|
if (hasFusedGame)
|
||||||
{
|
{
|
||||||
if (gameLoveIO)
|
if (gameLoveIO)
|
||||||
// Actually we should just be able to mount gameLoveIO, but that's experimental.
|
{
|
||||||
|
if (PHYSFS_mountIo(gameLoveIO, ".zip", nullptr, 0)) {
|
||||||
|
gameSource = new_search_path;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
gameLoveIO->destroy(gameLoveIO);
|
gameLoveIO->destroy(gameLoveIO);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!love::android::initializeVirtualArchive())
|
if (!love::android::initializeVirtualArchive())
|
||||||
@@ -274,6 +280,8 @@ bool Filesystem::setSource(const char *source)
|
|||||||
gameSource = new_search_path;
|
gameSource = new_search_path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io->destroy(io);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user