From 6a6bbd707177d17702bb7327984dd6adeabb09af Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 18 Jul 2019 20:42:09 +1000 Subject: [PATCH] Android: Support bypassing game file cache to parse file --- .../org/dolphinemu/dolphinemu/model/GameFile.java | 2 ++ Source/Android/jni/GameList/GameFile.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java index 5a247137ab..70be6cd080 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java @@ -11,6 +11,8 @@ public class GameFile mPointer = pointer; } + public native static GameFile parse(String path); + @Override public native void finalize(); diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp index ee889709fd..b9f7a28df4 100644 --- a/Source/Android/jni/GameList/GameFile.cpp +++ b/Source/Android/jni/GameList/GameFile.cpp @@ -165,6 +165,17 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe return static_cast(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(GetJString(env, path)); + if (!game_file->IsValid()) + game_file.reset(); + + return GameFileToJava(env, game_file); +} + #ifdef __cplusplus } #endif