diff options
| author | JosJuice <josjuice@gmail.com> | 2022-12-27 16:29:01 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-03-07 17:39:30 +0100 |
| commit | c2779aef060137d9062cfd29babb3c43fc5fa2b5 (patch) | |
| tree | 421bbf1ba198ec00b5e7dfe9118da77e079d89c1 /Source/Android/jni/AndroidCommon/IDCache.cpp | |
| parent | 42943672bbbed6c18aa2bc85c41102a0616547f7 (diff) | |
Android: Add the advanced input mapping dialog
It's missing a lot of features from the PC version for now, like
buttons for inserting functions and the ability to see what the
expression evaluates to. I mostly just wanted to get something in
place so you can set up rumble.
Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
| -rw-r--r-- | Source/Android/jni/AndroidCommon/IDCache.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index 6e547beaed..25a051ff2d 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -103,6 +103,14 @@ static jclass s_emulated_controller_class; static jfieldID s_emulated_controller_pointer; static jmethodID s_emulated_controller_constructor; +static jclass s_core_device_class; +static jfieldID s_core_device_pointer; +static jmethodID s_core_device_constructor; + +static jclass s_core_device_control_class; +static jfieldID s_core_device_control_pointer; +static jmethodID s_core_device_control_constructor; + namespace IDCache { JNIEnv* GetEnvForThread() @@ -478,6 +486,36 @@ jmethodID GetNumericSettingConstructor() return s_numeric_setting_constructor; } +jclass GetCoreDeviceClass() +{ + return s_core_device_class; +} + +jfieldID GetCoreDevicePointer() +{ + return s_core_device_pointer; +} + +jmethodID GetCoreDeviceConstructor() +{ + return s_core_device_constructor; +} + +jclass GetCoreDeviceControlClass() +{ + return s_core_device_control_class; +} + +jfieldID GetCoreDeviceControlPointer() +{ + return s_core_device_control_pointer; +} + +jmethodID GetCoreDeviceControlConstructor() +{ + return s_core_device_control_constructor; +} + } // namespace IDCache extern "C" { @@ -672,6 +710,23 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) s_numeric_setting_constructor = env->GetMethodID(numeric_setting_class, "<init>", "(J)V"); env->DeleteLocalRef(numeric_setting_class); + const jclass core_device_class = + env->FindClass("org/dolphinemu/dolphinemu/features/input/model/CoreDevice"); + s_core_device_class = reinterpret_cast<jclass>(env->NewGlobalRef(core_device_class)); + s_core_device_pointer = env->GetFieldID(core_device_class, "mPointer", "J"); + s_core_device_constructor = env->GetMethodID(core_device_class, "<init>", "(J)V"); + env->DeleteLocalRef(core_device_class); + + const jclass core_device_control_class = + env->FindClass("org/dolphinemu/dolphinemu/features/input/model/CoreDevice$Control"); + s_core_device_control_class = + reinterpret_cast<jclass>(env->NewGlobalRef(core_device_control_class)); + s_core_device_control_pointer = env->GetFieldID(core_device_control_class, "mPointer", "J"); + s_core_device_control_constructor = + env->GetMethodID(core_device_control_class, "<init>", + "(Lorg/dolphinemu/dolphinemu/features/input/model/CoreDevice;J)V"); + env->DeleteLocalRef(core_device_control_class); + return JNI_VERSION; } @@ -704,5 +759,7 @@ JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved) env->DeleteGlobalRef(s_control_reference_class); env->DeleteGlobalRef(s_emulated_controller_class); env->DeleteGlobalRef(s_numeric_setting_class); + env->DeleteGlobalRef(s_core_device_class); + env->DeleteGlobalRef(s_core_device_control_class); } } |
