Android: Fixed assets/game.love fusing not being recognized.

Fixes love2d/love-android#267.
This commit is contained in:
Miku AuahDark
2024-03-19 22:24:45 +08:00
parent 4d1865fe1a
commit 9eacd483c6
2 changed files with 17 additions and 7 deletions
+8 -6
View File
@@ -385,18 +385,20 @@ struct AssetInfo: public love::filesystem::physfs::PhysfsIo<AssetInfo>
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);
return nullptr;
throw new love::Exception("Unable to duplicate AssetInfo");
}
AAsset_seek64(asset, tell(), SEEK_SET);
return fromAAsset(assetManager, filename, asset);
filename = new (std::nothrow) char[size];
memcpy(filename, other.filename, size);
}
~AssetInfo() override