Use assetManager reference in legacy that exists in hybrid mode as well
This commit is contained in:
@@ -598,16 +598,13 @@ AAsset *AndroidGetAsset(const char *inResource)
|
|||||||
if (!androidAssetManager)
|
if (!androidAssetManager)
|
||||||
{
|
{
|
||||||
JNIEnv *env = GetEnv();
|
JNIEnv *env = GetEnv();
|
||||||
#ifdef HX_LIME
|
jclass cls = FindClass("org/haxe/extension/Extension");
|
||||||
jclass cls = FindClass("org/haxe/lime/GameActivity");
|
|
||||||
#else
|
jfieldID fid = env->GetStaticFieldID(cls, "assetManager", "Landroid/content/res/AssetManager;");
|
||||||
jclass cls = FindClass("org/haxe/nme/GameActivity");
|
if (fid == 0)
|
||||||
#endif
|
|
||||||
jmethodID mid = env->GetStaticMethodID(cls, "getAssetManager", "()Landroid/content/res/AssetManager;");
|
|
||||||
if (mid == 0)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
jobject assetManager = (jobject)env->CallStaticObjectMethod(cls, mid);
|
jobject assetManager = (jobject)env->GetStaticObjectField(cls, fid);
|
||||||
if (assetManager==0)
|
if (assetManager==0)
|
||||||
{
|
{
|
||||||
//LOG("Could not find assetManager for asset %s", inResource);
|
//LOG("Could not find assetManager for asset %s", inResource);
|
||||||
|
|||||||
Reference in New Issue
Block a user