//
// cocos2d::CCGridBase::initWithSize from 0x180023b40 to 0x180023c28 (232 bytes)
//
// 6 xrefs:
// > cocos2d::CCGrid3D::create @ 0x180023743
// > cocos2d::CCGridBase::create @ 0x1800238d5
// > cocos2d::CCTiledGrid3D::create @ 0x1800239e3
// > cocos2d::CCGridBase::initWithSize @ 0x180023b1e
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b913c
//
// 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 11:21:29 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall cocos2d::CCGridBase::initWithSize(
cocos2d::CCGridBase *this,
const struct cocos2d::CCSize *a2,
struct cocos2d::CCTexture2D *a3,
char a4)
{
unsigned __int8 v7; // si
__int64 v8; // rdi
__int64 v9; // rax
cocos2d::CCShaderCache *v10; // rax
float v12; // [rsp+50h] [rbp+8h] BYREF
float v13; // [rsp+54h] [rbp+Ch]
__int64 v14; // [rsp+60h] [rbp+18h]
v7 = 1;
*((_BYTE *)this + 56) = 0;
v8 = 0;
*((_DWORD *)this + 15) = 0;
cocos2d::CCSize::operator=((_DWORD *)this + 16, a2);
*((_QWORD *)this + 9) = a3;
if ( a3 )
cocos2d::CCObject::retain(a3);
*((_BYTE *)this + 96) = a4;
(*(void (__fastcall **)(_QWORD, float *))(**((_QWORD **)this + 9) + 136LL))(*((_QWORD *)this + 9), &v12);
*((float *)this + 20) = v12 / *((float *)this + 16);
*((float *)this + 21) = v13 / *((float *)this + 17);
v9 = sub_1800E4AC0(0x50u);
v14 = v9;
if ( v9 )
v8 = cocos2d::CCGrabber::CCGrabber(v9);
*((_QWORD *)this + 11) = v8;
if ( v8 )
cocos2d::CCGrabber::grab(v8, *((_QWORD *)this + 9));
else
v7 = 0;
v10 = cocos2d::CCShaderCache::sharedShaderCache();
*((_QWORD *)this + 13) = cocos2d::CCShaderCache::programForKey(v10, "ShaderPositionTexture");
(*(void (__fastcall **)(cocos2d::CCGridBase *))(*(_QWORD *)this + 88LL))(this);
return v7;
}