From 49ebb1cfea589e66134039d4ecca911e0e14af43 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 3 Aug 2026 20:02:47 +0200 Subject: 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. --- Source/Android/jni/GameList/GameFile.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Source/Android/jni/GameList/GameFile.cpp') diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp index dc922d701c..e13f5c810a 100644 --- a/Source/Android/jni/GameList/GameFile.cpp +++ b/Source/Android/jni/GameList/GameFile.cpp @@ -16,6 +16,7 @@ #include "UICommon/GameFile.h" #include "jni/AndroidCommon/AndroidCommon.h" #include "jni/AndroidCommon/IDCache.h" +#include "jni/GameList/TitleDatabase.h" static std::shared_ptr* GetPointer(JNIEnv* env, jobject obj) { @@ -52,11 +53,19 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getPlatform return static_cast(GetRef(env, obj)->GetPlatform()); } -JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getTitle(JNIEnv* env, - jobject obj) +JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getTitle( + JNIEnv* env, jobject obj, jobject j_title_database) { - return ToJString(env, - GetRef(env, obj)->GetName(UICommon::GameFile::Variant::LongAndPossiblyCustom)); + const Core::TitleDatabase* title_database = TitleDatabaseFromJava(env, j_title_database); + if (title_database) + { + return ToJString(env, GetRef(env, obj)->GetName(*title_database)); + } + else + { + return ToJString(env, + GetRef(env, obj)->GetName(UICommon::GameFile::Variant::LongAndPossiblyCustom)); + } } JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getDescription(JNIEnv* env, -- cgit v1.2.3