mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-14 07:36:26 +00:00
macOS IOKit interface fixes; callback-change mutex for controllers
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace boo
|
||||
{
|
||||
NintendoPowerA::NintendoPowerA(DeviceToken* token)
|
||||
: DeviceBase(token)
|
||||
: TDeviceBase<INintendoPowerACallback>(token)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ NintendoPowerA::~NintendoPowerA()
|
||||
|
||||
void NintendoPowerA::deviceDisconnected()
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_callbackLock);
|
||||
if (m_callback)
|
||||
m_callback->controllerDisconnected();
|
||||
}
|
||||
@@ -29,6 +30,7 @@ void NintendoPowerA::transferCycle()
|
||||
|
||||
NintendoPowerAState state = *reinterpret_cast<NintendoPowerAState*>(&payload);
|
||||
|
||||
std::lock_guard<std::mutex> lk(m_callbackLock);
|
||||
if (state != m_last && m_callback)
|
||||
m_callback->controllerUpdate(state);
|
||||
m_last = state;
|
||||
|
||||
Reference in New Issue
Block a user