mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
WiimoteReal/IOAndroid: Don't "find" already in-use Wii remotes.
This commit is contained in:
parent
df809959d0
commit
c84d30c782
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/Event.h"
|
#include "Common/Event.h"
|
||||||
#include "Common/Flag.h"
|
#include "Common/Flag.h"
|
||||||
@ -37,7 +39,12 @@ void WiimoteScannerAndroid::FindWiimotes(std::vector<Wiimote*>& found_wiimotes,
|
|||||||
env->CallStaticBooleanMethod(s_adapter_class, openadapter_func))
|
env->CallStaticBooleanMethod(s_adapter_class, openadapter_func))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_WIIMOTES; ++i)
|
for (int i = 0; i < MAX_WIIMOTES; ++i)
|
||||||
|
{
|
||||||
|
if (!IsNewWiimote(WiimoteAndroid::GetIdFromDolphinBarIndex(i)))
|
||||||
|
continue;
|
||||||
|
|
||||||
found_wiimotes.emplace_back(new WiimoteAndroid(i));
|
found_wiimotes.emplace_back(new WiimoteAndroid(i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +57,16 @@ WiimoteAndroid::~WiimoteAndroid()
|
|||||||
Shutdown();
|
Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string WiimoteAndroid::GetId() const
|
||||||
|
{
|
||||||
|
return GetIdFromDolphinBarIndex(m_mayflash_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string WiimoteAndroid::GetIdFromDolphinBarIndex(int index)
|
||||||
|
{
|
||||||
|
return fmt::format("Android {}", index);
|
||||||
|
}
|
||||||
|
|
||||||
// Connect to a Wiimote with a known address.
|
// Connect to a Wiimote with a known address.
|
||||||
bool WiimoteAndroid::ConnectInternal()
|
bool WiimoteAndroid::ConnectInternal()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,7 +17,9 @@ class WiimoteAndroid final : public Wiimote
|
|||||||
public:
|
public:
|
||||||
WiimoteAndroid(int index);
|
WiimoteAndroid(int index);
|
||||||
~WiimoteAndroid() override;
|
~WiimoteAndroid() override;
|
||||||
std::string GetId() const override { return "Android " + std::to_string(m_mayflash_index); }
|
|
||||||
|
std::string GetId() const override;
|
||||||
|
static std::string GetIdFromDolphinBarIndex(int index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool ConnectInternal() override;
|
bool ConnectInternal() override;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user