//
// drawLightning from 0x575410 to 0x575650 (576 bytes)
//
// 5 xrefs:
// > drawLightning @ 0x57559c
// > drawLightning @ 0x5755d8
// > cocos2d::CCLightning::draw @ 0x575708
// > cocos2d::CCLightning::draw @ 0x575754
// > ??> @ 0xa9a28
//
// 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 *__usercall drawLightning@(
const cocos2d::CCPoint *a1@,
const cocos2d::CCPoint *a2@,
int a3@,
unsigned int a4@,
unsigned __int64 a5@,
__int64 a6@,
_DWORD *a7@,
cocos2d::CCPoint *a8@)
{
float v14; // s0
float v15; // s1
int v16; // w2
float v17; // s0
float v18; // s0
float v20; // s0
float v21; // s1
unsigned __int64 v23[2]; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCPoint v24; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v25; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCPoint v26; // 0:s0.4,4:s1.4
cocos2d::CCPoint v27; // 0:s0.4,4:s1.4
cocos2d::CCPoint v28; // 0:s2.4,4:s3.4
cocos2d::CCPoint v29; // 0:s2.4,4:s3.4
v23[0] = a5;
cocos2d::CCPoint::operator+(&v25, a1, a2);
cocos2d::CCPoint::operator*(&v25, 0.5);
v16 = a3;
if ( a3 < (int)a4 )
{
cocos2d::CCPoint::operator=(a6 + 8LL * (unsigned int)*a7, v14, v15);
cocos2d::CCPoint::operator=(a6 + 8LL * (unsigned int)(*a7 + 1), v20, v21);
*a7 += 2;
}
else
{
v17 = a8->x + ((double)((int)getNextRandom(v23) % 101) / 100.0 - 0.5) * (double)v16;
a8->x = v17;
v18 = a8->y + (double)a3 * ((double)((int)getNextRandom(v23) % 101) / 100.0 - 0.5);
a8->y = v18;
cocos2d::CCPoint::CCPoint(&v24, a1);
cocos2d::CCPoint::CCPoint(&v25, a8);
drawLightning(
v26,
v28,
(int)&v24,
(int)&v25,
(unsigned int)(a3 / 2),
(cocos2d::CCPoint *)a4,
(unsigned int *)v23[0]);
cocos2d::CCPoint::CCPoint(&v24, a2);
cocos2d::CCPoint::CCPoint(&v25, a8);
drawLightning(
v27,
v29,
(int)&v24,
(int)&v25,
(unsigned int)(a3 / 2),
(cocos2d::CCPoint *)a4,
(unsigned int *)v23[0]);
}
return a8;
}