//
// cocos2d::CCRenderTexture::draw from 0x180061d70 to 0x180061f7b (523 bytes)
//
// 5 xrefs:
// > ??> @ 0x180100448
// > ??> @ 0x1801427e4
// > ??> @ 0x180142818
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd6cc
//
// 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:51 +0000
//
void __fastcall cocos2d::CCRenderTexture::draw(cocos2d::CCRenderTexture *this)
{
int v2; // eax
__int64 v3; // rax
unsigned int *v4; // rbx
__int64 v5; // rax
__int64 *v6; // rbx
__int64 *i; // rsi
__int64 v8; // rcx
cocos2d::CCDirector *v9; // rbx
GLfloat v10; // [rsp+20h] [rbp-28h] BYREF
GLint s; // [rsp+24h] [rbp-24h] BYREF
GLfloat params[4]; // [rsp+28h] [rbp-20h] BYREF
if ( *((_BYTE *)this + 400) )
{
cocos2d::CCRenderTexture::begin(this);
v2 = *((_DWORD *)this + 93);
if ( v2 )
{
v10 = 0.0;
s = 0;
*(_OWORD *)params = 0;
if ( (v2 & 0x4000) != 0 )
{
glGetFloatv(0xC22u, params);
glClearColor(
*((GLclampf *)this + 94),
*((GLclampf *)this + 95),
*((GLclampf *)this + 96),
*((GLclampf *)this + 97));
}
if ( (*((_DWORD *)this + 93) & 0x100) != 0 )
{
glGetFloatv(0xB73u, &v10);
glClearDepth(*((float *)this + 98));
}
if ( (*((_DWORD *)this + 93) & 0x400) != 0 )
{
glGetIntegerv(0xB91u, &s);
glClearStencil(*((_DWORD *)this + 99));
}
glClear(*((_DWORD *)this + 93));
if ( (*((_DWORD *)this + 93) & 0x4000) != 0 )
glClearColor(params[0], params[1], params[2], params[3]);
if ( (*((_DWORD *)this + 93) & 0x100) != 0 )
glClearDepth(v10);
if ( (*((_DWORD *)this + 93) & 0x400) != 0 )
glClearStencil(s);
}
(*(void (__fastcall **)(cocos2d::CCRenderTexture *))(*(_QWORD *)this + 592LL))(this);
v3 = *((_QWORD *)this + 26);
if ( v3 )
{
v4 = *(unsigned int **)(v3 + 56);
v5 = *v4;
if ( (_DWORD)v5 )
{
v6 = *((__int64 **)v4 + 2);
for ( i = &v6[v5 - 1]; v6 <= i; ++v6 )
{
v8 = *v6;
if ( !*v6 )
break;
if ( v8 != *((_QWORD *)this + 40) )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 744LL))(v8);
}
}
}
v9 = cocos2d::CCDirector::sharedDirector();
_glewBindFramebuffer(36160, *((unsigned int *)this + 84));
cocos2d::CCDirector::setViewport(v9);
kmGLMatrixMode(5889);
kmGLPopMatrix();
kmGLMatrixMode(5888);
kmGLPopMatrix();
}
}