summaryrefslogtreecommitdiff
path: root/Source/Android/jni/GameList
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Android/jni/GameList')
-rw-r--r--Source/Android/jni/GameList/GameFile.cpp17
-rw-r--r--Source/Android/jni/GameList/TitleDatabase.cpp37
-rw-r--r--Source/Android/jni/GameList/TitleDatabase.h13
3 files changed, 63 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,
diff --git a/Source/Android/jni/GameList/TitleDatabase.cpp b/Source/Android/jni/GameList/TitleDatabase.cpp
new file mode 100644
index 0000000000..c4aca48a25
--- /dev/null
+++ b/Source/Android/jni/GameList/TitleDatabase.cpp
@@ -0,0 +1,37 @@
+// Copyright 2026 Dolphin Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "jni/GameList/TitleDatabase.h"
+
+#include <jni.h>
+
+#include "Core/TitleDatabase.h"
+#include "jni/AndroidCommon/IDCache.h"
+
+Core::TitleDatabase* TitleDatabaseFromJava(JNIEnv* env, jobject obj)
+{
+ return reinterpret_cast<Core::TitleDatabase*>(
+ env->GetLongField(obj, IDCache::GetTitleDatabasePointer()));
+}
+extern "C" {
+
+JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_model_TitleDatabase_finalize(JNIEnv* env,
+ jobject obj)
+{
+ delete TitleDatabaseFromJava(env, obj);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_model_TitleDatabase_userTitleMapEquals(
+ JNIEnv* env, jobject obj, jobject other)
+{
+ return other != nullptr && TitleDatabaseFromJava(env, obj)->GetUserTitleMap() ==
+ TitleDatabaseFromJava(env, other)->GetUserTitleMap();
+}
+
+JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_TitleDatabase_load(JNIEnv* env,
+ jclass)
+{
+ return env->NewObject(IDCache::GetTitleDatabaseClass(), IDCache::GetTitleDatabaseConstructor(),
+ reinterpret_cast<jlong>(new Core::TitleDatabase));
+}
+}
diff --git a/Source/Android/jni/GameList/TitleDatabase.h b/Source/Android/jni/GameList/TitleDatabase.h
new file mode 100644
index 0000000000..fcf8f9bf32
--- /dev/null
+++ b/Source/Android/jni/GameList/TitleDatabase.h
@@ -0,0 +1,13 @@
+// Copyright 2026 Dolphin Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <jni.h>
+
+namespace Core
+{
+class TitleDatabase;
+}
+
+Core::TitleDatabase* TitleDatabaseFromJava(JNIEnv* env, jobject obj);