//
// SecretRewardsLayer::scrollLayerMoved from 0x100632a30 to 0x100632bf7 (455 bytes)
//
// 2 xrefs:
// > sub_100632C30 @ 0x100632c3c
// > ??> @ 0x100985c48
//
// 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 SecretRewardsLayer::scrollLayerMoved(SecretRewardsLayer *a1, cocos2d::CCPoint a2)
{
unsigned int *v2; // rsi
int TotalPages; // eax
__m128 v5; // xmm2
int i; // r14d
__m128 v7; // xmm0
float v8; // xmm1_4
int v9; // edx
int v10; // eax
int v11; // edi
int v12; // esi
__m128 v13; // xmm0
bool v14; // r15
float v15; // [rsp-2Ch] [rbp-2Ch] BYREF
cocos2d::ccColor3B v16; // [rsp-24h] [rbp-24h] BYREF
if ( a1->m_inMainLayer )
{
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v15);
TotalPages = BoomScrollLayer::getTotalPages(a1->m_mainScrollLayer);
v5 = _mm_xor_ps((__m128)*v2, (__m128)xmmword_1008150B0);
v5.f32[0] = v5.f32[0] / v15;
for ( i = TotalPages; v5.f32[0] < 0.0; v5.f32[0] = v5.f32[0] + (float)TotalPages )
;
v7 = _mm_round_ss((__m128)0LL, v5, 9);
v8 = _mm_cvtepi32_ps(_mm_cvttps_epi32(v7)).f32[0];
v9 = (int)v7.f32[0] % TotalPages;
v10 = 0;
if ( v9 + 1 != i )
v10 = v9 + 1;
if ( v9 == 3 )
{
v11 = 2628388;
}
else if ( v9 == 2 )
{
v11 = 7864390;
}
else
{
v11 = 4915270;
if ( v9 == 1 )
v11 = 3289650;
}
if ( v10 == 3 )
{
v12 = 2628388;
}
else if ( v10 == 2 )
{
v12 = 7864390;
}
else
{
v12 = 4915270;
if ( v10 == 1 )
v12 = 3289650;
}
v16 = GameToolbox::multipliedColorValue(
(cocos2d::ccColor3B)v11,
(cocos2d::ccColor3B)v12,
fmaxf(fminf((float)((float)(v5.f32[0] - v8) / 0.66666669) + -0.2, 1.0), 0.0));
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))a1->m_backgroundSprite->setColor)(
a1->m_backgroundSprite,
&v16);
if ( a1->m_inMainLayer )
{
v13 = _mm_or_ps(_mm_and_ps((__m128)xmmword_1008150B0, v5), (__m128)xmmword_1008150C0);
v13.f32[0] = v13.f32[0] + v5.f32[0];
v14 = (int)_mm_round_ss(v13, v13, 11).f32[0] % i == 3;
}
else
{
v14 = 0;
}
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))a1->m_keysLabel->setVisible)(a1->m_keysLabel, !v14);
((void (__fastcall *)(cocos2d::CCSprite *, bool))a1->m_keySprite->setVisible)(a1->m_keySprite, !v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))a1->m_goldKeysLabel->setVisible)(a1->m_goldKeysLabel, v14);
((void (__fastcall *)(cocos2d::CCSprite *, bool))a1->m_goldKeySprite->setVisible)(a1->m_goldKeySprite, v14);
}
}