//
// GJRotationControl::updateSliderPosition from 0x386854 to 0x38693a (230 bytes)
//
// 1 xrefs:
// > GJRotationControl::ccTouchMoved @ 0x386994
//
// 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 GJRotationControl::updateSliderPosition(GJRotationControl *a1, cocos2d::CCPoint a2)
{
PlayerObject *p_m_controlPosition; // r7
float v4; // s17
float v5; // s16
float v6; // r0
int v7; // r2
bool v8; // r3
float v9; // r0
float m_currentRotation; // s14
float v11; // s15
GJRotationControlDelegate *m_delegate; // r0
cocos2d::CCPoint v13; // [sp+4h] [bp-10h] BYREF
p_m_controlPosition = (PlayerObject *)&a1->m_controlPosition;
v4 = atan2f(
*(float *)(LODWORD(a2.x) + 4) - a1->m_cursorDifference.y,
*(float *)LODWORD(a2.x) - a1->m_cursorDifference.x);
v5 = cosf(v4);
v6 = sinf(v4);
cocos2d::CCPoint::CCPoint(&v13, (float)(v5 * 60.0) + 0.0, (float)(v6 * 60.0) + 0.0);
cocos2d::CCPoint::operator=(p_m_controlPosition, COERCE_FLOAT(&v13), v7, v8);
a1->m_controlSprite->setPosition(a1->m_controlSprite, (const cocos2d::CCPoint *)p_m_controlPosition);
v9 = COERCE_FLOAT(roundf());
m_currentRotation = a1->m_currentRotation;
v11 = v9 / 1000.0;
if ( (float)(v9 / 1000.0) != m_currentRotation )
{
m_delegate = a1->m_delegate;
a1->m_currentRotation = v11;
if ( m_delegate )
((void (__fastcall *)(GJRotationControlDelegate *, _DWORD))m_delegate->angleChanged)(
m_delegate,
v11 - m_currentRotation);
}
}