Android: Support bypassing game file cache to parse file

This commit is contained in:
Stenzek 2019-07-18 20:42:09 +10:00
parent a77b571da7
commit 6a6bbd7071
2 changed files with 13 additions and 0 deletions

View File

@ -11,6 +11,8 @@ public class GameFile
mPointer = pointer; mPointer = pointer;
} }
public native static GameFile parse(String path);
@Override @Override
public native void finalize(); public native void finalize();

View File

@ -165,6 +165,17 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe
return static_cast<jint>(GetRef(env, obj)->GetBannerImage().height); return static_cast<jint>(GetRef(env, obj)->GetBannerImage().height);
} }
JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_parse(JNIEnv* env,
jobject obj,
jstring path)
{
auto game_file = std::make_shared<UICommon::GameFile>(GetJString(env, path));
if (!game_file->IsValid())
game_file.reset();
return GameFileToJava(env, game_file);
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif