From 0150f521f740fc3b1a00d49b432edd0ed32e31d1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 14 Aug 2021 15:03:54 +0200 Subject: ControllerInterface/Android: Rip out ButtonManager ButtonManager is very different from how a normal input backend works, and is making it hard for us to improve controller support on Android. The following commits will add a new input backend in its place. --- Source/Android/jni/MainAndroid.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 01728ce014..fd6ca47359 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -51,8 +51,6 @@ #include "DiscIO/ScrubbedBlob.h" #include "DiscIO/Volume.h" -#include "InputCommon/ControllerInterface/Android/Android.h" -#include "InputCommon/ControllerInterface/Touch/ButtonManager.h" #include "InputCommon/GCAdapter.h" #include "UICommon/GameFile.h" @@ -293,19 +291,20 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndUnpaused(JNIEnv*, jclas JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent( JNIEnv* env, jclass, jstring jDevice, jint Button, jint Action) { - return ButtonManager::GamepadEvent(GetJString(env, jDevice), Button, Action); + // TODO + return JNI_FALSE; } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent( JNIEnv* env, jclass, jstring jDevice, jint Axis, jfloat Value) { - ButtonManager::GamepadAxisEvent(GetJString(env, jDevice), Axis, Value); + // TODO } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSensorsEnabled( JNIEnv*, jclass, jboolean accelerometer_enabled, jboolean gyroscope_enabled) { - ciface::Android::SetMotionSensorsEnabled(accelerometer_enabled, gyroscope_enabled); + // TODO } JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, @@ -583,8 +582,6 @@ static void Run(JNIEnv* env, std::unique_ptr&& boot, bool riivol if (BootManager::BootCore(std::move(boot), wsi)) { - ButtonManager::Init(SConfig::GetInstance().GetGameID()); - static constexpr int WAIT_STEP = 25; while (Core::GetState() == Core::State::Starting) std::this_thread::sleep_for(std::chrono::milliseconds(WAIT_STEP)); @@ -604,7 +601,6 @@ static void Run(JNIEnv* env, std::unique_ptr&& boot, bool riivol s_game_metadata_is_valid = false; Core::Shutdown(); - ButtonManager::Shutdown(); host_identity_guard.unlock(); env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), -- cgit v1.2.3 From 9e7a2ee0fb307977bb0ae4245c8738ebd33df44b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 16 Sep 2022 22:03:03 +0200 Subject: Android: Remove old motion input implementation --- Source/Android/jni/MainAndroid.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index fd6ca47359..95297664db 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -288,25 +288,6 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndUnpaused(JNIEnv*, jclas return static_cast(Core::GetState() == Core::State::Running); } -JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent( - JNIEnv* env, jclass, jstring jDevice, jint Button, jint Action) -{ - // TODO - return JNI_FALSE; -} - -JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent( - JNIEnv* env, jclass, jstring jDevice, jint Axis, jfloat Value) -{ - // TODO -} - -JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSensorsEnabled( - JNIEnv*, jclass, jboolean accelerometer_enabled, jboolean gyroscope_enabled) -{ - // TODO -} - JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jclass) { -- cgit v1.2.3 From 93657cce5433552dbd0d836bac34e65143384a2c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 30 Dec 2021 18:37:17 +0100 Subject: Android: Stop extracting pre-defined controller INIs --- Source/Android/jni/MainAndroid.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 95297664db..375d470eb5 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -355,12 +355,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_utils_DirectoryInitializat File::SetSysDirectory(path); } -JNIEXPORT void JNICALL -Java_org_dolphinemu_dolphinemu_utils_DirectoryInitialization_CreateUserDirectories(JNIEnv*, jclass) -{ - UICommon::CreateDirectories(); -} - JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirectory( JNIEnv* env, jclass, jstring jDirectory) { @@ -510,6 +504,7 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_UpdateGCAdapterScanThread(JNIEnv*, JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Initialize(JNIEnv*, jclass) { + UICommon::CreateDirectories(); Common::RegisterMsgAlertHandler(&MsgAlert); Common::AndroidSetReportHandler(&ReportSend); DolphinAnalytics::AndroidSetGetValFunc(&GetAnalyticValue); -- cgit v1.2.3 From 1b55d7c59429ae96b014b61c5393a4dacc578cfa Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 26 Jun 2022 20:27:18 +0200 Subject: Android: Change how the overlay controller setting works Up until now, there have been two settings on Android that stored the selected Wii Remote extension: the normal one that's also used on PC, and a SharedPreferences one that's used by the overlay controls to determine what controls to show. It is possible for these two to end up out of sync, and my input changes have made that more likely to happen. To fix this, let's rework how the overlay controller setting works. We don't want it to encode the currently selected Wii Remote extension. However, we can't simply get rid of the setting, because for some Wii games we need the ability to switch between a GameCube controller and a Wii Remote. What this commit does is give the user the option to select any of the 4 GameCube controllers and any of the 4 Wii Remotes. (Before, controllers 2-4 weren't available in the overlay.) Could be useful for things like the Psycho Mantis fight in Metal Gear Solid. I'm also switching from SharedPreferences to Dolphin.ini while I'm at it. --- Source/Android/jni/MainAndroid.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 375d470eb5..ff6b4f9a13 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -478,12 +478,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimo WiimoteReal::Refresh(); } -JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReloadWiimoteConfig(JNIEnv*, - jclass) -{ - Wiimote::LoadConfig(); -} - JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReloadConfig(JNIEnv*, jclass) { SConfig::GetInstance().LoadSettings(); -- cgit v1.2.3