//
// SecretRewardsLayer::scrollLayerMoved from 0xa60b3c to 0xa60d48 (524 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'SecretRewardsLayer::scrollLayerMoved @ 0xa60d54
// > ??> @ 0x57588
// > ??> @ 0x11ed188
//
// 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 SecretRewardsLayer::scrollLayerMoved(SecretRewardsLayer *a1, cocos2d::CCPoint a2)
{
float *v2; // x1
_BOOL4 m_inMainLayer; // w21
cocos2d::CCDirector *v5; // x0
int TotalPages; // w0
int v7; // w22
float i; // s8
int v9; // w1
float v10; // s9
int v11; // w1
int v12; // w23
float v13; // s0
_BOOL4 v14; // w23
GLubyte r; // w2
GLubyte g; // w6
GLubyte b; // w4
cocos2d::CCSprite *m_backgroundSprite; // x0
cocos2d::CCSprite_vtbl *v19; // x5
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x2
int v21; // w0
float *v22; // [xsp+58h] [xbp+58h]
_BYTE v23[8]; // [xsp+78h] [xbp+78h] BYREF
float v24; // [xsp+80h] [xbp+80h]
cocos2d::ccColor3B PageColor; // 0:^68.3
cocos2d::ccColor3B v26; // 0:^70.3
cocos2d::ccColor3B v27; // 0:w0.3
m_inMainLayer = a1->m_inMainLayer;
if ( a1->m_inMainLayer )
{
v22 = v2;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
TotalPages = BoomScrollLayer::getTotalPages(a1->m_mainScrollLayer);
v7 = TotalPages;
for ( i = (float)-*v22 / v24; i < 0.0; i = i + (float)TotalPages )
;
v9 = vcvtms_s32_f32(i);
v10 = i - (float)v9;
v11 = v9 % TotalPages;
v12 = v11 + 1;
if ( TotalPages == v11 + 1 )
v12 = 0;
PageColor = SecretRewardsLayer::getPageColor(a1, v11);
v26 = SecretRewardsLayer::getPageColor(a1, v12);
v13 = (float)(v10 / 0.66667) - 0.2;
if ( v13 < 1.0 )
{
if ( v13 <= 0.0 )
v13 = 0.0;
}
else
{
v13 = 1.0;
}
v14 = 0;
v27 = GameToolbox::multipliedColorValue(PageColor, v26, v13);
r = v27.r;
g = v27.g;
b = v27.b;
m_backgroundSprite = a1->m_backgroundSprite;
v19 = m_backgroundSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v23[0] = r;
v23[1] = g;
setColor = v19->setColor;
v23[2] = b;
setColor(m_backgroundSprite, (const cocos2d::ccColor3B *)v23);
if ( a1->m_inMainLayer )
{
v21 = (int)llroundf(i) % v7;
m_inMainLayer = v21 != 3 && a1->m_inMainLayer;
v14 = v21 == 3;
}
a1->m_keysLabel->setVisible(a1->m_keysLabel, m_inMainLayer);
a1->m_keySprite->setVisible(a1->m_keySprite, m_inMainLayer);
a1->m_goldKeysLabel->setVisible(a1->m_goldKeysLabel, v14);
a1->m_goldKeySprite->setVisible(a1->m_goldKeySprite, v14);
}
}