//
// GJRotationControl::ccTouchBegan from 0x686748 to 0x686878 (304 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJRotationControl::ccTouchBegan @ 0x68687c
// > ??> @ 0xa2d80
// > ??> @ 0x1157230
//
// 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
//
bool GJRotationControl::ccTouchBegan(GJRotationControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
bool v5; // w21
float v7; // s0
float v8; // s1
GJRotationControlDelegate *m_delegate; // x0
cocos2d::CCSprite *m_controlSprite; // x20
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // x22
cocos2d::CCSpriteFrameCache *v12; // x0
cocos2d::CCSpriteFrame *v13; // x0
cocos2d::CCPoint v14; // [xsp+58h] [xbp+58h] BYREF
__int64 v15; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v16; // 0:kr08_8.8
v5 = 0;
if ( a1->m_touchID == -1 )
{
cocos2d::CCTouch::getLocation(a2);
v16 = cocos2d::CCNode::convertToNodeSpace(a1, &v14);
cocos2d::CCPoint::operator=(&v14, v16.x, v16.y);
if ( cocos2d::ccpDistance(&v14, &a1->m_controlPosition) < 24.0 )
{
a1->m_startingRotation = a1->m_currentRotation;
cocos2d::CCPoint::operator-(&v15, &v14, &a1->m_controlPosition);
cocos2d::CCPoint::operator=(&a1->m_cursorDifference, v7, v8);
m_delegate = a1->m_delegate;
a1->m_touchID = a2->m_nId;
if ( m_delegate )
m_delegate->angleChangeBegin(m_delegate);
m_controlSprite = a1->m_controlSprite;
v5 = 1;
setDisplayFrame = m_controlSprite->setDisplayFrame;
v12 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v13 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v12, "GJ_rotationControlBtn02_001.png");
setDisplayFrame(m_controlSprite, v13);
}
}
return v5;
}