From 1db02c14c7d289eb2e6466928fe7ccf7e074ba7a Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 13 Oct 2018 07:17:14 -0400 Subject: Android: add IR width/height/center option in emu menu This sets the IR/Width, IR/Height, and IR/Center per game, so a controller profile is used to save the value, then enable the profile in the game ini, then reload the control configs. --- Source/Android/jni/MainAndroid.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index c606345abe..8fe7c4942f 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -571,6 +571,12 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimo WiimoteReal::Refresh(); } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReloadWiimoteConfig(JNIEnv* env, + jobject obj) +{ + Wiimote::LoadConfig(); +} + static void Run(const std::vector& paths, bool first_open, std::optional savestate_path = {}, bool delete_savestate = false) { -- cgit v1.2.3 From e8739156e4dc54b904af036d26609e624c997fcb Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 19 Jan 2019 22:49:04 -0500 Subject: Android: Normalize pointer touches based on rendered aspect ratio This allows the defaults to be actual defaults across devices with different screen sizes --- Source/Android/jni/MainAndroid.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 8fe7c4942f..686053496e 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -107,6 +107,11 @@ void Host_UpdateMainFrame() void Host_RequestRenderWindowSize(int width, int height) { + // Update touch pointer + JNIEnv* env; + IDCache::GetJavaVM()->AttachCurrentThread(&env, nullptr); + env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetUpdateTouchPointer()); + IDCache::GetJavaVM()->DetachCurrentThread(); } bool Host_UINeedsControllerState() @@ -564,6 +569,13 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestr s_surf = nullptr; } } + +JNIEXPORT jfloat JNICALL +Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameAspectRatio(JNIEnv* env, jobject obj) +{ + return g_renderer->CalculateDrawAspectRatio(); +} + JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv* env, jobject obj) { -- cgit v1.2.3