//
// cocos2d::CCDrawNode::init from 0x1800151e0 to 0x180015369 (393 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800ec7a0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b8554
//
// 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:23 +0000
//
char __fastcall cocos2d::CCDrawNode::init(cocos2d::CCDrawNode *this)
{
__int64 v1; // rbx
cocos2d::CCShaderCache *v3; // rax
struct cocos2d::CCGLProgram *v4; // rax
int v5; // ecx
unsigned int v6; // edx
__int64 v7; // rax
void *v8; // rcx
__int64 v9; // r9
v1 = *(_QWORD *)this;
*((_DWORD *)this + 92) = 1;
*((_DWORD *)this + 93) = 771;
v3 = cocos2d::CCShaderCache::sharedShaderCache();
v4 = cocos2d::CCShaderCache::programForKey(v3, "ShaderPositionColor");
(*(void (__fastcall **)(cocos2d::CCDrawNode *, struct cocos2d::CCGLProgram *))(v1 + 656))(this, v4);
v5 = 512;
v6 = *((_DWORD *)this + 88);
if ( *((_DWORD *)this + 89) + 512 > v6 )
{
if ( v6 > 0x200 )
v5 = *((_DWORD *)this + 88);
v7 = v6 + v5;
v8 = *((void **)this + 45);
*((_DWORD *)this + 88) = v7;
*((_QWORD *)this + 45) = realloc(v8, 20 * v7);
}
_glewGenBuffers(1, (char *)this + 348);
_glewBindBuffer(34962, *((unsigned int *)this + 87));
_glewBufferData(34962, 20LL * *((unsigned int *)this + 88), *((_QWORD *)this + 45), 35040);
_glewEnableVertexAttribArray(0);
_glewVertexAttribPointer(0, 2, 5126, 0, 20, 0);
_glewEnableVertexAttribArray(1);
LOBYTE(v9) = 1;
_glewVertexAttribPointer(1, 4, 5121, v9, 20, 8);
_glewBindBuffer(34962, 0);
*((_BYTE *)this + 376) = 1;
return 1;
}