//
// cocos2d::ccDrawCardinalSpline from 0x7cbb98 to 0x7cbd18 (384 bytes)
//
// 1 xrefs:
// > cocos2d::ccDrawCatmullRom @ 0x7cbd2e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:31 +0000
//
void __fastcall cocos2d::ccDrawCardinalSpline(
cocos2d *this,
cocos2d::CCPointArray *a2,
unsigned int a3,
unsigned int a4)
{
int v5; // r6
unsigned int v6; // r8
unsigned int v7; // r0
_DWORD *v8; // r7
_DWORD *v9; // r9
float v10; // s17
float v11; // s15
float v12; // s16
unsigned int v13; // r4
unsigned int v14; // r1
_BYTE v17[8]; // [sp+2Ch] [bp-8h] BYREF
_BYTE v18[8]; // [sp+34h] [bp+0h] BYREF
_BYTE v19[8]; // [sp+3Ch] [bp+8h] BYREF
_BYTE v20[8]; // [sp+44h] [bp+10h] BYREF
_DWORD v21[2]; // [sp+4Ch] [bp+18h] BYREF
v5 = 0;
cocos2d::ccDrawInit(this);
v6 = a3 + 1;
if ( a3 + 1 > 0xFE00000 )
v7 = -1;
else
v7 = 8 * v6;
v8 = (_DWORD *)operator new[](v7);
v9 = v8 + 1;
v10 = 1.0 / (float)(unsigned int)cocos2d::CCPointArray::count(this);
while ( v5 < v6 )
{
v11 = (float)v5 / (float)a3;
if ( v11 == 1.0 )
{
v12 = 1.0;
v13 = cocos2d::CCPointArray::count(this) - 1;
}
else
{
v13 = (unsigned int)(float)(v11 / v10);
v12 = (float)(v11 - (float)(v10 * (float)v13)) / v10;
}
++v5;
cocos2d::CCPointArray::getControlPointAtIndex((cocos2d::CCPointArray *)v17, (unsigned int)this, v13 - 1);
cocos2d::CCPointArray::getControlPointAtIndex((cocos2d::CCPointArray *)v18, (unsigned int)this, v13);
cocos2d::CCPointArray::getControlPointAtIndex((cocos2d::CCPointArray *)v19, (unsigned int)this, v13 + 1);
cocos2d::CCPointArray::getControlPointAtIndex((cocos2d::CCPointArray *)v20, (unsigned int)this, v13 + 2);
cocos2d::ccCardinalSplineAt(
(cocos2d *)v21,
(cocos2d::CCPoint *)v17,
(cocos2d::CCPoint *)v18,
(cocos2d::CCPoint *)v19,
(cocos2d::CCPoint *)v20,
*(float *)&a2,
v12);
*(v9 - 1) = v21[0];
*v9 = v21[1];
v9 += 2;
}
cocos2d::CCGLProgram::use((cocos2d::CCGLProgram *)dword_D2F18C);
cocos2d::CCGLProgram::setUniformsForBuiltins((cocos2d::CCGLProgram *)dword_D2F18C);
cocos2d::CCGLProgram::setUniformLocationWith4fv(
(cocos2d::CCGLProgram *)dword_D2F18C,
dword_D1FE20,
(float *)&dword_D1FE28,
1u);
cocos2d::ccGLEnableVertexAttribs((cocos2d *)((char *)&dword_0 + 1), v14);
glVertexAttribPointer();
glDrawArrays(3u, 0, a3 + 1);
operator delete[](v8);
++g_uNumberOfDraws;
}