summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/IDCache.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-08-03 20:02:47 +0200
committerJosJuice <josjuice@gmail.com>2026-08-15 10:44:28 +0200
commit49ebb1cfea589e66134039d4ecca911e0e14af43 (patch)
treee962b2bdb71fc41738cfc90b1d02273def13136e /Source/Android/jni/AndroidCommon/IDCache.cpp
parentc64b02dace5e5e71dae9fbfbd258ffa3562573ef (diff)
Android: Use TitleDatabase for game list
By using the title database we ship with Dolphin, we get more uniform game titles than if we grab what's in each game's opening.bnr file. It also becomes possible for users to supply a custom titles.txt file. This has been implemented in DolphinQt since a long time ago.
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
-rw-r--r--Source/Android/jni/AndroidCommon/IDCache.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp
index 58cec02308..8d774dbbd9 100644
--- a/Source/Android/jni/AndroidCommon/IDCache.cpp
+++ b/Source/Android/jni/AndroidCommon/IDCache.cpp
@@ -151,6 +151,10 @@ static jclass s_audio_utils_class;
static jmethodID s_audio_utils_get_sample_rate;
static jmethodID s_audio_utils_get_frames_per_buffer;
+static jclass s_title_database_class;
+static jfieldID s_title_database_pointer;
+static jmethodID s_title_database_constructor;
+
namespace IDCache
{
JNIEnv* GetEnvForThread()
@@ -721,6 +725,21 @@ jmethodID GetAudioUtilsGetFramesPerBuffer()
return s_audio_utils_get_frames_per_buffer;
}
+jclass GetTitleDatabaseClass()
+{
+ return s_title_database_class;
+}
+
+jfieldID GetTitleDatabasePointer()
+{
+ return s_title_database_pointer;
+}
+
+jmethodID GetTitleDatabaseConstructor()
+{
+ return s_title_database_constructor;
+}
+
} // namespace IDCache
extern "C" {
@@ -1015,6 +1034,13 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
env->GetStaticMethodID(audio_utils_class, "getFramesPerBuffer", "()I");
env->DeleteLocalRef(audio_utils_class);
+ const jclass title_database_class =
+ env->FindClass("org/dolphinemu/dolphinemu/model/TitleDatabase");
+ s_title_database_class = reinterpret_cast<jclass>(env->NewGlobalRef(title_database_class));
+ s_title_database_pointer = env->GetFieldID(title_database_class, "pointer", "J");
+ s_title_database_constructor = env->GetMethodID(title_database_class, "<init>", "(J)V");
+ env->DeleteLocalRef(title_database_class);
+
return JNI_VERSION;
}