//
// cocos2d::CCMotionStreak::initWithFade from 0x100176d4c to 0x100176ef0 (420 bytes)
//
// 2 xrefs:
// > cocos2d::CCMotionStreak::initWithFade_1 @ 0x100176c9c
// > cocos2d::CCMotionStreak::create @ 0x100176d10
//
// 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 v12; // s1
size_t v13; // x23
cocos2d::CCShaderCache *v14; // x0
cocos2d::CCGLProgram *v15; // x0
cocos2d::CCNode::setPosition_1(a1, (const cocos2d::CCPoint *)&qword_10086BAF0);
((void (__fastcall *)(cocos2d::CCMotionStreak *, __int64 *))a1->setAnchorPoint)(a1, &qword_10086BAF0);
((void (__fastcall *)(cocos2d::CCMotionStreak *, __int64))a1->ignoreAnchorPointForPosition)(a1, 1);
*(_WORD *)&a1->m_bStartingPositionInitialized = 256;
sub_1000229D0(&a1->m_tPositionR, (double *)&qword_10086BAF0);
a1->m_bFastMode = 1;
v12 = a4 / 5.0;
if ( a3 != -1.0 )
v12 = a3;
a1->m_fMinSeg = v12 * v12;
a1->m_fStroke = a4;
a1->m_fFadeDelta = 1.0 / a2;
v13 = (unsigned int)(float)((float)(unsigned int)((int)(float)(a2 * 60.0) + 2) * 5.0);
*(_QWORD *)&a1->m_uMaxPoints = (unsigned int)v13;
a1->m_pPointState = (float *)malloc(4 * v13);
a1->m_pPointVertexes = (cocos2d::CCPoint *)malloc(8 * v13);
v13 *= 16LL;
a1->m_pVertices = (cocos2d::ccVertex2F *)malloc(v13);
a1->m_pTexCoords = (cocos2d::ccTex2F *)malloc(v13);
a1->m_pColorPointer = (GLubyte *)malloc(
8LL
* (unsigned int)(float)((float)(unsigned int)((int)(float)(a2 * 60.0) + 2) * 5.0));
a1->m_tBlendFunc = (cocos2d::ccBlendFunc)0x30300000302LL;
v14 = cocos2d::CCShaderCache::sharedShaderCache();
v15 = cocos2d::CCShaderCache::programForKey(v14, "ShaderPositionTextureColor");
((void (__fastcall *)(cocos2d::CCMotionStreak *, cocos2d::CCGLProgram *))a1->setShaderProgram)(a1, v15);
((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;
}