//
// cocos2d::CCGrid3D::calculateVertexPoints from 0x7ce004 to 0x7ce350 (844 bytes)
//
// 0 xrefs:
//
// 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:33 +0000
//
void *__fastcall cocos2d::CCGrid3D::calculateVertexPoints(cocos2d::CCGrid3D *this)
{
float v2; // s18
float v3; // s17
float v4; // s19
void *v5; // r0
void *v6; // r0
void *v7; // r0
void *v8; // r0
float v9; // s16
float v10; // s21
unsigned int v11; // r5
int v12; // r6
float v13; // s16
float v14; // s21
int v15; // s16
float v16; // s15
float v17; // s14
float v18; // s23
float v19; // s24
float v20; // s13
char *v21; // r8
int v22; // r12
float v23; // s14
float v24; // s26
int v25; // r3
float v26; // s25
float v27; // s24
float v28; // s23
float *v29; // r5
int v30; // r0
_DWORD *v31; // r2
int v32; // r3
float v33; // s15
char *v34; // r1
float *v35; // r1
float v36; // s15
char *v38; // [sp+0h] [bp-D4h]
char *v39; // [sp+4h] [bp-D0h]
char *v40; // [sp+8h] [bp-CCh]
int v41; // [sp+20h] [bp-B4h]
int v42; // [sp+24h] [bp-B0h]
int v43; // [sp+28h] [bp-ACh]
float v44[12]; // [sp+2Ch] [bp-A8h] BYREF
_DWORD v45[4]; // [sp+5Ch] [bp-78h]
_DWORD v46[4]; // [sp+6Ch] [bp-68h]
float v47[2]; // [sp+7Ch] [bp-58h] BYREF
float v48[2]; // [sp+84h] [bp-50h] BYREF
float v49[2]; // [sp+8Ch] [bp-48h] BYREF
float v50[2]; // [sp+94h] [bp-40h] BYREF
_DWORD v51[12]; // [sp+9Ch] [bp-38h] BYREF
v2 = (float)(unsigned int)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 17) + 44))(*((_DWORD *)this + 17));
v3 = (float)(unsigned int)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 17) + 48))(*((_DWORD *)this + 17));
v4 = *(float *)(cocos2d::CCTexture2D::getContentSizeInPixels(*((cocos2d::CCTexture2D **)this + 17)) + 4);
v5 = *((void **)this + 25);
if ( v5 )
{
free(v5);
*((_DWORD *)this + 25) = 0;
}
v6 = *((void **)this + 26);
if ( v6 )
{
free(v6);
*((_DWORD *)this + 26) = 0;
}
v7 = *((void **)this + 24);
if ( v7 )
{
free(v7);
*((_DWORD *)this + 24) = 0;
}
v8 = *((void **)this + 27);
if ( v8 )
free(v8);
v9 = *((float *)this + 15);
v10 = *((float *)this + 16);
v11 = (unsigned int)(float)((float)(v9 + 1.0) * (float)(v10 + 1.0));
v38 = (char *)malloc(12 * v11);
*((_DWORD *)this + 25) = v38;
v12 = 0;
*((_DWORD *)this + 26) = malloc(12 * v11);
v39 = (char *)malloc(8 * v11);
*((_DWORD *)this + 24) = v39;
v40 = (char *)malloc((unsigned int)(float)((float)((float)(v9 * v10) + (float)(v9 * v10)) * 6.0));
*((_DWORD *)this + 27) = v40;
while ( 1 )
{
v13 = *((float *)this + 15);
v14 = (float)v12;
if ( (float)v12 >= v13 )
break;
v15 = 0;
while ( 1 )
{
v16 = (float)v15;
v17 = *((float *)this + 16);
if ( (float)v15 >= v17 )
break;
v18 = *((float *)this + 19);
v19 = *((float *)this + 18);
++v15;
v20 = v14 * (float)(v17 + 1.0);
v21 = &v40[12 * (int)(float)(v14 + (float)(v16 * *((float *)this + 15)))];
v22 = (unsigned __int16)(unsigned int)(float)(v20 + v16);
LOWORD(v41) = (unsigned int)(float)(v20 + v16);
v23 = (float)(v12 + 1) * (float)(v17 + 1.0);
v24 = v16 * v18;
v25 = (unsigned __int16)(unsigned int)(float)(v23 + v16);
HIWORD(v41) = (unsigned int)(float)(v23 + v16);
HIWORD(v42) = HIWORD(v41);
LOWORD(v43) = (unsigned int)(float)(v23 + (float)v15);
v26 = v14 * v19;
LOWORD(v42) = (unsigned int)(float)(v20 + (float)v15);
HIWORD(v43) = v42;
*(_DWORD *)v21 = v41;
*((_DWORD *)v21 + 1) = v42;
*((_DWORD *)v21 + 2) = v43;
v27 = (float)(v14 * v19) + v19;
v45[1] = 3 * v25;
v45[0] = 3 * v22;
v45[2] = 3 * (unsigned __int16)v43;
v45[3] = 3 * (unsigned __int16)v42;
memset(v44, 0, sizeof(v44));
v28 = (float)(v16 * v18) + v18;
v44[0] = v26;
v44[1] = v24;
v44[3] = v27;
v44[4] = v24;
*(float *)v51 = v26;
*(float *)&v51[1] = v24;
*(float *)&v51[2] = v44[2];
v44[6] = v27;
v44[7] = v28;
*(float *)&v51[3] = v27;
*(float *)&v51[4] = v24;
*(float *)&v51[5] = v44[5];
v44[9] = v26;
v44[10] = v28;
*(float *)&v51[6] = v27;
*(float *)&v51[7] = v28;
*(float *)&v51[8] = v44[8];
*(float *)&v51[9] = v26;
*(float *)&v51[10] = v28;
*(float *)&v51[11] = v44[11];
v29 = v47;
v46[0] = 2 * v22;
v46[2] = 2 * (unsigned __int16)v43;
v46[1] = 2 * v25;
v46[3] = 2 * (unsigned __int16)v42;
cocos2d::CCPoint::CCPoint(v47, v26, v24);
cocos2d::CCPoint::CCPoint(v48, v27, v24);
cocos2d::CCPoint::CCPoint(v49, v27, v28);
cocos2d::CCPoint::CCPoint(v50, v26, v28);
v30 = *((unsigned __int8 *)this + 84);
v31 = v51;
v32 = 0;
do
{
v33 = *v29 / v2;
v34 = &v38[4 * v45[v32]];
*(_DWORD *)v34 = *v31;
*((_DWORD *)v34 + 1) = v31[1];
*((_DWORD *)v34 + 2) = v31[2];
v35 = (float *)&v39[4 * v46[v32]];
*v35 = v33;
v36 = v29[1];
if ( v30 )
v36 = v4 - v36;
++v32;
v31 += 3;
v29 += 2;
v35[1] = v36 / v3;
}
while ( v32 != 4 );
}
++v12;
}
return memcpy(
*((void **)this + 26),
*((const void **)this + 25),
(unsigned int)(float)((float)((float)(v13 + 1.0) * (float)(*((float *)this + 16) + 1.0)) * 12.0));
}