From 5f6995fe6c840634227afd5e294fc0ecb743b4e6 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 1 Mar 2023 13:34:09 -0500 Subject: [PATCH] Android: Convert GraphicsModGroup to Kotlin --- .../cheats/model/GraphicsModGroup.java | 27 ------------------- .../features/cheats/model/GraphicsModGroup.kt | 17 ++++++++++++ Source/Android/jni/AndroidCommon/IDCache.cpp | 2 +- 3 files changed, 18 insertions(+), 28 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.java deleted file mode 100644 index 0cb0a3c456..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.dolphinemu.dolphinemu.features.cheats.model; - -import androidx.annotation.Keep; -import androidx.annotation.NonNull; - -public class GraphicsModGroup -{ - @Keep - private final long mPointer; - - @Keep - private GraphicsModGroup(long pointer) - { - mPointer = pointer; - } - - @Override - public native void finalize(); - - @NonNull - public native GraphicsMod[] getMods(); - - public native void save(); - - @NonNull - public static native GraphicsModGroup load(String gameId); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.kt new file mode 100644 index 0000000000..5d9b8b2217 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup.kt @@ -0,0 +1,17 @@ +package org.dolphinemu.dolphinemu.features.cheats.model + +import androidx.annotation.Keep + +class GraphicsModGroup @Keep private constructor(@field:Keep private val pointer: Long) { + external fun finalize() + + val mods: Array + external get + + external fun save() + + companion object { + @JvmStatic + external fun load(gameId: String): GraphicsModGroup + } +} diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index 8b84cb5dc4..ceaac35336 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -522,7 +522,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) env->FindClass("org/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup"); s_graphics_mod_group_class = reinterpret_cast(env->NewGlobalRef(graphics_mod_group_class)); - s_graphics_mod_group_pointer = env->GetFieldID(graphics_mod_group_class, "mPointer", "J"); + s_graphics_mod_group_pointer = env->GetFieldID(graphics_mod_group_class, "pointer", "J"); s_graphics_mod_group_constructor = env->GetMethodID(graphics_mod_group_class, "", "(J)V"); env->DeleteLocalRef(graphics_mod_group_class);