//
// PlayLayer::playEndAnimationToPos from 0x5cc088 to 0x5cc408 (896 bytes)
//
// 2 xrefs:
// > EndPortalObject::triggerObject @ 0x78a68c
// > ??> @ 0x35040
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void PlayLayer::playEndAnimationToPos(PlayLayer *a1, cocos2d::CCPoint a2)
{
const cocos2d::CCPoint *v2; // x1
const cocos2d::CCPoint *v3; // x27
float *v5; // x0
float y; // s0
int v7; // w22
float v8; // s2
float v9; // s3
int v10; // w0
PlayerObject *m_player2; // x19
EndPortalObject *m_endPortal; // x0
float v13; // s8
const cocos2d::CCPoint *v14; // x0
float v15; // s0
float v16; // s1
float v17; // s0
float v18; // s1
float v19; // s0
float v20; // s1
cocos2d::CCActionInterval *v21; // x0
cocos2d::CCEaseIn *v22; // x0
cocos2d::CCRotateBy *v23; // x0
cocos2d::CCActionInterval *v24; // x0
cocos2d::CCEaseIn *v25; // x0
cocos2d::CCDirector *v26; // x0
float v27; // s0
float v28; // s1
cocos2d::CCFiniteTimeAction *v29; // x0
cocos2d::CCSequence *v30; // [xsp+A0h] [xbp+A0h]
int v31; // [xsp+ACh] [xbp+ACh]
cocos2d::CCPoint v32; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v33; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCPoint v34; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v35; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCPoint v36; // [xsp+D8h] [xbp+D8h] BYREF
cocos2d::CCPoint v37; // [xsp+E0h] [xbp+E0h] BYREF
cocos2d::CCPoint v38; // 0:s0.4,4:s1.4
v3 = v2;
v5 = &a1->m_varianceValues.__elems_[1975];
if ( !*((_BYTE *)v5 + 1392) )
{
y = a1->m_gameState.m_unkPoint6.y;
*((_BYTE *)v5 + 1392) = 1;
if ( y != 0.0 )
{
v26 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v26);
cocos2d::CCPoint::CCPoint(
&v35,
(float)(*(float *)&v33 * 0.5) / a1->m_gameState.m_cameraZoom,
(float)(*((float *)&v33 + 1) * 0.5) / a1->m_gameState.m_cameraZoom);
cocos2d::CCPoint::operator+(&v34, &a1->m_gameState.m_cameraPosition2, &v35);
cocos2d::CCPoint::operator-(&v35, &v34, &a1->m_gameState.m_cameraOffset);
cocos2d::CCPoint::operator=(&v34, v27, v28);
v3->y = v34.y;
}
v7 = 0;
((void (__fastcall *)(PlayLayer *, float, long double))a1->updateTimeWarp)(a1, 1.0, *(long double *)&a2.y);
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);
cocos2d::CCPoint::CCPoint(&v35, v3);
v38.y = 1.8;
v38.x = 1.2;
GJBaseGameLayer::updateStaticCameraPos(a1, v38, (bool)&v35, 0, 1, v8, 0, v9);
if ( a1->m_gameState.m_isDualMode )
v10 = 2;
else
v10 = 1;
v31 = v10;
do
{
if ( v7 )
m_player2 = a1->m_player2;
else
m_player2 = a1->m_player1;
PlayerObject::lockPlayer(m_player2);
PlayerObject::playingEndEffect(m_player2);
PlayerObject::toggleGhostEffect(m_player2, Enabled);
m_endPortal = a1->m_endPortal;
if ( m_endPortal && m_endPortal->m_flippedX )
v13 = -1.0;
else
v13 = 1.0;
v14 = m_player2->getPosition(m_player2);
cocos2d::CCPoint::CCPoint(&v32, v14);
cocos2d::CCPoint::CCPoint(&v35, v13 * 50.0, 0.0);
cocos2d::CCPoint::operator+(&v33, v3, &v35);
cocos2d::CCPoint::CCPoint(&v35);
cocos2d::CCPoint::CCPoint(&v36);
cocos2d::CCPoint::CCPoint(&v37);
cocos2d::CCPoint::CCPoint(&v34, v32.x, v32.y);
cocos2d::CCPoint::operator=(&v36, v15, v16);
cocos2d::CCPoint::CCPoint(&v34, v32.x + (float)(v13 * 40.0), *((float *)&v33 + 1) + 150.0);
cocos2d::CCPoint::operator=(&v37, v17, v18);
cocos2d::CCPoint::CCPoint(&v34, *(float *)&v33, *((float *)&v33 + 1) - 20.0);
cocos2d::CCPoint::operator=(&v35, v19, v20);
v21 = (cocos2d::CCActionInterval *)cocos2d::CCBezierTo::create(&v35, 1.0);
v22 = cocos2d::CCEaseIn::create(v21, 1.2);
if ( !v7 )
{
v30 = (cocos2d::CCSequence *)v22;
v29 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::levelComplete, 0);
v22 = (cocos2d::CCEaseIn *)cocos2d::CCSequence::create(v30, v29, 0);
}
v23 = (cocos2d::CCRotateBy *)cocos2d::CCNode::runAction(m_player2, v22);
++v7;
v24 = (cocos2d::CCActionInterval *)cocos2d::CCRotateBy::create(v23, 1.0, 360.0);
v25 = cocos2d::CCEaseIn::create(v24, 1.5);
cocos2d::CCNode::runAction(m_player2, v25);
}
while ( v7 != v31 );
}
}