//
// GJBaseGameLayer::preUpdateVisibility from 0x488e80 to 0x489b2a (3242 bytes)
//
// 2 xrefs:
// > PlayLayer::updateVisibility @ 0x315712
// > LevelEditorLayer::updateVisibility @ 0x369544
//
// 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 GJBaseGameLayer::preUpdateVisibility(GJBaseGameLayer *a1, float a2)
{
cocos2d::CCPoint *p_m_cameraPosition2; // r8
cocos2d::CCDirector *v4; // r0
float m_cameraZoom; // s17
const cocos2d::CCPoint *v6; // r0
int v7; // r2
bool v8; // r3
int v9; // r2
bool v10; // r3
float width; // s12
float x; // r1
float v13; // s14
float v14; // s15
float *p_m_cameraUnzoomedHeightOffset; // r9
float *p_m_cameraWidthOffset; // r7
float *p_m_cameraHeightOffset; // r8
OBB2D *m_cameraObb2; // r10
cocos2d::CCPoint v19; // r1
OBB2D *v20; // r10
cocos2d::CCPoint v21; // r1
float v22; // s15
float v23; // s14
GJGroundLayer *m_groundLayer; // r5
_BOOL4 v25; // r3
GJGroundLayer *m_groundLayer2; // r2
GJGroundLayer *v27; // r0
float v28; // r0
GJGroundLayer *v29; // r5
float v30; // r0
bool v31; // r2
float v32; // s14
float v33; // s15
float v34; // s19
float v35; // s20
float v36; // s21
float v37; // r0
float m_sectionXFactor; // s23
float v39; // s22
float v40; // s15
float v41; // s15
float v42; // s15
float v43; // s15
float v44; // s15
float m_sectionYFactor; // s23
float v46; // s15
float v47; // s15
float v48; // s15
int v49; // r0
cocos2d::CCDirector *v50; // r0
std::vector *, std::allocator *>> **m_start; // r5
int m_leftSectionIndex; // r2
char *v53; // r6
int v54; // r3
_DWORD *v55; // r0
_DWORD *v56; // t1
int v57; // r3
int m_bottomSectionIndex; // r1
int v59; // r8
_DWORD *v60; // r10
int v61; // r9
int v62; // r7
int m_visibleObjects2Count; // r2
int i; // r3
GameObject *v65; // r0
int v66; // r1
int v67; // r11
_BOOL4 v68; // r3
unsigned int v69; // r7
std::vector *, std::allocator *>> *v70; // r2
int v71; // r3
int v72; // r6
std::vector *v73; // r8
GameObject *v74; // r5
char *v75; // r0
cocos2d::CCRect *v76; // r9
int k; // r6
GameObject *v78; // r5
cocos2d::CCRect *v79; // r9
cocos2d::CCArray *m_uiObjects; // r3
int v81; // r5
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r7
cocos2d::CCObject **v84; // r6
GameObject *v85; // r5
GameObject *v86; // t1
GameObject ***v87; // r0
GameObject **v88; // r7
GameObject **v89; // r10
GameObject *v90; // r6
GameObject *v91; // t1
int m_visibleObjectsCount; // r3
int m_visibleObjectsIndex; // r2
GameObject *v94; // r0
int v95; // r5
int m_visibleObjects2Index; // r1
GameObject *v97; // r2
int v98; // r3
cocos2d::CCArray *v99; // r3
int v100; // r5
unsigned int v101; // r6
std::vector *, std::allocator *>> *v102; // r2
int v103; // r3
int v104; // r7
int v105; // r11
int v106; // r8
cocos2d::ccArray *v107; // r2
cocos2d::CCObject **v108; // r5
cocos2d::CCObject **v109; // r6
cocos2d::CCDictionary *m_objectsToDeactivate; // r3
int v111; // r0
int v112; // t1
cocos2d::CCDictElement *m_pElements; // r3
cocos2d::CCDictElement *next; // r5
_DWORD *v115; // r0
int v116; // r3
int v117; // r3
cocos2d::CCDictElement *v118; // r2
cocos2d::CCArray *m_batchNodes; // r3
cocos2d::CCParticleSystemQuad *m_glitterParticles; // r5
cocos2d::ccArray *v121; // r2
cocos2d::CCObject **v122; // r5
cocos2d::CCObject **v123; // r6
cocos2d::CCNode *v124; // r0
cocos2d::CCNode *v125; // t1
void (__fastcall *setPosVar)(cocos2d::CCParticleSystem *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCDirector *v127; // r0
float v128; // s16
cocos2d::CCDirector *v129; // r0
float v130; // r0
cocos2d::CCRect *v131; // r8
float v132; // s16
float height; // s16
float v134; // [sp+4h] [bp-54h]
std::vector *, std::allocator *>> *, std::allocator *, std::allocator *>> *>> *p_m_sections; // [sp+8h] [bp-50h]
int v136; // [sp+Ch] [bp-4Ch]
int v137; // [sp+10h] [bp-48h]
int v138; // [sp+14h] [bp-44h]
int v139; // [sp+18h] [bp-40h]
int v140; // [sp+1Ch] [bp-3Ch]
int j; // [sp+20h] [bp-38h]
int v142; // [sp+20h] [bp-38h]
int v143; // [sp+24h] [bp-34h]
int v144; // [sp+24h] [bp-34h]
std::vector *v145; // [sp+24h] [bp-34h]
int m_rightSectionIndex; // [sp+28h] [bp-30h]
int v147; // [sp+28h] [bp-30h]
int m_topSectionIndex; // [sp+2Ch] [bp-2Ch]
int v149; // [sp+2Ch] [bp-2Ch]
int v150; // [sp+2Ch] [bp-2Ch]
int v151; // [sp+30h] [bp-28h]
_BOOL4 v152; // [sp+30h] [bp-28h]
cocos2d::ccColor3B v153; // [sp+44h] [bp-14h] BYREF
GameObject *v154; // [sp+48h] [bp-10h] BYREF
GameObject *v155; // [sp+4Ch] [bp-Ch] BYREF
cocos2d::CCSize v156; // [sp+50h] [bp-8h] BYREF
cocos2d::CCPoint v157; // [sp+58h] [bp+0h] BYREF
char v158; // [sp+60h] [bp+8h] BYREF
char v159; // [sp+68h] [bp+10h] BYREF
cocos2d::CCPoint v160; // [sp+70h] [bp+18h] BYREF
cocos2d::CCRect v161; // [sp+78h] [bp+20h] BYREF
cocos2d::CCRect v162; // [sp+88h] [bp+30h] BYREF
_DWORD v163[7]; // [sp+98h] [bp+40h] BYREF
cocos2d::ccHSVValue v164; // 0:r1.12,12:^0.4
p_m_cameraPosition2 = &a1->m_gameState.m_cameraPosition2;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v156, v4);
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_Hashtable(
v163,
10);
cocos2d::CCPoint::CCPoint(&v157, p_m_cameraPosition2);
m_cameraZoom = a1->m_gameState.m_cameraZoom;
if ( a1->m_isEditor && !a1->m_started )
{
m_cameraZoom = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScale)(a1->m_objectLayer));
v6 = a1->m_objectLayer->getPosition(a1->m_objectLayer);
cocos2d::CCPoint::operator-(&v161, v6);
cocos2d::CCPoint::operator*(&v162, &v161, 1.0 / m_cameraZoom);
cocos2d::CCPoint::operator=((PlayerObject *)&v157, COERCE_FLOAT(&v162), v7, v8);
if ( a1->m_gameState.m_cameraShakeEnabled )
{
cocos2d::CCPoint::operator-(&v162, &v157, &a1->m_gameState.m_unkPoint34);
cocos2d::CCPoint::operator=((PlayerObject *)&v157, COERCE_FLOAT(&v162), v9, v10);
}
}
width = v156.width;
x = v157.x;
v13 = v156.width / m_cameraZoom;
v14 = v156.height / m_cameraZoom;
a1->m_cameraWidth = v156.width / m_cameraZoom;
a1->m_cameraHeight = v14;
a1->m_halfCameraWidth = v13 * 0.5;
a1->m_cameraUnzoomedX = p_m_cameraPosition2->x + (float)(width * 0.5);
a1->m_activeObjectsCount = 0;
cocos2d::CCRect::CCRect(&v161, x, v157.y, v13, v14);
p_m_cameraUnzoomedHeightOffset = &a1->m_cameraUnzoomedHeightOffset;
p_m_cameraWidthOffset = &a1->m_cameraWidthOffset;
p_m_cameraHeightOffset = &a1->m_cameraHeightOffset;
if ( a1->m_gameState.m_cameraAngle == 0.0 )
{
*p_m_cameraWidthOffset = 0.0;
*p_m_cameraHeightOffset = 0.0;
*p_m_cameraUnzoomedHeightOffset = 0.0;
a1->m_targetCameraHeightOffset = 0.0;
}
else
{
if ( a1->m_calculateTargetHeightOffset )
{
m_cameraObb2 = a1->m_cameraObb2;
cocos2d::CCPoint::CCPoint(&v162.origin, v156.width * 0.5, v156.height * 0.5);
LODWORD(v19.x) = &v162;
v19.y = v161.size.width;
OBB2D::calculateWithCenter(
m_cameraObb2,
v19,
v161.size.height,
a1->m_gameState.m_targetCameraAngle * 0.017453,
v134);
OBB2D::getBoundingRect(&v162, a1->m_cameraObb2);
a1->m_targetCameraHeightOffset = v162.size.height - v161.size.height;
a1->m_calculateTargetHeightOffset = 0;
}
v20 = a1->m_cameraObb2;
cocos2d::CCPoint::CCPoint(&v162.origin, v156.width * 0.5, v156.height * 0.5);
LODWORD(v21.x) = &v162;
v21.y = v161.size.width;
OBB2D::calculateWithCenter(v20, v21, v161.size.height, a1->m_gameState.m_cameraAngle * 0.017453, v134);
OBB2D::getBoundingRect(&v162, a1->m_cameraObb2);
v22 = v162.size.height - v161.size.height;
v23 = v162.size.width - v161.size.width;
*p_m_cameraUnzoomedHeightOffset = v162.size.height - v161.size.height;
*p_m_cameraWidthOffset = v23 * m_cameraZoom;
*p_m_cameraHeightOffset = v22 * m_cameraZoom;
}
m_groundLayer = a1->m_groundLayer;
v25 = a1->m_gameState.m_cameraAngle != 0.0;
if ( m_groundLayer->m_cameraRotated != v25 )
{
m_groundLayer2 = a1->m_groundLayer2;
v27 = a1->m_groundLayer;
m_groundLayer->m_cameraRotated = v25;
m_groundLayer2->m_cameraRotated = v25;
v28 = m_groundLayer->getScaleX(v27);
GJGroundLayer::scaleGround(m_groundLayer, v28);
v29 = a1->m_groundLayer2;
v30 = v29->getScaleX(v29);
GJGroundLayer::scaleGround(v29, v30);
}
if ( a1->m_gameState.m_cameraAngle != 0.0 && *p_m_cameraWidthOffset != 0.0 )
{
GJBaseGameLayer::updateGroundShadows(a1);
v31 = 1;
v32 = *p_m_cameraWidthOffset / m_cameraZoom;
v33 = *p_m_cameraHeightOffset / m_cameraZoom;
v161.origin.x = v161.origin.x - (float)(v32 * 0.5);
v161.origin.y = v161.origin.y - (float)(v33 * 0.5);
v161.size.width = v161.size.width + v32;
v161.size.height = v161.size.height + v33;
LABEL_17:
a1->m_updateGroundShadows = v31;
goto LABEL_18;
}
if ( a1->m_updateGroundShadows )
{
GJGroundLayer::updateShadowXPos(a1->m_groundLayer, 0.0, 0.0);
GJGroundLayer::updateShadows(a1->m_groundLayer);
GJGroundLayer::updateShadowXPos(a1->m_groundLayer2, 0.0, 0.0);
GJGroundLayer::updateShadows(a1->m_groundLayer2);
v31 = 0;
goto LABEL_17;
}
LABEL_18:
v34 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v161));
v35 = COERCE_FLOAT(cocos2d::CCRect::getMinX(&v161));
v36 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v161));
v37 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v161));
m_sectionXFactor = a1->m_sectionXFactor;
v39 = v37;
if ( v35 > 10000000.0 )
v40 = 10000000.0;
else
v40 = v35;
if ( (float)(floorf(v40 * m_sectionXFactor) - 1.0) <= 0.0 )
{
v136 = 0;
}
else
{
v41 = 10000000.0;
if ( v35 <= 10000000.0 )
v41 = v35;
v136 = (int)(float)(floorf(v41 * m_sectionXFactor) - 1.0);
}
v42 = 10000000.0;
if ( v34 <= 10000000.0 )
v42 = v34;
if ( (float)(ceilf(v42 * m_sectionXFactor) + 1.0) <= 0.0 )
{
v138 = 0;
}
else
{
v43 = 10000000.0;
if ( v34 <= 10000000.0 )
v43 = v34;
v138 = (int)(float)(ceilf(v43 * m_sectionXFactor) + 1.0);
}
v44 = 10000000.0;
m_sectionYFactor = a1->m_sectionYFactor;
if ( v39 <= 10000000.0 )
v44 = v39;
if ( (float)(floorf(v44 * m_sectionYFactor) - 1.0) <= 0.0 )
{
v137 = 0;
}
else
{
v46 = 10000000.0;
if ( v39 <= 10000000.0 )
v46 = v39;
v137 = (int)(float)(floorf(v46 * m_sectionYFactor) - 1.0);
}
v47 = 10000000.0;
if ( v36 <= 10000000.0 )
v47 = v36;
if ( (float)(ceilf(v47 * m_sectionYFactor) + 1.0) <= 0.0 )
{
v139 = 0;
}
else
{
v48 = 10000000.0;
if ( v36 <= 10000000.0 )
v48 = v36;
v139 = (int)(float)(ceilf(v48 * m_sectionYFactor) + 1.0);
}
GJEffectManager::activeColorForIndex(a1->m_effectManager, 1007);
v153 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1000);
v164.h = 0.0;
v164.s = -0.2;
v164.v = 0.2;
*(cocos2d::ccColor3B *)&v49 = GameToolbox::transformColor(&v153, v164);
*(_WORD *)&a1->m_lightBGColor.r = v49;
a1->m_lightBGColor.b = BYTE2(v49);
v50 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenRight(v50);
p_m_sections = &a1->m_sections;
m_start = a1->m_sections.m_start;
v140 = a1->m_sections.m_finish - m_start;
m_leftSectionIndex = a1->m_leftSectionIndex;
v53 = (char *)&m_start[m_leftSectionIndex];
m_rightSectionIndex = a1->m_rightSectionIndex;
while ( m_leftSectionIndex <= m_rightSectionIndex && m_leftSectionIndex < v140 )
{
v54 = v53 - (char *)m_start;
v56 = *(_DWORD **)v53;
v53 += 4;
v55 = v56;
v143 = v54;
if ( v56 )
v57 = (v55[1] - *v55) >> 2;
else
v57 = -1;
m_bottomSectionIndex = a1->m_bottomSectionIndex;
v59 = 4 * m_bottomSectionIndex;
m_topSectionIndex = a1->m_topSectionIndex;
while ( m_bottomSectionIndex <= m_topSectionIndex && m_bottomSectionIndex < v57 )
{
v60 = *(_DWORD **)(*v55 + v59);
if ( v60 )
{
v61 = 0;
v151 = *(_DWORD *)(**(_DWORD **)((char *)a1->m_sectionSizes.m_start + v143) + v59);
while ( v61 < v151 )
{
v62 = *(_DWORD *)(*v60 + 4 * v61++);
*(_BYTE *)(v62 + 854) = 1;
}
}
++m_bottomSectionIndex;
v59 += 4;
}
++m_leftSectionIndex;
}
m_visibleObjects2Count = a1->m_visibleObjects2Count;
for ( i = 0; i < m_visibleObjects2Count; ++i )
{
v65 = a1->m_visibleObjects2.m_start[i];
v65->m_unk3ee = 1;
}
v66 = v140;
v67 = v136;
v68 = v140 >= v138 - 1;
if ( v140 <= v136 + 1 )
v68 = 1;
v152 = v68;
v69 = v136;
while ( v67 <= v138 && v67 < v140 )
{
v70 = p_m_sections->m_start[v69];
if ( v70 )
v71 = p_m_sections->m_start[v69]->m_finish - v70->m_start;
else
v71 = -1;
v144 = v71;
v147 = v137;
for ( j = v137; j <= v139 && j < v144; ++j )
{
v72 = v152 || v144 <= v137 + 1 || v144 >= v139 - 1;
v73 = p_m_sections->m_start[v69]->m_start[v147];
if ( v73 )
{
v149 = a1->m_sectionSizes.m_start[v69]->m_start[v147];
if ( !v72 )
{
while ( 1 )
{
if ( v72 >= v149 )
goto LABEL_110;
v74 = v73->m_start[v72];
if ( !v74->m_isGroupDisabled )
{
if ( v74->m_isActivated )
{
v74->m_unk3ee = 0;
GJBaseGameLayer::addToObjectsToShow(a1, v74);
if ( v74->m_unk35C <= 0 )
goto LABEL_97;
v75 = &v158;
LABEL_95:
sub_488790((int)v75, v163, (unsigned int *)&v74->m_unk35C);
goto LABEL_97;
}
v76 = (cocos2d::CCRect *)((int (__fastcall *)(GameObject *, int))v74->getObjectTextureRect)(
v73->m_start[v72],
v66);
if ( v34 >= COERCE_FLOAT(cocos2d::CCRect::getMinX(v76))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxX(v76)) >= v35
&& v36 >= COERCE_FLOAT(cocos2d::CCRect::getMinY(v76))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxY(v76)) >= v39
|| v74->m_unk370 )
{
v74->m_unk3ee = 0;
GJBaseGameLayer::addToObjectsToShow(a1, v74);
if ( v74->m_unk35C <= 0 )
goto LABEL_97;
v75 = &v159;
goto LABEL_95;
}
}
v74->m_unk3ee = 1;
LABEL_97:
++v72;
}
}
for ( k = 0; k < v149; ++k )
{
v78 = v73->m_start[k];
if ( !v78->m_isGroupDisabled
&& ((v79 = (cocos2d::CCRect *)((int (__fastcall *)(GameObject *, int))v78->getObjectTextureRect)(
v73->m_start[k],
v66),
v34 >= COERCE_FLOAT(cocos2d::CCRect::getMinX(v79)))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxX(v79)) >= v35
&& v36 >= COERCE_FLOAT(cocos2d::CCRect::getMinY(v79))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxY(v79)) >= v39
|| v78->m_unk370) )
{
v78->m_unk3ee = 0;
GJBaseGameLayer::addToObjectsToShow(a1, v78);
if ( v78->m_unk35C > 0 )
sub_488790((int)&v160, v163, (unsigned int *)&v78->m_unk35C);
}
else
{
v78->m_unk3ee = 1;
}
}
}
LABEL_110:
++v147;
}
++v67;
++v69;
}
m_uiObjects = a1->m_uiObjects;
if ( m_uiObjects )
{
data = m_uiObjects->data;
if ( data->num )
{
arr = data->arr;
v84 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v84 )
{
v86 = (GameObject *)*arr++;
v85 = v86;
if ( !v86 )
break;
if ( !v85->m_isGroupDisabled
&& ((v131 = (cocos2d::CCRect *)((int (__fastcall *)(GameObject *, int))v85->getObjectTextureRect)(v85, v66),
v132 = v156.width,
v132 >= COERCE_FLOAT(cocos2d::CCRect::getMinX(v131)))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxX(v131)) >= 0.0
&& (height = v156.height, height >= COERCE_FLOAT(cocos2d::CCRect::getMinY(v131)))
&& COERCE_FLOAT(cocos2d::CCRect::getMaxY(v131)) >= 0.0
|| v85->m_unk370) )
{
v85->m_unk3ee = 0;
GJBaseGameLayer::addToObjectsToShow(a1, v85);
if ( v85->m_unk35C > 0 )
sub_488790((int)&v162, v163, (unsigned int *)&v85->m_unk35C);
}
else
{
v85->m_unk3ee = 1;
}
}
}
}
v81 = v163[2];
a1->m_visibleObjectsCount = 0;
while ( v81 )
{
v162.origin.x = *(float *)(v81 + 4);
v87 = (GameObject ***)std::__detail::_Map_base>,std::allocator>>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
&a1->m_visibilityGroups._M_h._M_buckets,
(unsigned int *)&v162);
v88 = *v87;
v89 = v87[1];
while ( v88 != v89 )
{
v91 = *v88++;
v90 = v91;
if ( (!v91->m_isActivated || v90->m_unk3ee) && !v90->m_isGroupDisabled )
{
v90->m_unk3ee = 0;
GJBaseGameLayer::addToObjectsToShow(a1, v90);
m_visibleObjectsCount = a1->m_visibleObjectsCount;
m_visibleObjectsIndex = a1->m_visibleObjectsIndex;
v154 = v90;
if ( m_visibleObjectsIndex > m_visibleObjectsCount )
{
a1->m_visibleObjects.m_start[m_visibleObjectsCount] = v90;
}
else
{
std::vector::push_back((int)&a1->m_visibleObjects, &v154);
++a1->m_visibleObjectsIndex;
}
++a1->m_visibleObjectsCount;
}
}
v81 = *(_DWORD *)v81;
}
while ( v81 < a1->m_visibleObjects2Count )
{
v94 = a1->m_visibleObjects2.m_start[v81];
if ( v94->m_unk3ee )
v94->deactivateObject(v94, 0);
++v81;
}
v95 = 0;
a1->m_visibleObjects2Count = 0;
while ( v95 < a1->m_visibleObjectsCount )
{
m_visibleObjects2Index = a1->m_visibleObjects2Index;
v97 = a1->m_visibleObjects.m_start[v95];
v98 = a1->m_visibleObjects2Count;
v155 = v97;
if ( m_visibleObjects2Index > v98 )
{
a1->m_visibleObjects2.m_start[v98] = v97;
}
else
{
std::vector::push_back((int)&a1->m_visibleObjects2, &v155);
++a1->m_visibleObjects2Index;
}
++v95;
++a1->m_visibleObjects2Count;
}
if ( !a1->m_objectsDeactivated )
{
v100 = a1->m_leftSectionIndex;
v101 = v100;
while ( v100 <= a1->m_rightSectionIndex && v100 < v140 )
{
v102 = p_m_sections->m_start[v101];
if ( v102 )
v103 = p_m_sections->m_start[v101]->m_finish - v102->m_start;
else
v103 = -1;
v142 = v103;
v104 = a1->m_bottomSectionIndex;
v105 = v104;
while ( v104 <= a1->m_topSectionIndex && v104 < v142 )
{
v145 = p_m_sections->m_start[v101]->m_start[v105];
if ( v145 )
{
v106 = 0;
v150 = a1->m_sectionSizes.m_start[v101]->m_start[v105];
while ( v106 < v150 )
{
v145->m_start[v106]->deactivateObject(v145->m_start[v106], 0);
++v106;
}
}
++v104;
++v105;
}
++v100;
++v101;
}
}
v99 = a1->m_uiObjects;
if ( v99 )
{
v107 = v99->data;
if ( v107->num )
{
v108 = v107->arr;
v109 = &v108[v107->num] + 0x3FFFFFFF;
while ( v108 <= v109 )
{
v112 = (int)*v108++;
v111 = v112;
if ( !v112 )
break;
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v111 + 648))(v111, 0);
}
}
}
m_objectsToDeactivate = a1->m_objectsToDeactivate;
if ( m_objectsToDeactivate )
{
m_pElements = m_objectsToDeactivate->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
v115 = &m_pElements->m_pObject->__vftable;
v116 = v115[132];
if ( v116 < v136 || v116 > v138 || (v117 = v115[133], v117 < v137) || v117 > v139 )
(*(void (__fastcall **)(_DWORD *, int))(*v115 + 648))(v115, 1);
if ( next )
v118 = (cocos2d::CCDictElement *)next->hh.next;
else
v118 = nullptr;
m_pElements = next;
next = v118;
}
}
cocos2d::CCDictionary::removeAllObjects(a1->m_objectsToDeactivate);
m_batchNodes = a1->m_batchNodes;
if ( m_batchNodes )
{
v121 = m_batchNodes->data;
if ( v121->num )
{
v122 = v121->arr;
v123 = &v122[v121->num] + 0x3FFFFFFF;
while ( v122 <= v123 )
{
v125 = (cocos2d::CCNode *)*v122++;
v124 = v125;
if ( !v125 )
break;
cocos2d::CCNode::updateChildIndexes(v124);
}
}
}
m_glitterParticles = a1->m_glitterParticles;
if ( m_glitterParticles )
{
setPosVar = m_glitterParticles->setPosVar;
v127 = cocos2d::CCDirector::sharedDirector();
v128 = (float)((float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenScaleFactorW(v127)) * 480.0) / 1.8) / m_cameraZoom;
v129 = cocos2d::CCDirector::sharedDirector();
v130 = COERCE_FLOAT(cocos2d::CCDirector::getScreenScaleFactorH(v129));
cocos2d::CCPoint::CCPoint(&v160, v128, (float)(v130 * 320.0) * 0.5);
cocos2d::CCPoint::operator/(&v162, &v160, LODWORD(m_cameraZoom));
setPosVar(m_glitterParticles, &v162.origin);
}
a1->m_objectsDeactivated = 0;
a1->m_leftSectionIndex = v136;
a1->m_rightSectionIndex = v138;
a1->m_bottomSectionIndex = v137;
a1->m_topSectionIndex = v139;
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::~_Hashtable((int)v163);
}