//
// PlayLayer::updateInvisibleBlock from 0x10011ce40 to 0x10011d090 (592 bytes)
//
// 1 xrefs:
// > PlayLayer::updateVisibility @ 0x10011cbbc
//
// 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 PlayLayer::updateInvisibleBlock(
PlayLayer *a1,
GameObject *a2,
float a3,
float a4,
float a5,
float a6,
const cocos2d::ccColor3B *a7)
{
float m_fadeMargin; // s1
float x; // s0
float m_halfCameraWidth; // s2
float v17; // s1
float v18; // s1
float v19; // s2
float v20; // s2
float v21; // s14
float v22; // s3
float v23; // s4
float v24; // s0
float v25; // s2
float v26; // s8
float v27; // s0
float v28; // s0
float v29; // s0
__int64 v30; // [xsp+0h] [xbp-70h] BYREF
__int64 v31; // [xsp+8h] [xbp-68h] BYREF
((void (__fastcall *)(__int64 *__return_ptr, GameObject *))a2->getRealPosition)(&v31, a2);
if ( *(float *)&v31 <= a1->m_cameraUnzoomedX )
m_fadeMargin = a2->m_fadeMargin;
else
m_fadeMargin = -a2->m_fadeMargin;
*(float *)&v31 = *(float *)&v31 + m_fadeMargin;
sub_1000229B8(&v30, &v31);
x = a1->m_gameState.m_cameraPosition2.x;
m_halfCameraWidth = a1->m_halfCameraWidth;
v17 = (float)(x + m_halfCameraWidth) - *(float *)&v30;
if ( *(float *)&v30 > (float)(x + m_halfCameraWidth) )
v17 = (float)(*(float *)&v30 - x) - m_halfCameraWidth;
v18 = flt_100636F88[*(float *)&v30 > (float)(x + m_halfCameraWidth)] * (float)(m_halfCameraWidth - v17);
if ( v18 <= 1.0 )
v19 = v18;
else
v19 = 1.0;
v20 = v19 * 255.0;
if ( v18 >= 0.0 )
v21 = v20;
else
v21 = 0.0;
v22 = x + a3;
v23 = (float)(*(float *)&v31 - x) - a3;
v24 = (float)(x + a4) - *(float *)&v31;
if ( *(float *)&v31 <= v22 )
v25 = a6;
else
v25 = a5;
if ( *(float *)&v31 > v22 )
v24 = v23;
if ( v25 < 1.0 )
v25 = 1.0;
v26 = fmaxf(fminf(v24 / v25, 1.0), 0.0);
v27 = (float)((float)(v26 * 0.95) + 0.05) * 255.0;
if ( v27 > v21 )
v27 = v21;
((void (__fastcall *)(GameObject *, _QWORD))a2->setOpacity)(a2, (unsigned int)(int)v27);
v28 = (float)((float)(v26 * 0.85) + 0.15) * 255.0;
if ( v28 > v21 )
v28 = v21;
GameObject::setGlowOpacity(a2, (int)v28);
v29 = (float)((unsigned int (__fastcall *)(GameObject *))a2->getOpacity)(a2) / 255.0;
if ( v29 <= 0.8 )
{
((void (__fastcall *)(GameObject *, cocos2d::ccColor3B *))a2->setGlowColor)(a2, &a1->m_lightBGColor);
}
else
{
*(cocos2d::ccColor3B *)&v30 = GJEffectManager::getMixedColor(
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a1->m_lightBGColor.r
| (a1->m_lightBGColor.b << 16)),
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a7->r | (a7->b << 16)),
(float)((float)((float)((float)(v29 + -0.8) / -0.2) + 1.0) * 0.3) + 0.7);
((void (__fastcall *)(GameObject *, __int64 *))a2->setGlowColor)(a2, &v30);
}
}