//
// RateLevelLayer::selectRating from 0x79aa00 to 0x79ab3c (316 bytes)
//
// 4 xrefs:
// > RateLevelLayer::init @ 0x79af0c
// > ??> @ 0xada18
// > RateLevelLayer::init @ 0x79ad74
// > ??> @ 0x122dff8
//
// 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 RateLevelLayer::selectRating(RateLevelLayer *a1, cocos2d::CCObject *a2)
{
unsigned int v3; // w19
__int64 v4; // x2
void (*v5)(void); // x2
__int64 (*getNormalImage)(void); // x1
ButtonSprite *v7; // x0
ButtonSprite *v8; // x0
_BYTE v9[3]; // [xsp+50h] [xbp+50h] BYREF
if ( a2 )
a1->m_levelRate = a2->getTag(a2);
else
a1->m_levelRate = -1;
v3 = 0;
while ( v3 < (unsigned int)cocos2d::CCArray::count(a1->m_difficulties) )
{
v4 = *(_QWORD *)cocos2d::CCArray::objectAtIndex(a1->m_difficulties, v3);
if ( a1->m_levelRate == v3 )
{
++v3;
(*(void (**)(void))(v4 + 944))();
}
else
{
v5 = *(void (**)(void))(v4 + 944);
memset(v9, 125, sizeof(v9));
++v3;
v5();
}
}
getNormalImage = (__int64 (*)(void))a1->m_submitButton->getNormalImage;
if ( a1->m_levelRate == -1 )
{
v8 = (ButtonSprite *)getNormalImage();
ButtonSprite::setColor(v8, (cocos2d::ccColor3B)-5855578);
}
else
{
v7 = (ButtonSprite *)getNormalImage();
ButtonSprite::setColor(v7, (cocos2d::ccColor3B)&unk_FFFFFF);
}
}