summaryrefslogtreecommitdiff
path: root/Source/Android/jni/GameList/GameFile.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/GameList/GameFile.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/GameList/GameFile.cpp')
-rw-r--r--Source/Android/jni/GameList/GameFile.cpp17
1 files changed, 13 insertions, 4 deletions
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<const UICommon::GameFile>* GetPointer(JNIEnv* env, jobject obj)
{
@@ -52,11 +53,19 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getPlatform
return static_cast<jint>(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,