//
// cocos2d::CCMotionStreak::initWithFade from 0x100576620 to 0x1005767e2 (450 bytes)
//
// 3 xrefs:
// > cocos2d::CCMotionStreak::create_1 @ 0x10057641e
// > cocos2d::CCMotionStreak::initWithFade_1 @ 0x1005764bf
// > cocos2d::CCMotionStreak::create @ 0x1005765cc
//
// 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 __fastcall cocos2d::CCMotionStreak::initWithFade(
cocos2d::CCMotionStreak *a1,
float a2,
float a3,
float a4,
const cocos2d::ccColor3B *a5,
cocos2d::CCTexture2D *a6)
{
float v7; // xmm0_4
size_t v8; // r12
size_t v9; // r13
cocos2d::CCShaderCache *v10; // rax
cocos2d::CCGLProgram *v11; // rax
cocos2d::CCNode::setPosition_1(a1, (const cocos2d::CCPoint *)&dbl_1009A2B28);
((void (__fastcall *)(cocos2d::CCMotionStreak *, double *))a1->setAnchorPoint)(a1, &dbl_1009A2B28);
((void (__fastcall *)(cocos2d::CCMotionStreak *, __int64))a1->ignoreAnchorPointForPosition)(a1, 1);
*(_WORD *)&a1->m_bStartingPositionInitialized = 256;
sub_10028CC90(&a1->m_tPositionR, &dbl_1009A2B28);
a1->m_bFastMode = 1;
if ( a3 == -1.0 )
a3 = a4 / 5.0;
a1->m_fMinSeg = a3 * a3;
a1->m_fStroke = a4;
a1->m_fFadeDelta = 1.0 / a2;
v7 = (float)((int)(float)(a2 * 60.0) + 2) * 5.0;
*(_QWORD *)&a1->m_uMaxPoints = (unsigned int)(int)v7;
v8 = (unsigned int)(int)v7;
a1->m_pPointState = (float *)malloc(4 * v8);
v9 = 8 * v8;
a1->m_pPointVertexes = (cocos2d::CCPoint *)malloc(8 * v8);
v8 *= 16LL;
a1->m_pVertices = (cocos2d::ccVertex2F *)malloc(v8);
a1->m_pTexCoords = (cocos2d::ccTex2F *)malloc(v8);
a1->m_pColorPointer = (GLubyte *)malloc(v9);
a1->m_tBlendFunc = (cocos2d::ccBlendFunc)0x30300000302LL;
v10 = cocos2d::CCShaderCache::sharedShaderCache();
v11 = cocos2d::CCShaderCache::programForKey(v10, "ShaderPositionTextureColor");
((void (__fastcall *)(cocos2d::CCMotionStreak *, cocos2d::CCGLProgram *))a1->setShaderProgram)(a1, v11);
((void (__fastcall *)(cocos2d::CCMotionStreak *, cocos2d::CCTexture2D *))a1->setTexture)(a1, a6);
((void (__fastcall *)(cocos2d::CCMotionStreak *, const cocos2d::ccColor3B *))a1->setColor)(a1, a5);
cocos2d::CCNode::scheduleUpdate(a1);
return 1;
}