//
// GJDifficultySprite::updateDifficultyFrame from 0x1002a4d30 to 0x1002a4e3f (271 bytes)
//
// 6 xrefs:
// > sub_1002778C0 @ 0x100277a04
// > LevelInfoLayer::updateLabelValues @ 0x1002afd50
// > sub_100505220 @ 0x100505364
// > sub_100963910 @ 0x100963a69
// > sub_100963AC0 @ 0x100963b69
// > sub_100963CD0 @ 0x100963d4e
//
// 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 12:27:55 +0000
//
void __fastcall GJDifficultySprite::updateDifficultyFrame(_QWORD *a1, int a2, int a3, double a4)
{
__int64 v5; // r14
std::string::pointer data; // rsi
__int64 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(a4);
GJDifficultySprite::getDifficultyFrame(&v11, a2, a3);
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 **)(_QWORD *, __int64))(*a1 + 1160LL))(a1, v7);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
if ( a1[26] )
{
v12 = *(float *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1) * 0.5;
v8 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
sub_100278250((float *)&v11, v12, 0.5 * *(float *)(v8 + 4));
if ( (unsigned int)sub_1007FEF90(a1[26]) )
{
v9 = 0;
do
{
v10 = sub_1007FEFE0(a1[26], v9);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v10 + 184LL))(v10, &v11);
++v9;
}
while ( v9 < (unsigned int)sub_1007FEF90(a1[26]) );
}
}
}