//
// PlayLayer::playPlatformerEndAnimationToPos from 0x40839c to 0x408568 (460 bytes)
//
// 1 xrefs:
// > PlayLayer::activatePlatformerEndTrigger @ 0x40862e
//
// 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:29 +0000
//
void __fastcall PlayLayer::playPlatformerEndAnimationToPos(int a1, const cocos2d::CCPoint *a2, int a3)
{
int v5; // r2
int v6; // r9
int v7; // r6
int v8; // r3
PlayerObject *v9; // r5
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
int v23; // [sp+18h] [bp-54h]
float v24; // [sp+2Ch] [bp-40h] BYREF
float v25; // [sp+30h] [bp-3Ch]
float v26[2]; // [sp+34h] [bp-38h] BYREF
_BYTE v27[8]; // [sp+3Ch] [bp-30h] BYREF
void (__fastcall *v28)(PlayLayer *); // [sp+44h] [bp-28h]
int v29; // [sp+48h] [bp-24h]
_BYTE v30[8]; // [sp+4Ch] [bp-20h] BYREF
_BYTE v31[8]; // [sp+54h] [bp-18h] BYREF
_BYTE v32[8]; // [sp+5Ch] [bp-10h] BYREF
v5 = *(_DWORD *)(a1 + 12296);
if ( v5 )
v6 = *(unsigned __int8 *)(v5 + 1648);
else
v6 = 0;
cocos2d::CCPoint::operator=(a1 + 12288, a2);
*(_BYTE *)(a1 + 1438) = 1;
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 732))(a1, 1065353216);
GJBaseGameLayer::updateCameraOffsetX((GJBaseGameLayer *)a1, *(float *)(a1 + 336), 0.0, 0, 0.0, -1, -1);
GJBaseGameLayer::updateCameraOffsetY((GJBaseGameLayer *)a1, *(float *)(a1 + 340), 0.0, 0, 0.0, -1, -1);
v7 = 0;
if ( *(_BYTE *)(a1 + 866) )
v8 = 2;
else
v8 = 1;
v23 = v8;
do
{
if ( v7 )
v9 = *(PlayerObject **)(a1 + 2080);
else
v9 = *(PlayerObject **)(a1 + 2076);
PlayerObject::lockPlayer(v9);
PlayerObject::playingEndEffect(v9);
if ( !v6 )
PlayerObject::toggleGhostEffect(v9, 1);
if ( !a3 )
{
v10 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(PlayerObject *))(*(_DWORD *)v9 + 96))(v9);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v24, v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, a2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, v24, v25);
cocos2d::CCPoint::operator=(v31, v27);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v27,
v24 + (float)((float)(v26[0] - v24) * 0.5),
v25 + (float)((float)(v26[1] - v25) * 0.5));
cocos2d::CCPoint::operator=(v32, v27);
cocos2d::CCPoint::operator=(v30, v26);
v12 = (cocos2d::CCEaseIn *)cocos2d::CCBezierTo::create((cocos2d::CCBezierTo *)0x3F800000, COERCE_FLOAT(v30), v11);
v14 = (cocos2d::CCSequence *)cocos2d::CCEaseIn::create(v12, (cocos2d::CCActionInterval *)0x3FE66666, v13);
if ( v7 )
{
v17 = v9;
v16 = v14;
}
else
{
v29 = 0;
v28 = PlayLayer::levelComplete;
v15 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::levelComplete, 0);
v16 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v14, v15, 0);
v17 = v9;
}
cocos2d::CCNode::runAction(v17, v16);
v19 = (cocos2d::CCEaseIn *)cocos2d::CCRotateBy::create((cocos2d::CCRotateBy *)0x3F800000, 360.0, v18);
v21 = (cocos2d::CCAction *)cocos2d::CCEaseIn::create(v19, (cocos2d::CCActionInterval *)0x3FE66666, v20);
cocos2d::CCNode::runAction(v9, v21);
}
++v7;
}
while ( v7 != v23 );
if ( a3 )
PlayLayer::levelComplete((PlayLayer *)a1);
}