//
// GJBaseGameLayer::rectIntersectsCircle from 0x46e7e4 to 0x46e980 (412 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::damagingObjectsInRect @ 0x46eda0
//
// 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 GJBaseGameLayer::rectIntersectsCircle(GJBaseGameLayer *a1, cocos2d::CCRect a2, cocos2d::CCPoint a3, float a4)
{
float x; // r5
float y; // r4
float width; // s16
float v7; // s20
float v8; // s19
float v9; // s17
float v10; // s18
cocos2d::CCPoint v12; // [sp+4h] [bp-24h] BYREF
cocos2d::CCPoint v13; // [sp+Ch] [bp-1Ch] BYREF
cocos2d::CCPoint v14; // [sp+14h] [bp-14h] BYREF
cocos2d::CCPoint v15; // [sp+1Ch] [bp-Ch] BYREF
x = a2.origin.x;
y = a2.origin.y;
width = a2.size.width;
v7 = COERCE_FLOAT(cocos2d::CCRect::getMaxX((cocos2d::CCRect *)LODWORD(a2.origin.x)));
v8 = COERCE_FLOAT(cocos2d::CCRect::getMinX((cocos2d::CCRect *)LODWORD(x)));
v9 = COERCE_FLOAT(cocos2d::CCRect::getMaxY((cocos2d::CCRect *)LODWORD(x)));
v10 = COERCE_FLOAT(cocos2d::CCRect::getMinY((cocos2d::CCRect *)LODWORD(x)));
if ( cocos2d::CCRect::containsPoint((cocos2d::CCRect *)LODWORD(x), (const cocos2d::CCPoint *)LODWORD(y)) )
return 1;
cocos2d::CCPoint::CCPoint(&v12, v7, v9);
if ( fabsf(cocos2d::ccpDistance(&v12, (const cocos2d::CCPoint *)LODWORD(y))) < width )
return 1;
cocos2d::CCPoint::CCPoint(&v13, v7, v10);
if ( fabsf(cocos2d::ccpDistance(&v13, (const cocos2d::CCPoint *)LODWORD(y))) < width )
return 1;
cocos2d::CCPoint::CCPoint(&v14, v8, v10);
if ( fabsf(cocos2d::ccpDistance(&v14, (const cocos2d::CCPoint *)LODWORD(y))) < width )
return 1;
cocos2d::CCPoint::CCPoint(&v15, v8, v9);
if ( fabsf(cocos2d::ccpDistance(&v15, (const cocos2d::CCPoint *)LODWORD(y))) < width )
return 1;
cocos2d::CCPoint::CCPoint(&v15, (const cocos2d::CCPoint *)LODWORD(y));
if ( v15.x > v7 )
v15.x = v7;
if ( v15.x < v8 )
v15.x = v8;
if ( v15.y < v10 )
v15.y = v10;
if ( v15.y > v9 )
v15.y = v9;
return cocos2d::ccpDistance(&v15, (const cocos2d::CCPoint *)LODWORD(y)) < width;
}