Added option to specify Android asset reading mode.

This commit is contained in:
Frederik Seiffert 2019-05-24 09:29:24 +02:00
parent ba4948fd97
commit 9f01876102
4 changed files with 17 additions and 3 deletions

View file

@ -3286,6 +3286,11 @@ IF_NO_GC(
}
+ (AAsset *)assetForPath:(NSString *)path
{
return [self assetForPath:path withMode:AASSET_MODE_UNKNOWN];
}
+ (AAsset *)assetForPath:(NSString *)path withMode:(int)mode
{
AAsset *asset = NULL;
@ -3298,7 +3303,7 @@ IF_NO_GC(
NSString *assetPath = [path substringFromIndex:[resourcePath length]+1];
asset = AAssetManager_open(_assetManager,
[assetPath fileSystemRepresentation], AASSET_MODE_BUFFER);
[assetPath fileSystemRepresentation], mode);
}
}