summaryrefslogtreecommitdiff
path: root/Source/Android/jni/MainAndroid.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-06-28 23:32:36 +0200
committerJosJuice <josjuice@gmail.com>2020-06-29 01:20:02 +0200
commitdb75509ec5d2cd15036a5cda629f952c2b860d6e (patch)
tree43b6be00a008f361e1eedf2aa70cc291ff6fbbd0 /Source/Android/jni/MainAndroid.cpp
parent961f93701065f099ba68fb610f699f89b804a2b4 (diff)
Android: Enfore correct stick gate in overlay
Currently, the touch controller overlay uses a square gate for sticks. This commit changes that so that it instead uses the stick gate configured in the INI, which ensures that the values sent to the core are appropriately scaled regardless of what is configured in the INI and makes the overlay look nicer if the INI is set to a stick gate that matches the graphics.
Diffstat (limited to 'Source/Android/jni/MainAndroid.cpp')
-rw-r--r--Source/Android/jni/MainAndroid.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp
index 469d719869..eb9e02c32b 100644
--- a/Source/Android/jni/MainAndroid.cpp
+++ b/Source/Android/jni/MainAndroid.cpp
@@ -201,6 +201,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMov
JNIEnv* env, jobject obj, jstring jDevice, jint Axis, jfloat Value);
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSensorsEnabled(
JNIEnv* env, jobject obj, jboolean accelerometer_enabled, jboolean gyroscope_enabled);
+JNIEXPORT double JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetInputRadiusAtAngle(
+ JNIEnv* env, jobject obj, int emu_pad_id, int stick, double angle);
JNIEXPORT jstring JNICALL
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jobject obj);
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGitRevision(JNIEnv* env,
@@ -315,6 +317,13 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSen
ciface::Android::SetMotionSensorsEnabled(accelerometer_enabled, gyroscope_enabled);
}
+JNIEXPORT double JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetInputRadiusAtAngle(
+ JNIEnv* env, jobject obj, int emu_pad_id, int stick, double angle)
+{
+ const auto casted_stick = static_cast<ButtonManager::ButtonType>(stick);
+ return ButtonManager::GetInputRadiusAtAngle(emu_pad_id, casted_stick, angle);
+}
+
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env,
jobject obj)
{