//
// GJDifficultySprite::updateFeatureState from 0x1403ab1f0 to 0x1403ab7bd (1485 bytes)
//
// 7 xrefs:
// > SongUsagePopup::buildUsageGrid @ 0x1401031c6
// > LevelCell::loadCustomLevelCell @ 0x14014afa9
// > GJRateLevelLayer::onFeature @ 0x14041a45a
// > LevelInfoLayer::updateLabelValues @ 0x140425902
// > RateStarsLayer::onFeature @ 0x14055ece1
// > RateStarsModLayer::onFeature @ 0x140560031
// > ??> @ 0x140923a38
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:31:20 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GJDifficultySprite::updateFeatureState(_DWORD *a1, int a2)
{
struct cocos2d::CCParticleSystemQuad *v3; // r14
int v4; // eax
const char *v5; // rcx
struct cocos2d::CCSprite *v6; // rsi
float *v7; // rbx
__int64 v8; // rdi
__int64 v9; // rax
__int64 v10; // rax
float *v11; // rbx
__int64 v12; // rdi
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rbx
_QWORD v16[3]; // [rsp+38h] [rbp-D0h] BYREF
__int64 v17; // [rsp+50h] [rbp-B8h]
_QWORD v18[3]; // [rsp+58h] [rbp-B0h] BYREF
__int64 v19; // [rsp+70h] [rbp-98h]
__int64 v20; // [rsp+78h] [rbp-90h]
unsigned int v21[66]; // [rsp+88h] [rbp-80h] BYREF
_BYTE v22[40]; // [rsp+190h] [rbp+88h] BYREF
if ( a2 != a1[150] )
{
a1[150] = a2;
(*(void (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 568LL))(a1);
if ( a1[150] )
{
*(_OWORD *)&v16[1] = 0;
v3 = nullptr;
v16[1] = sub_14003D460(0x20u);
v17 = 23;
v18[0] = 31;
strcpy((char *)v16[1], "GJ_featuredCoin_001.png");
v4 = a1[150];
switch ( v4 )
{
case 4:
v17 = 20;
memmove((void *)v16[1], "GJ_epicCoin3_001.png", 0x14u);
*(_BYTE *)(v16[1] + 20LL) = 0;
break;
case 3:
v17 = 20;
memmove((void *)v16[1], "GJ_epicCoin2_001.png", 0x14u);
*(_BYTE *)(v16[1] + 20LL) = 0;
break;
case 2:
v17 = 19;
memmove((void *)v16[1], "GJ_epicCoin_001.png", 0x13u);
*(_BYTE *)(v16[1] + 19LL) = 0;
break;
}
v5 = (const char *)&v16[1];
if ( v18[0] > 0xFu )
v5 = (const char *)v16[1];
v6 = cocos2d::CCSprite::createWithSpriteFrameName(v5);
(*(void (__fastcall **)(_DWORD *, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v6,
4294967294LL);
v7 = (float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 320LL))(a1);
v8 = *(_QWORD *)v6;
v9 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 320LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, *v7 * 0.5, *(float *)(v9 + 4) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v8 + 184))(v6, v10);
if ( a1[150] == 4 )
{
*(_OWORD *)&v18[1] = 0;
v19 = 0;
v20 = 0;
v18[1] = sub_14003D460(0xB0u);
v19 = 170;
v20 = 175;
strcpy(
(char *)v18[1],
"30a-1a1.3a0.2a20a90a0a10a5a20a20a0a0a8a0a0a0a4a1a0a0a0a0a1a0a1a0a1a0a1a1a0a0a0a0a0.784314a0a1a0a1a0a0.27a0a0.2"
"7a0a0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0.25a0a0a0a0a0a0a0a0a0a0a0");
if ( v19 )
{
sub_14006BF90((__int64)v21);
GameToolbox::particleStringToStruct(&v18[1], (__int64)v21);
v3 = GameToolbox::particleFromStruct(v21, nullptr, 0);
sub_14003D310((__int64)v22);
}
(*(void (__fastcall **)(_DWORD *, struct cocos2d::CCParticleSystemQuad *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v3,
0xFFFFFFFFLL);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v3 + 160LL))(v3);
cocos2d::CCParticleSystem::resetSystem(v3);
v11 = (float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 320LL))(a1);
v12 = *(_QWORD *)v3;
v13 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 320LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, *v11 * 0.5, *(float *)(v13 + 4) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v12 + 184))(v3, v14);
v15 = 5;
do
{
(*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v3 + 32LL))(v3);
--v15;
}
while ( v15 );
sub_14003D310((__int64)&v18[1]);
}
sub_14003D310((__int64)&v16[1]);
}
}
}