//
// cocos2d::CCRenderTexture::beginWithClear from 0x1006c8890 to 0x1006c8a2d (413 bytes)
//
// 1 xrefs:
// > cocos2d::CCRenderTexture::beginWithClear_1 @ 0x1006c8b1a
//
// 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:35:35 +0000
//
__int64 __fastcall cocos2d::CCRenderTexture::beginWithClear(
__int64 a1,
GLint a2,
GLbitfield a3,
GLfloat a4,
GLfloat a5,
GLfloat a6,
GLfloat a7,
float a8)
{
GLfloat v11; // [rsp+18h] [rbp-38h] BYREF
GLint s; // [rsp+1Ch] [rbp-34h] BYREF
GLfloat params[6]; // [rsp+20h] [rbp-30h] BYREF
cocos2d::CCRenderTexture::begin(a1);
*(_OWORD *)params = 0;
v11 = 0.0;
s = 0;
if ( (a3 & 0x4000) != 0 )
{
glGetFloatv(0xC22u, params);
glClearColor(a4, a5, a6, a7);
if ( (a3 & 0x100) == 0 )
{
LABEL_3:
if ( (a3 & 0x400) == 0 )
goto LABEL_4;
goto LABEL_10;
}
}
else if ( (a3 & 0x100) == 0 )
{
goto LABEL_3;
}
glGetFloatv(0xB73u, &v11);
glClearDepth(a8);
if ( (a3 & 0x400) == 0 )
{
LABEL_4:
glClear(a3);
if ( (a3 & 0x4000) == 0 )
goto LABEL_5;
goto LABEL_11;
}
LABEL_10:
glGetIntegerv(0xB91u, &s);
glClearStencil(a2);
glClear(a3);
if ( (a3 & 0x4000) == 0 )
{
LABEL_5:
if ( (a3 & 0x100) == 0 )
goto LABEL_6;
LABEL_12:
glClearDepth(v11);
if ( (a3 & 0x400) == 0 )
return __stack_chk_guard;
goto LABEL_13;
}
LABEL_11:
glClearColor(params[0], params[1], params[2], params[3]);
if ( (a3 & 0x100) != 0 )
goto LABEL_12;
LABEL_6:
if ( (a3 & 0x400) == 0 )
return __stack_chk_guard;
LABEL_13:
glClearStencil(s);
return __stack_chk_guard;
}