//
// cocos2d::CCGridBase::initWithSize from 0x7ce4dc to 0x7ce588 (172 bytes)
//
// 3 xrefs:
// > cocos2d::CCGridBase::create @ 0x7ce5aa
// > cocos2d::CCGrid3D::create @ 0x7ce7ae
// > cocos2d::CCTiledGrid3D::create @ 0x7ce8f6
//
// 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
//
int __fastcall cocos2d::CCGridBase::initWithSize(cocos2d::CCGridBase *this, const cocos2d::CCSize *a2)
{
float *v4; // r0
unsigned int v5; // r1
int POT; // r7
unsigned int v7; // r1
int v8; // r9
void *v9; // r4
cocos2d::CCTexture2D *v11; // r11
float v12[2]; // [sp+Ch] [bp-10h] BYREF
v4 = (float *)cocos2d::CCDirector::sharedDirector(this);
cocos2d::CCDirector::getWinSizeInPixels((cocos2d::CCDirector *)v12, v4);
POT = cocos2d::ccNextPOT((cocos2d *)v12[0], v5);
v8 = cocos2d::ccNextPOT((cocos2d *)v12[1], v7);
v9 = calloc(4 * v8 * POT, 1u);
if ( v9 )
{
v11 = (cocos2d::CCTexture2D *)operator new(0x60u);
cocos2d::CCTexture2D::CCTexture2D(v11);
cocos2d::CCTexture2D::initWithData(v11, v9, 0, POT, v8, v12);
free(v9);
cocos2d::CCGridBase::initWithSize(this, a2, v11, 0);
cocos2d::CCObject::release(v11);
return 1;
}
else
{
cocos2d::CCObject::release(this);
return 0;
}
}