//
// EditorUI::applySpecialOffset from 0x693eb8 to 0x69403c (388 bytes)
//
// 4 xrefs:
// > EditorUI::findSnapObject @ 0x69415c
// > EditorUI::findSnapObject @ 0x69429c
// > EditorUI::ccTouchEnded @ 0x6c2e38
// > ??> @ 0x46548
//
// 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
//
cocos2d::CCPoint EditorUI::applySpecialOffset(EditorUI *a1, cocos2d::CCPoint a2, GameObject *a3, cocos2d::CCPoint a4)
{
__int64 v4; // x2
cocos2d::CCPoint *v5; // x3
cocos2d::CCPoint *v6; // x8
__int64 v7; // x20
cocos2d::CCPoint *v9; // x22
cocos2d::CCPoint *v10; // x24
const cocos2d::CCPoint *v14; // x0
float v15; // s0
float v16; // s1
const cocos2d::CCPoint *v17; // x0
float v18; // s0
float v19; // s0
float v20; // [xsp+58h] [xbp+58h] BYREF
float v21; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v22; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v23; // 0:s0.4,4:s1.4
cocos2d::CCPoint result; // 0:s0.4,4:s1.4
v7 = v4;
v9 = v6;
v10 = v5;
if ( EditorUI::isSpecialSnapObject(a1, *(_DWORD *)(v4 + 1012)) )
{
v14 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 192LL))(v7);
cocos2d::CCPoint::CCPoint(&v22, v14);
EditorUI::getGridSnappedPos(a1, v23);
if ( !(unsigned __int8)cocos2d::CCPoint::equals(v10, (const cocos2d::CCPoint *)&dword_1242110) )
cocos2d::CCPoint::operator=(&v20, v15, v16);
v17 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 192LL))(v7);
cocos2d::CCPoint::CCPoint(&v22, v17);
v18 = fabsf(*(float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
if ( v18 > 0.0 )
{
if ( vabds_f32(v18 + v22.x, v20) < vabds_f32(v22.x - v18, v20) )
v18 = -v18;
*(float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = v18;
}
v19 = fabsf(*((float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 1));
if ( v19 > 0.0 )
{
if ( vabds_f32(v19 + v22.y, v21) < vabds_f32(v22.y - v19, v21) )
*((float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 1) = -v19;
else
*((float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 1) = v19;
}
}
cocos2d::CCPoint::CCPoint(v9, (const cocos2d::CCPoint *)a3);
return result;
}