//
// GauntletSelectLayer::unlockAnimationStep3 from 0x918894 to 0x918c98 (1028 bytes)
//
// 2 xrefs:
// > GauntletSelectLayer::unlockAnimationFinished @ 0x91d444
// > ??> @ 0x90480
//
// 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 GauntletSelectLayer::unlockAnimationStep3(GauntletSelectLayer *a1)
{
unsigned __int8 *v2; // x19
cocos2d::CCDirector *v3; // x0
cocos2d::CCParticleSystemQuad *v4; // x20
void (__fastcall *setPosVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // x24
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCNode *v7; // x24
const cocos2d::CCPoint *v8; // x0
int v9; // w3
float v10; // s0
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
float v12; // s2
int v13; // w3
float v14; // s0
void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
float v16; // s2
cocos2d::CCParticleSystemQuad *v17; // x20
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCNode *v19; // x26
const cocos2d::CCPoint *v20; // x0
void (__fastcall *v21)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // x22
float v22; // s0
void (__fastcall *v23)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
float v24; // s2
float v25; // s1
FMODAudioEngine *v26; // x0
void *v27; // x0
unsigned int *v28; // x2
int v29; // w1
__int64 v30; // [xsp+0h] [xbp+0h] BYREF
__int64 v31; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v32; // [xsp+78h] [xbp+78h] BYREF
float v33; // [xsp+80h] [xbp+80h]
int v34; // [xsp+84h] [xbp+84h]
cocos2d::CCPoint v35; // [xsp+88h] [xbp+88h] BYREF
float v36; // [xsp+90h] [xbp+90h]
float v37; // [xsp+94h] [xbp+94h]
cocos2d::CCPoint v38; // 0:kr10_8.8
cocos2d::CCPoint v39; // 0:kr20_8.8
v2 = (unsigned __int8 *)cocos2d::CCDictionary::objectForKey(a1->m_gauntlets, (unsigned int)a1->m_gauntletID);
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v3);
sub_D153B8(
(unsigned int)&v30 + 112,
"100a0a0.88a0.21a-1a90a180a5a5a48a82a0a0a0a0a0a0a7a2a0a360a0.411765a1a1a1a0a1a1a0a3a2a0a60a0a0a0.737255a0a0.160784a0a"
"1a0a0.16a0.1a0.51a0.12a0a0a0a0a0a0a0a2a1a1a0a0a166a0a0a0a0a0a0a0a0a1a1a0a0a0a0");
v4 = GameToolbox::particleFromString(&v31, nullptr, 0);
v4->setAutoRemoveOnFinish(v4, 1);
a1->addChild_0(a1, v4, 15);
v4->setScale(v4, 1.6);
setPosVar = v4->setPosVar;
cocos2d::CCPoint::CCPoint(&v35, 30.0, 70.0);
setPosVar(v4, &v35);
cocos2d::CCParticleSystem::resetSystem(v4);
setPosition = v4->setPosition;
v7 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)v2 + 496LL))(v2);
v8 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)v2 + 192LL))(v2);
cocos2d::CCNode::convertToWorldSpace(v7, v8);
v38 = cocos2d::CCNode::convertToNodeSpace(a1, &v32);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, cocos2d::CCPoint *, float, float))setPosition)(
v4,
&v35,
v38.x,
v38.y);
v9 = v2[338];
v10 = (float)v2[336];
setStartColor = v4->setStartColor;
v12 = (float)v2[337] / 255.0;
v37 = 1.0;
v35.y = v12;
v36 = (float)v9 / 255.0;
v35.x = v10 / 255.0;
setStartColor(v4, (const cocos2d::ccColor4F *)&v35);
v13 = v2[338];
v14 = (float)v2[336];
setEndColor = v4->setEndColor;
v16 = (float)v2[337] / 255.0;
v37 = 1.0;
v35.y = v16;
v36 = (float)v13 / 255.0;
v35.x = v14 / 255.0;
setEndColor(v4, (const cocos2d::ccColor4F *)&v35);
sub_D1798C(
&v31,
"30a0a1.15a0.3a-1a110a97a0a8a44a71a0a0a0a0a0a0a75a12a0a0a1a0.4a0.890196a0.4a0a0.4a0.51a0.22a-5a1a0a0a1a0a0a0a0.078431"
"4a0a0a0a0.16a0a0.25a0a0a0a0a0a0a0a0a2a0a0a0a0a159a0a0.35a0a0a0a0a1a0a1a0a0a0a0a0",
196);
v17 = GameToolbox::particleFromString(&v31, nullptr, 0);
v17->setAutoRemoveOnFinish(v17, 1);
a1->addChild_0(a1, v17, 16);
v17->setScale(v17, 2.2);
cocos2d::CCParticleSystem::resetSystem(v17);
v18 = v17->setPosition;
v19 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)v2 + 496LL))(v2);
v20 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(unsigned __int8 *))(*(_QWORD *)v2 + 192LL))(v2);
cocos2d::CCNode::convertToWorldSpace(v19, v20);
v39 = cocos2d::CCNode::convertToNodeSpace(a1, &v32);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, cocos2d::CCPoint *, float, float))v18)(v17, &v35, v39.x, v39.y);
v21 = v17->setPosVar;
cocos2d::CCPoint::CCPoint(&v35, 10.0, 40.0);
v21(v17, &v35);
v22 = (float)v2[338];
v23 = v17->setStartColor;
v24 = (float)v2[336] / 255.0;
v25 = (float)v2[337] / 255.0;
v34 = 1008981770;
v37 = 0.0;
v32.x = v24;
v35.x = v24;
v32.y = v25;
v35.y = v25;
v33 = v22 / 255.0;
v36 = v22 / 255.0;
v23(v17, (const cocos2d::ccColor4F *)&v32);
v17->setEndColor(v17, (const cocos2d::ccColor4F *)&v35);
v26 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::fadeInMusic(v26, 4.0, 0);
v27 = (void *)(v31 - 24);
if ( (__int64 *)(v31 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v31 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(_DWORD *)(v31 - 8);
*(_DWORD *)(v31 - 8) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v27);
}
}