//
// cocos2d::ccDrawCardinalSpline from 0xd4b66c to 0xd4b89c (560 bytes)
//
// 2 xrefs:
// > cocos2d::ccDrawCatmullRom @ 0xd4b8a0
// > ??> @ 0x44470
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:07:38 +0000
//
__int64 __fastcall cocos2d::ccDrawCardinalSpline(cocos2d *this, cocos2d::CCPointArray *a2, float a3)
{
unsigned int v4; // w19
unsigned int v6; // w25
float v7; // s9
float v8; // s11
_DWORD *v9; // x26
unsigned int v10; // w28
unsigned int v11; // w19
float v12; // s8
float v13; // s0
unsigned int v14; // w1
_DWORD *v16; // [xsp+98h] [xbp+98h]
char v17[8]; // [xsp+A0h] [xbp+A0h] BYREF
char v18[8]; // [xsp+A8h] [xbp+A8h] BYREF
char v19[8]; // [xsp+B0h] [xbp+B0h] BYREF
char v20[8]; // [xsp+B8h] [xbp+B8h] BYREF
_DWORD v21[2]; // [xsp+C0h] [xbp+C0h] BYREF
v4 = (unsigned int)a2;
if ( !byte_1560140 )
sub_D4A780(nullptr);
v6 = v4 + 1;
v16 = (_DWORD *)operator new[](8LL * (v4 + 1));
v7 = 1.0 / (float)(unsigned int)cocos2d::CCPointArray::count(this);
if ( v4 != -1 )
{
v8 = (float)v4;
v9 = v16;
v10 = 0;
do
{
v13 = (float)v10 / v8;
if ( v13 == 1.0 )
{
v12 = 1.0;
v11 = cocos2d::CCPointArray::count(this) - 1;
}
else
{
v11 = (unsigned int)(float)(v13 / v7);
v12 = (float)(v13 - (float)((float)v11 * v7)) / v7;
}
v9 += 2;
++v10;
cocos2d::CCPointArray::getControlPointAtIndex(this, v11 - 1, (cocos2d::CCPoint *)v17);
cocos2d::CCPointArray::getControlPointAtIndex(this, v11, (cocos2d::CCPoint *)v18);
cocos2d::CCPointArray::getControlPointAtIndex(this, v11 + 1, (cocos2d::CCPoint *)v19);
cocos2d::CCPointArray::getControlPointAtIndex(this, v11 + 2, (cocos2d::CCPoint *)v20);
cocos2d::ccCardinalSplineAt(
(cocos2d *)v17,
(cocos2d::CCPoint *)v18,
(cocos2d::CCPoint *)v19,
(cocos2d::CCPoint *)v20,
a3,
v12,
(cocos2d::CCPoint *)v21);
*(v9 - 2) = v21[0];
*(v9 - 1) = v21[1];
}
while ( v6 != v10 );
}
cocos2d::CCGLProgram::use((cocos2d::CCGLProgram *)qword_1560138);
cocos2d::CCGLProgram::setUniformsForBuiltins((cocos2d::CCGLProgram *)qword_1560138);
cocos2d::CCGLProgram::setUniformLocationWith4fv(
(cocos2d::CCGLProgram *)qword_1560138,
dword_154A088,
(float *)&dword_154A090,
1u);
cocos2d::ccGLEnableVertexAttribs((cocos2d *)((char *)&dword_0 + 1), v14);
glVertexAttribPointer();
glDrawArrays();
operator delete[](v16);
return (unsigned int)++g_uNumberOfDraws;
}