//
// cocos2d::CCLayer::setAccelerometerEnabled from 0x180050990 to 0x180050a0f (127 bytes)
//
// 8 xrefs:
// > ??> @ 0x1800ed2a8
// > ??> @ 0x1800ed768
// > ??> @ 0x1800edca0
// > ??> @ 0x1800ee208
// > ??> @ 0x1800ee7e0
// > ??> @ 0x1800f70b0
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2040
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCLayer::setAccelerometerEnabled(cocos2d::CCLayer *this, bool a2)
{
bool v4; // zf
struct cocos2d::CCDirector *v5; // rax
cocos2d::CCDirector_vtbl *v6; // rdx
struct cocos2d::CCAccelerometerDelegate *v7; // rbx
cocos2d::CCAccelerometer *v8; // rax
cocos2d::CCAccelerometer *v9; // rax
if ( a2 != this->m_bAccelerometerEnabled )
{
v4 = !this->m_bRunning;
this->m_bAccelerometerEnabled = a2;
if ( !v4 )
{
v5 = cocos2d::CCDirector::sharedDirector();
v6 = v5->cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a2 )
{
v7 = &this->cocos2d::CCAccelerometerDelegate;
if ( !this )
v7 = nullptr;
v8 = (cocos2d::CCAccelerometer *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v6->getAccelerometer)(v5);
cocos2d::CCAccelerometer::setDelegate(v8, v7);
}
else
{
v9 = (cocos2d::CCAccelerometer *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v6->getAccelerometer)(v5);
cocos2d::CCAccelerometer::setDelegate(v9, nullptr);
}
}
}
}