//
// PlayLayer::playEndAnimationToPos from 0x10011b8c4 to 0x10011bbe4 (800 bytes)
//
// 1 xrefs:
// > EndPortalObject::triggerObject @ 0x1003feaf4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall PlayLayer::playEndAnimationToPos(PlayLayer *a1, cocos2d::CCPoint a2)
{
__int64 v2; // x1
__int64 v3; // x19
cocos2d::CCDirector *v5; // x0
float m_cameraZoom; // s3
__n128 v7; // q0
__n128 v8; // q1
char v9; // w25
float v10; // s2
float v11; // s3
bool m_isDualMode; // w26
__int64 v13; // x8
PlayerObject *v14; // x22
EndPortalObject *m_endPortal; // x8
float v16; // s10
__int64 *v17; // x0
__n128 v18; // q0
__n128 v19; // q1
__n128 v20; // q0
__n128 v21; // q1
__n128 v22; // q0
__n128 v23; // q1
__n128 v24; // q0
__n128 v25; // q1
cocos2d::CCActionInterval *v26; // x0
cocos2d::CCEaseIn *v27; // x23
cocos2d::CCRotateBy *v28; // x0
cocos2d::CCEaseIn *v29; // x0
char v30; // w8
double v31; // [xsp+10h] [xbp-C0h] BYREF
float32x2_t v32; // [xsp+18h] [xbp-B8h] BYREF
__int64 v33; // [xsp+20h] [xbp-B0h] BYREF
__int64 v34; // [xsp+28h] [xbp-A8h] BYREF
float32x2_t v35; // [xsp+30h] [xbp-A0h] BYREF
float32x2_t v36; // [xsp+38h] [xbp-98h] BYREF
cocos2d::SEL_CallFunc v37; // 0:x1.16
cocos2d::CCPoint v38; // 0:s0.4,4:s1.4
if ( !a1->m_levelEndAnimationStarted )
{
v3 = v2;
a1->m_levelEndAnimationStarted = 1;
if ( a1->m_gameState.m_unkPoint6.y != 0.0 )
{
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
m_cameraZoom = a1->m_gameState.m_cameraZoom;
v7.n128_f32[0] = (float)(v32.f32[0] * 0.5) / m_cameraZoom;
v8.n128_f32[0] = (float)(v32.f32[1] * 0.5) / m_cameraZoom;
sub_100022980(v7, v8, &v35);
sub_1000229DC((float32x2_t *)&a1->m_gameState.m_cameraPosition2, &v35, &v36);
sub_1000229F0(&v36, (float32x2_t *)&a1->m_gameState.m_cameraOffset, &v35);
sub_1000229D0(&v36, (double *)&v35);
*(_DWORD *)(v3 + 4) = v36.i32[1];
}
((void (__fastcall *)(PlayLayer *, float))a1->updateTimeWarp)(a1, 1.0);
GJBaseGameLayer::updateCameraOffsetX(a1, a1->m_gameState.m_cameraOffset.x, 0.0, 0, 0.0, -1, -1);
GJBaseGameLayer::updateCameraOffsetY(a1, a1->m_gameState.m_cameraOffset.y, 0.0, 0, 0.0, -1, -1);
sub_1000229B8((__int64 *)&v32, (__int64 *)v3);
v38.y = 1.8;
v9 = 1;
v38.x = 1.2;
GJBaseGameLayer::updateStaticCameraPos(a1, v38, (bool)&v32, 0, 1, v10, 0, v11);
m_isDualMode = a1->m_gameState.m_isDualMode;
do
{
if ( (v9 & 1) != 0 )
v13 = 3272;
else
v13 = 3280;
v14 = *(PlayerObject **)((char *)&a1->GJBaseGameLayer::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v13);
PlayerObject::lockPlayer(v14);
PlayerObject::playingEndEffect(v14);
PlayerObject::toggleGhostEffect(v14, Enabled);
m_endPortal = a1->m_endPortal;
v16 = 1.0;
if ( m_endPortal )
{
if ( m_endPortal->m_flippedX )
v16 = -1.0;
else
v16 = 1.0;
}
v17 = (__int64 *)((__int64 (__fastcall *)(PlayerObject *))v14->getPosition)(v14);
sub_1000229B8((__int64 *)&v36, v17);
v18.n128_f32[0] = v16 * 50.0;
v19.n128_u32[0] = 0;
sub_100022980(v18, v19, &v32);
sub_1000229DC((float32x2_t *)v3, &v32, &v35);
sub_1000229B0(&v32);
sub_1000229B0(&v33);
sub_1000229B0(&v34);
v21.n128_u32[0] = v36.u32[1];
v20.n128_u32[0] = v36.i32[0];
sub_100022980(v20, v21, &v31);
v22.n128_f64[0] = sub_1000229D0(&v33, &v31);
v22.n128_f32[0] = v36.f32[0] + (float)(v16 * 40.0);
v23.n128_f32[0] = v35.f32[1] + 150.0;
sub_100022980(v22, v23, &v31);
v24.n128_f64[0] = sub_1000229D0(&v34, &v31);
v24.n128_u32[0] = v35.i32[0];
v25.n128_f32[0] = v35.f32[1] + -20.0;
sub_100022980(v24, v25, &v31);
sub_1000229D0(&v32, &v31);
v26 = (cocos2d::CCActionInterval *)cocos2d::CCBezierTo::create(&v32, 1.0);
v27 = cocos2d::CCEaseIn::create(v26, 1.2);
if ( (v9 & 1) != 0 )
{
v37.ptr = (void (*)(void))PlayLayer::levelComplete;
v37.adj = 0;
cocos2d::CCCallFunc::create(a1, v37);
v27 = (cocos2d::CCEaseIn *)sub_10018A494(v27);
}
cocos2d::CCNode::runAction(v14, v27);
v28 = cocos2d::CCRotateBy::create_1(1.0, 360.0);
v29 = cocos2d::CCEaseIn::create(v28, 1.5);
cocos2d::CCNode::runAction(v14, v29);
v30 = v9 & m_isDualMode;
v9 = 0;
}
while ( (v30 & 1) != 0 );
}
}