WiimoteReal: fix multiple Wiimotes on OS X
This commit is contained in:
parent
1414221bd4
commit
b96f0fad57
|
@ -322,10 +322,11 @@ void WiimoteDarwin::DisablePowerAssertionInternal()
|
||||||
|
|
||||||
for (int i = 0; i < MAX_WIIMOTES; i++)
|
for (int i = 0; i < MAX_WIIMOTES; i++)
|
||||||
{
|
{
|
||||||
if (WiimoteReal::g_wiimotes[i] == nullptr)
|
|
||||||
continue;
|
|
||||||
wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]);
|
wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]);
|
||||||
if ([device isEqual: wm->m_btd] != TRUE)
|
if (!wm)
|
||||||
|
continue;
|
||||||
|
if ([device isEqual: wm->m_btd])
|
||||||
|
break;
|
||||||
wm = nullptr;
|
wm = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,10 +362,11 @@ void WiimoteDarwin::DisablePowerAssertionInternal()
|
||||||
|
|
||||||
for (int i = 0; i < MAX_WIIMOTES; i++)
|
for (int i = 0; i < MAX_WIIMOTES; i++)
|
||||||
{
|
{
|
||||||
if (WiimoteReal::g_wiimotes[i] == nullptr)
|
|
||||||
continue;
|
|
||||||
wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]);
|
wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]);
|
||||||
if ([device isEqual: wm->m_btd] != TRUE)
|
if (!wm)
|
||||||
|
continue;
|
||||||
|
if ([device isEqual: wm->m_btd])
|
||||||
|
break;
|
||||||
wm = nullptr;
|
wm = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue