//
// GJDifficultySprite::updateDifficultyFrame from 0x1002b6cb0 to 0x1002b6dbf (271 bytes)
//
// 3 xrefs:
// > RateStarsLayer::selectRating @ 0x10028c574
// > LevelInfoLayer::updateLabelValues @ 0x1002c3224
// > GJRateLevelLayer::selectRating @ 0x1005066a4
//
// 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 __fastcall GJDifficultySprite::updateDifficultyFrame(GJDifficultySprite *a1, int a2, GJDifficultyName a3)
{
double v3; // xmm0_8
cocos2d::CCSpriteFrameCache *v5; // r14
const char *data; // rsi
cocos2d::CCSpriteFrame *v7; // rax
__int64 v8; // rax
unsigned int v9; // r14d
__int64 v10; // rax
std::string v11; // [rsp+0h] [rbp-40h] BYREF
float v12; // [rsp+1Ch] [rbp-24h]
v5 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
GJDifficultySprite::getDifficultyFrame(&v11, a2, a3, v3);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
data = v11.__r_.__value_.__l.__data_;
else
data = v11.__r_.__value_.__s.__data_;
v7 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v5, data);
((void (__fastcall *)(GJDifficultySprite *, cocos2d::CCSpriteFrame *))a1->setDisplayFrame)(a1, v7);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
if ( a1->m_pChildren )
{
v12 = *(float *)((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1) * 0.5;
v8 = ((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1);
sub_10028CBE0((float *)&v11, v12, 0.5 * *(float *)(v8 + 4));
if ( (unsigned int)sub_100720070(a1->m_pChildren) )
{
v9 = 0;
do
{
v10 = sub_1007200C0(a1->m_pChildren, v9);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v10 + 184LL))(v10, &v11);
++v9;
}
while ( v9 < (unsigned int)sub_100720070(a1->m_pChildren) );
}
}
}