summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2026-07-01 13:07:25 -0700
committerGitHub <noreply@github.com>2026-07-01 13:07:25 -0700
commitd8d37fdbc487d7befe324a10b3b83e5b32f3644e (patch)
treec11a68b65a35e0f43e43c31f24f81cd4e88bc145 /Source/Core/InputCommon/ControllerInterface
parent39ef77c71626aee51681f3b662c648e82ca03013 (diff)
parent64a73e56361cbc65e35d9a3fd03d33f6103a04a4 (diff)
Merge pull request #14699 from JosJuice/android-vibrator-id-index
Android: Fix mixup between Vibrator id and index
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
index 0b0609f010..40f1e2b096 100644
--- a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
@@ -584,14 +584,14 @@ private:
class AndroidMotor : public Core::Device::Output
{
public:
- AndroidMotor(JNIEnv* env, jobject vibrator, jint id)
- : m_vibrator(env->NewGlobalRef(vibrator)), m_id(id)
+ AndroidMotor(JNIEnv* env, jobject vibrator, jint index)
+ : m_vibrator(env->NewGlobalRef(vibrator)), m_index(index)
{
}
~AndroidMotor() { IDCache::GetEnvForThread()->DeleteGlobalRef(m_vibrator); }
- std::string GetName() const override { return "Motor " + std::to_string(m_id); }
+ std::string GetName() const override { return "Motor " + std::to_string(m_index); }
void SetState(ControlState state) override
{
@@ -606,7 +606,7 @@ public:
private:
const jobject m_vibrator;
- const jint m_id;
+ const jint m_index;
std::atomic<ControlState> m_state = 0;
};
@@ -793,8 +793,8 @@ private:
jint size = env->GetArrayLength(j_vibrator_ids);
for (jint i = 0; i < size; ++i)
{
- jobject vibrator =
- env->CallObjectMethod(vibrator_manager, s_dolphin_vibrator_manager_get_vibrator, i);
+ jobject vibrator = env->CallObjectMethod(
+ vibrator_manager, s_dolphin_vibrator_manager_get_vibrator, vibrator_ids[i]);
AddOutput(new AndroidMotor(env, vibrator, i));
env->DeleteLocalRef(vibrator);
}