//
// PlayLayer::playEndAnimationToPos from 0x3fff70 to 0x4001fe (654 bytes)
//
// 1 xrefs:
// > EndPortalObject::triggerObject @ 0x507f8a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:23 +0000
//
float *__fastcall PlayLayer::playEndAnimationToPos(float *result, const cocos2d::CCPoint *a2)
{
float *v3; // r4
float v4; // r3
int *v5; // r10
int v6; // r5
int v7; // r11
PlayerObject *v8; // r6
float v9; // s16
const cocos2d::CCPoint *v10; // r0
const cocos2d::_ccBezierConfig *v11; // r2
cocos2d::CCEaseIn *v12; // r0
float v13; // r2
cocos2d::CCSequence *v14; // r7
cocos2d::CCFiniteTimeAction *v15; // r0
cocos2d::CCAction *v16; // r1
cocos2d::CCNode *v17; // r0
float v18; // r2
cocos2d::CCEaseIn *v19; // r0
float v20; // r2
cocos2d::CCAction *v21; // r0
float v22[2]; // [sp+24h] [bp-40h] BYREF
float v23; // [sp+2Ch] [bp-38h] BYREF
float v24; // [sp+30h] [bp-34h]
float v25[2]; // [sp+34h] [bp-30h] BYREF
_DWORD (*v26)(PlayLayer *__hidden); // [sp+3Ch] [bp-28h] BYREF
int v27; // [sp+40h] [bp-24h]
_BYTE v28[8]; // [sp+44h] [bp-20h] BYREF
_BYTE v29[8]; // [sp+4Ch] [bp-18h] BYREF
_BYTE v30[8]; // [sp+54h] [bp-10h] BYREF
v3 = result;
if ( !*((_BYTE *)result + 11272) )
{
*((_BYTE *)result + 11272) = 1;
if ( result[97] != 0.0 )
{
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)result);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, (float)(v25[0] * 0.5) / v3[82], (float)(v25[1] * 0.5) / v3[82]);
cocos2d::CCPoint::operator+(&v26, v3 + 249, v28);
cocos2d::CCPoint::operator-(v28, &v26, v3 + 84);
cocos2d::CCPoint::operator=(&v26, v28);
*((_DWORD *)a2 + 1) = v27;
}
v4 = *v3;
*((_BYTE *)v3 + 1438) = 1;
(*(void (__fastcall **)(float *, int))(LODWORD(v4) + 732))(v3, 1065353216);
v5 = (int *)(v3 + 2708);
GJBaseGameLayer::updateCameraOffsetX((GJBaseGameLayer *)v3, v3[84], 0.0, 0, 0.0, -1, -1);
v6 = 0;
GJBaseGameLayer::updateCameraOffsetY((GJBaseGameLayer *)v3, v3[85], 0.0, 0, 0.0, -1, -1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, a2);
GJBaseGameLayer::updateStaticCameraPos(v3, v28, 0, 1, 0, 1067030938, 1, 1072064102);
if ( *((_BYTE *)v3 + 866) )
v7 = 2;
else
v7 = 1;
do
{
if ( v6 )
v8 = *((PlayerObject **)v3 + 520);
else
v8 = *((PlayerObject **)v3 + 519);
PlayerObject::lockPlayer(v8);
PlayerObject::playingEndEffect(v8);
PlayerObject::toggleGhostEffect(v8, 1);
if ( *v5 )
{
v9 = -1.0;
if ( !*(_BYTE *)(*v5 + 1172) )
v9 = 1.0;
}
else
{
v9 = 1.0;
}
v10 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)v8 + 96))(v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v9 * 50.0, 0.0);
cocos2d::CCPoint::operator+(&v23, a2, v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v22[0], v22[1]);
cocos2d::CCPoint::operator=(v29, v25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v22[0] + (float)(v9 * 40.0), v24 + 150.0);
cocos2d::CCPoint::operator=(v30, v25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v23, v24 - 20.0);
cocos2d::CCPoint::operator=(v28, v25);
v12 = (cocos2d::CCEaseIn *)cocos2d::CCBezierTo::create((cocos2d::CCBezierTo *)0x3F800000, COERCE_FLOAT(v28), v11);
v14 = (cocos2d::CCSequence *)cocos2d::CCEaseIn::create(v12, (cocos2d::CCActionInterval *)0x3F99999A, v13);
if ( v6 )
{
v17 = v8;
v16 = v14;
}
else
{
v27 = 0;
v26 = PlayLayer::levelComplete;
v15 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(v3, PlayLayer::levelComplete, 0);
v16 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v14, v15, 0);
v17 = v8;
}
cocos2d::CCNode::runAction(v17, v16);
++v6;
v19 = (cocos2d::CCEaseIn *)cocos2d::CCRotateBy::create((cocos2d::CCRotateBy *)0x3F800000, 360.0, v18);
v21 = (cocos2d::CCAction *)cocos2d::CCEaseIn::create(v19, (cocos2d::CCActionInterval *)0x3FC00000, v20);
result = (float *)cocos2d::CCNode::runAction(v8, v21);
}
while ( v6 != v7 );
}
return result;
}