//
// cocos2d::CCDirector::replaceScene from 0x1800c2980 to 0x1800c2a88 (264 bytes)
//
// 5 xrefs:
// > cocos2d::CCTransitionScene::setNewScene @ 0x18005888f
// > ??> @ 0x18014b28c
// > ??> @ 0x18014b29c
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c354c
//
// 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:22:25 +0000
//
char __fastcall cocos2d::CCDirector::replaceScene(cocos2d::CCDirector *this, struct cocos2d::CCScene *a2)
{
__int64 v4; // rax
__int64 v5; // rsi
bool v6; // bp
int v8; // eax
bool v9; // zf
int v10; // r14d
void (__fastcall ***v11)(_QWORD, struct cocos2d::CCScene *); // rcx
void (__fastcall ***v12)(_QWORD); // rcx
v4 = _RTDynamicCast(
a2,
0,
&cocos2d::CCScene `RTTI Type Descriptor',
&cocos2d::CCTransitionScene `RTTI Type Descriptor',
0);
v5 = v4;
v6 = v4 != 0;
if ( *((_BYTE *)this + 176) && v4 )
return 0;
v8 = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 37));
v9 = *((_QWORD *)this + 12) == 0;
v10 = v8;
*((_BYTE *)this + 288) = 1;
if ( !v9
&& *((struct cocos2d::CCObject **)this + 12) == cocos2d::CCArray::lastObject(*((cocos2d::CCArray **)this + 37)) )
{
*((_QWORD *)this + 12) = 0;
}
cocos2d::CCArray::replaceObjectAtIndex(*((cocos2d::CCArray **)this + 37), v10 - 1, a2);
*((_QWORD *)this + 35) = a2;
if ( !v5 && !*((_BYTE *)this + 404) )
{
v11 = *((void (__fastcall ****)(_QWORD, struct cocos2d::CCScene *))this + 45);
if ( v11 )
(**v11)(v11, a2);
v12 = *((void (__fastcall ****)(_QWORD))a2 + 40);
if ( v12 )
(**v12)(v12);
}
*((_BYTE *)this + 176) = v6;
return 1;
}