//
// cocos2d::CCGridBase::initWithSize_1 from 0x1004de5b0 to 0x1004de67f (207 bytes)
//
// 3 xrefs:
// > cocos2d::CCGridBase::create_1 @ 0x1004de55a
// > cocos2d::CCGrid3D::create_1 @ 0x1004dec9c
// > cocos2d::CCTiledGrid3D::create_1 @ 0x1004df91c
//
// This function is hookable on this platform (idp: pc, 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 12:31:17 +0000
//
bool __fastcall cocos2d::CCGridBase::initWithSize_1(_DWORD *a1, __int64 a2)
{
float *v2; // rax
unsigned int v3; // r12d
GLsizei v4; // r13d
void *v5; // r15
_DWORD *v6; // r14
_QWORD v8[6]; // [rsp+10h] [rbp-30h] BYREF
v2 = (float *)cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSizeInPixels((float *)v8, v2);
v3 = sub_1005A4800((unsigned int)(int)*(float *)v8);
v4 = sub_1005A4800((unsigned int)(int)*((float *)v8 + 1));
v5 = calloc((int)(4 * v3 * v4), 1u);
if ( v5 )
{
v6 = operator new(0x68u);
sub_10046C920((__int64)v6);
cocos2d::CCTexture2D::initWithData((__int64)v6, v5, 0, v3, v4, v8);
free(v5);
cocos2d::CCGridBase::initWithSize(a1, a2, v6, 0);
a1 = v6;
}
cocos2d::CCObject::release(a1);
return v5 != nullptr;
}