//
// LevelEditorLayer::updateVisibility from 0x462c70 to 0x4633cc (1884 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:48:54 +0000
//
int __fastcall LevelEditorLayer::updateVisibility(GJEffectManager **this, float a2)
{
int v4; // r9
GJEffectManager *v5; // r6
int active; // r0
unsigned __int8 *v7; // r0
GameManager *v8; // r0
GameManager *v9; // r0
GameManager *v10; // r0
float v11; // r1
float v12; // r2
int v13; // r4
void (__fastcall *v14)(int, _DWORD *); // r8
GJSpriteColor *MainColorMode; // r0
float v16; // r1
float v17; // s16
_BYTE *v18; // r6
GJSpriteColor *SecondaryColorMode; // r0
int v21; // r6
float v22; // s15
int v23; // r1
int v24; // r2
void (__fastcall *v25)(int, _DWORD *); // r8
int MainColor; // r0
GJEffectManager *v27; // r11
int v28; // r8
GJSpriteColor *v29; // r0
int SecondaryColor; // r0
GJEffectManager *v32; // r11
int v33; // r8
GJSpriteColor *v34; // r0
GJSpriteColor *v35; // r0
char v36; // r3
int v37; // r11
int v38; // r0
int v39; // r3
_DWORD *v40; // r8
int v41; // r0
signed int v42; // r12
int GroupID; // r0
int v44; // r0
float v45; // s17
signed int i; // r8
GJEffectManager *v47; // r11
int v48; // r0
GJSpriteColor *v49; // r0
char v50; // r3
int v51; // r8
int v52; // r0
int v53; // r0
_DWORD *v54; // r11
int v55; // r0
float v56; // s17
signed int j; // r8
GJEffectManager *v58; // r11
int v59; // r0
signed int v60; // r12
int v61; // r0
int v62; // r0
_BOOL4 v63; // [sp+8h] [bp-4Ch]
__int16 *v64; // [sp+Ch] [bp-48h]
__int16 *v65; // [sp+10h] [bp-44h]
GameManager *GameVariable; // [sp+14h] [bp-40h]
int v67; // [sp+18h] [bp-3Ch]
signed int v68; // [sp+20h] [bp-34h]
signed int v69; // [sp+20h] [bp-34h]
int v70; // [sp+24h] [bp-30h]
int v71; // [sp+24h] [bp-30h]
int v72; // [sp+28h] [bp-2Ch]
int v73; // [sp+2Ch] [bp-28h] BYREF
int v74; // [sp+30h] [bp-24h]
_DWORD v75[5]; // [sp+34h] [bp-20h] BYREF
int v76; // [sp+48h] [bp-Ch]
v4 = 0;
LevelEditorLayer::forceShowSelectedObjects((cocos2d::CCArray *)this, 1);
GJBaseGameLayer::preUpdateVisibility((GJBaseGameLayer *)this, a2);
LevelEditorLayer::forceShowSelectedObjects((cocos2d::CCArray *)this, 0);
v5 = *(this + 381);
v63 = *(this + 357) == (GJEffectManager *)((char *)&dword_0 + 1);
active = GJEffectManager::activeColorForIndex(v5, 1005);
LOWORD(v74) = active;
BYTE2(v74) = BYTE2(active);
GJEffectManager::calculateLightBGColor(v5, v74);
v7 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 612) + 472))(*(this + 612));
v8 = (GameManager *)GameToolbox::transformColor(v7, 0.0, -0.3, 0.4);
LOWORD(v72) = (_WORD)v8;
BYTE2(v72) = BYTE2(v8);
v9 = (GameManager *)GameManager::sharedState(v8);
GameVariable = (GameManager *)GameManager::getGameVariable(v9, "0121");
v10 = (GameManager *)GameManager::sharedState(GameVariable);
v64 = &word_BEBC88;
v65 = &word_BEBC88;
v67 = GameManager::getGameVariable(v10, "0209");
while ( v4 < (int)*(this + 2730) )
{
v13 = *((_DWORD *)*(this + 2727) + v4);
if ( !*(this + 357) )
{
GameObject::updateStartPos(*((GameObject **)*(this + 2727) + v4), v11, v12, 0);
v14 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 92);
(*(void (__fastcall **)(_DWORD *, int))(*(_DWORD *)v13 + 680))(v75, v13);
v14(v13, v75);
}
if ( *(_BYTE *)(v13 + 657) )
{
if ( *((_BYTE *)this + 11884) || *(_BYTE *)(v13 + 1004) )
{
v21 = 1;
}
else
{
MainColorMode = GameObject::getMainColorMode((GameObject *)v13);
if ( ((1 << ((unsigned __int8)MainColorMode & 0x1F))
& *((_DWORD *)*(this + 3012) + ((unsigned int)MainColorMode >> 5))) == 0 )
{
if ( !GameObject::hasSecondaryColor((GameObject *)v13) )
goto LABEL_10;
SecondaryColorMode = GameObject::getSecondaryColorMode((GameObject *)v13);
if ( ((1 << ((unsigned __int8)SecondaryColorMode & 0x1F))
& *((_DWORD *)*(this + 3012) + ((unsigned int)SecondaryColorMode >> 5))) == 0 )
goto LABEL_10;
}
v21 = 0;
}
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 640))(v13, v21);
GameObject::addColorSpriteToParent((GameObject *)v13, v21);
*(_BYTE *)(v13 + 1004) = 0;
}
LABEL_10:
(*(void (__fastcall **)(int))(*(_DWORD *)v13 + 652))(v13);
if ( *((_BYTE *)this + 11705) && (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 864))(v13)
|| *((_BYTE *)this + 11704)
&& *(_DWORD *)(v13 + 892) == 2065
&& (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 864))(v13) )
{
v22 = *((double *)this + 98);
(*(void (__fastcall **)(int, _DWORD, int))(*(_DWORD *)v13 + 924))(v13, LODWORD(v22), -1);
}
if ( *((_BYTE *)this + 11705) && (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 868))(v13) )
EnhancedGameObject::updateRotateAction(v13, a2);
if ( !*(this + 357) && (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 864))(v13) && *(_BYTE *)(v13 + 1237) )
EnhancedGameObject::previewAnimateOnTrigger((EnhancedGameObject *)v13);
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 900))(v13) == 30 )
{
if ( v63 )
v16 = *(float *)((*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 366) + 96))(*(this + 366)) + 4);
else
v16 = 0.0;
EffectGameObject::updateInteractiveHover((EffectGameObject *)v13, v16);
}
if ( v63 || LevelEditorLayer::validGroup((LevelEditorLayer *)this, (GameObject *)v13, 0) )
v17 = 255.0;
else
v17 = 50.0;
if ( (GameVariable && *(_BYTE *)(v13 + 1114) || v67 && *(_BYTE *)(v13 + 1095)) && !*(_BYTE *)(v13 + 989) )
{
v17 = 0.0;
}
else if ( *(_DWORD *)(v13 + 892) == 3032 && *(this + 357) )
{
v17 = 50.0;
}
v18 = (char *)this + 11885;
if ( !*((_BYTE *)this + 11885) && GameObject::hasSecondaryColor((GameObject *)v13) )
{
*(float *)(*(_DWORD *)(v13 + 964) + 8) = v17 * 0.7;
if ( *(_BYTE *)(v13 + 755) )
AnimatedGameObject::updateChildSpriteColor(v13, 0xFFFFFF);
}
if ( !*v18 || *(_BYTE *)(v13 + 989) )
{
*(_DWORD *)(GameObject::getMainColor((GameObject *)v13) + 8) = 1065353216;
}
else
{
MainColor = GameObject::getMainColor((GameObject *)v13);
v27 = *(this + 381);
v28 = MainColor;
v29 = GameObject::getMainColorMode((GameObject *)v13);
*(_DWORD *)(v28 + 8) = GJEffectManager::activeOpacityForIndex(v27, (int)v29);
if ( GameObject::hasSecondaryColor((GameObject *)v13) )
{
SecondaryColor = GameObject::getSecondaryColor((GameObject *)v13);
v32 = *(this + 381);
v33 = SecondaryColor;
v34 = GameObject::getSecondaryColorMode((GameObject *)v13);
*(_DWORD *)(v33 + 8) = GJEffectManager::activeOpacityForIndex(v32, (int)v34);
}
v35 = GameObject::getMainColorMode((GameObject *)v13);
v36 = *((_BYTE *)&dword_0 + (_DWORD)v64 + 2);
LOWORD(v73) = *v64;
BYTE2(v73) = v36;
v37 = (int)v35;
v38 = GJEffectManager::activeColorForIndex(*(this + 381), (int)v35);
v39 = *(__int16 *)(v13 + 1020);
LOWORD(v73) = v38;
BYTE2(v73) = BYTE2(v38);
if ( v39 > 0 )
{
v42 = 0;
while ( v42 < *(__int16 *)(v13 + 1020) )
{
v68 = v42;
v70 = (int)*(this + 381);
GroupID = GameObject::getGroupID((GameObject *)v13, v42);
v44 = GJEffectManager::colorForGroupID(v70, GroupID, &v73, *(unsigned __int8 *)(v13 + 902) ^ 1);
v42 = v68 + 1;
LOWORD(v73) = v44;
BYTE2(v73) = BYTE2(v44);
}
}
v40 = *(_DWORD **)(v13 + 960);
if ( !sub_45F7AC((int)(v40 + 4)) )
{
v41 = GJEffectManager::colorForEffect(*(this + 381), v73, v40[4], v40[5], v40[6], v40[7], v63, v64, v65);
LOWORD(v73) = v41;
BYTE2(v73) = BYTE2(v41);
}
(*(void (__fastcall **)(int, int *))(*(_DWORD *)v13 + 792))(v13, &v73);
if ( v37 <= 0 )
v45 = 1.0;
else
v45 = COERCE_FLOAT(GJEffectManager::activeOpacityForIndex(*(this + 381), v37));
if ( *(__int16 *)(v13 + 1020) > 0 )
{
for ( i = 0; i < *(__int16 *)(v13 + 1020); ++i )
{
v47 = *(this + 381);
v48 = GameObject::getGroupID((GameObject *)v13, i);
v45 = v45 * COERCE_FLOAT(GJEffectManager::opacityModForGroup(v47, v48));
}
}
*(float *)(*(_DWORD *)(v13 + 960) + 8) = v45;
if ( GameObject::hasSecondaryColor((GameObject *)v13) )
{
v49 = GameObject::getSecondaryColorMode((GameObject *)v13);
v50 = *((_BYTE *)&dword_0 + (_DWORD)v65 + 2);
LOWORD(v75[0]) = *v65;
BYTE2(v75[0]) = v50;
v51 = (int)v49;
if ( v49 == (GJSpriteColor *)&stru_3EC.st_size )
{
v75[2] = 0;
v75[3] = 1059481190;
v75[4] = 1041865114;
LOWORD(v76) = 256;
v52 = GJEffectManager::colorForEffect(*(this + 381), v73, 0, 1059481190, 1041865114, v76, v63, v64, v65);
LOWORD(v75[0]) = v52;
BYTE2(v75[0]) = BYTE2(v52);
}
else
{
if ( (int)v49 > 0 )
{
v53 = GJEffectManager::activeColorForIndex(*(this + 381), (int)v49);
LOWORD(v75[0]) = v53;
BYTE2(v75[0]) = BYTE2(v53);
}
if ( *(__int16 *)(v13 + 1020) > 0 )
{
v60 = 0;
while ( v60 < *(__int16 *)(v13 + 1020) )
{
v69 = v60;
v71 = (int)*(this + 381);
v61 = GameObject::getGroupID((GameObject *)v13, v60);
v62 = GJEffectManager::colorForGroupID(v71, v61, v75, 0);
v60 = v69 + 1;
LOWORD(v75[0]) = v62;
BYTE2(v75[0]) = BYTE2(v62);
}
}
}
v54 = *(_DWORD **)(v13 + 964);
if ( !sub_45F7AC((int)(v54 + 4)) )
{
v55 = GJEffectManager::colorForEffect(*(this + 381), v75[0], v54[4], v54[5], v54[6], v54[7], v63, v64, v65);
LOWORD(v75[0]) = v55;
BYTE2(v75[0]) = BYTE2(v55);
}
(*(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 796))(v13, v75);
if ( v51 <= 0 )
v56 = 1.0;
else
v56 = COERCE_FLOAT(GJEffectManager::activeOpacityForIndex(*(this + 381), v51));
if ( *(__int16 *)(v13 + 1020) > 0 )
{
for ( j = 0; j < *(__int16 *)(v13 + 1020); ++j )
{
v58 = *(this + 381);
v59 = GameObject::getGroupID((GameObject *)v13, j);
v56 = v56 * COERCE_FLOAT(GJEffectManager::opacityModForGroup(v58, v59));
}
}
*(float *)(*(_DWORD *)(v13 + 964) + 8) = v56;
}
if ( *(_BYTE *)(v13 + 755) )
AnimatedGameObject::updateChildSpriteColor(v13, v72);
}
if ( !*v18 && GameObject::isColorObject((GameObject *)v13) )
v17 = v17 * 0.7;
if ( *v18 && *((_BYTE *)this + 11884) && *(_DWORD *)(v13 + 756) )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 456))(v13, 0);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 456))(v13, (unsigned __int8)(unsigned int)v17);
if ( *v18 || !*(_BYTE *)(v13 + 1005) || *(_BYTE *)(v13 + 989) )
*(_BYTE *)(v13 + 1005) = 0;
else
GameObject::updateObjectEditorColor((GameObject *)v13, v23, v24);
++v4;
v25 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 92);
(*(void (__fastcall **)(_DWORD *, int))(*(_DWORD *)v13 + 680))(v75, v13);
v25(v13, v75);
}
GJBaseGameLayer::updateEnterEffects((GJBaseGameLayer *)this, a2);
GJBaseGameLayer::processAreaVisualActions((GJBaseGameLayer *)this, a2);
GJBaseGameLayer::updateParticles((GJBaseGameLayer *)this, a2);
*((_BYTE *)this + 11884) = 0;
LevelEditorLayer::sortBatchnodeChildren((cocos2d::CCSpriteBatchNode *)this, 0.0);
LevelEditorLayer::updateKeyframeObjects((unsigned int)this);
return (*((int (__fastcall **)(GJEffectManager **))*this + 163))(this);
}