diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java deleted file mode 100644 index 241d15093f..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.cheats.model; - -import androidx.annotation.Keep; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -public class GraphicsMod extends ReadOnlyCheat -{ - @Keep - private final long mPointer; - - // When a C++ GraphicsModGroup object is destroyed, it also destroys the GraphicsMods it owns. - // To avoid getting dangling pointers, we keep a reference to the GraphicsModGroup here. - @Keep - private final GraphicsModGroup mParent; - - @Keep - private GraphicsMod(long pointer, GraphicsModGroup parent) - { - mPointer = pointer; - mParent = parent; - } - - public boolean supportsCreator() - { - return true; - } - - public boolean supportsNotes() - { - return true; - } - - public boolean supportsCode() - { - return false; - } - - @NonNull - public native String getName(); - - @NonNull - public native String getCreator(); - - @NonNull - public native String getNotes(); - - public boolean getUserDefined() - { - // Technically graphics mods can be user defined, but we don't support editing graphics mods - // in the GUI, and editability is what this really controls - return false; - } - - public native boolean getEnabled(); - - @Override - protected native void setEnabledImpl(boolean enabled); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt new file mode 100644 index 0000000000..3ea8c23e43 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.cheats.model + +import androidx.annotation.Keep + +class GraphicsMod @Keep private constructor( + @Keep private val pointer: Long, + // When a C++ GraphicsModGroup object is destroyed, it also destroys the GraphicsMods it owns. + // To avoid getting dangling pointers, we keep a reference to the GraphicsModGroup here. + @Keep private val parent: GraphicsModGroup +) : ReadOnlyCheat() { + override fun supportsCreator(): Boolean = true + + override fun supportsNotes(): Boolean = true + + override fun supportsCode(): Boolean = false + + external override fun getName(): String + + external override fun getCreator(): String + + external override fun getNotes(): String + + // Technically graphics mods can be user defined, but we don't support editing graphics mods + // in the GUI, and editability is what this really controls + override fun getUserDefined(): Boolean = false + + external override fun getEnabled(): Boolean + + external override fun setEnabledImpl(enabled: Boolean) +} diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index ceaac35336..08fd8f8d18 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -529,7 +529,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) const jclass graphics_mod_class = env->FindClass("org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod"); s_graphics_mod_class = reinterpret_cast(env->NewGlobalRef(graphics_mod_class)); - s_graphics_mod_pointer = env->GetFieldID(graphics_mod_class, "mPointer", "J"); + s_graphics_mod_pointer = env->GetFieldID(graphics_mod_class, "pointer", "J"); s_graphics_mod_constructor = env->GetMethodID(graphics_mod_class, "", "(JLorg/dolphinemu/dolphinemu/features/cheats/model/GraphicsModGroup;)V");