// // GJBaseGameLayer::updateShaderLayer from 0x472424 to 0x472ada (1718 bytes) // // 6 xrefs: // > PlayLayer::resetLevel @ 0x31fd28 // > LevelEditorLayer::onPlaytest @ 0x36ed02 // > LevelEditorLayer::updateGameObjects @ 0x375fea // > GJBaseGameLayer::resetLevelVariables @ 0x491d3c // > GJBaseGameLayer::update @ 0x4971ae // > GJBaseGameLayer::update @ 0x497cf6 // // 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::updateShaderLayer(GJBaseGameLayer *a1, float a2) { ShaderLayer *m_shaderLayer; // r1 int m_grayscaleTintChannel; // r1 int v6; // r0 ShaderLayer *v7; // r1 ShaderLayer *v8; // r5 int m_blurRefChannel; // r1 int v10; // r0 const cocos2d::ccColor3B *v11; // r0 GLubyte b; // r3 ShaderLayer *v13; // r5 int m_radialBlurTargetID; // r2 ShaderLayer *v15; // r5 int m_pinchTargetIDX; // r2 ShaderLayer *v17; // r5 int m_pinchTargetIDY; // r2 ShaderLayer *v19; // r6 int m_shockWaveTargetID; // r2 cocos2d::CCPoint v21; // r1 ShaderLayer *v22; // r6 int m_shockLineTargetID; // r2 cocos2d::CCPoint v24; // r1 ShaderLayer *v25; // r6 int m_lensCircleTargetID; // r2 int v27; // r2 bool v28; // r3 ShaderLayer *v29; // r6 int m_bulgeTargetID; // r2 int v31; // r2 bool v32; // r3 int m_lensCircleTintChannel; // r1 int v34; // r0 GLubyte v35; // r7 GLubyte v36; // r6 GLubyte v37; // r5 bool shouldBlend; // r0 ShaderLayer *v39; // r3 ShaderLayer *v40; // r3 int m_motionBlurTargetIDX; // r2 float x; // r7 int m_motionBlurTargetIDY; // r2 float y; // r6 ShaderLayer *v45; // r0 int (*getParent)(void); // r3 int i; // r7 cocos2d::CCArray *v48; // r0 cocos2d::CCLayer *m_inShaderObjectLayer; // r8 cocos2d::CCArray *v50; // r5 int j; // r7 cocos2d::CCArray *v52; // r6 cocos2d::ccArray *data; // r2 cocos2d::CCObject **arr; // r6 cocos2d::CCObject **v55; // r5 cocos2d::CCNode *v56; // r1 cocos2d::CCNode *v57; // t1 cocos2d::CCArray *v58; // r0 cocos2d::CCArray *v59; // r5 cocos2d::CCArray *v60; // r6 cocos2d::ccArray *v61; // r2 cocos2d::CCObject **v62; // r6 cocos2d::CCObject **v63; // r5 cocos2d::CCNode *v64; // r1 cocos2d::CCNode *v65; // t1 void *v66; // r2 int v67; // r5 int v68; // r9 cocos2d::CCNode *v69; // r2 GJMGLayer *m_middleground; // r1 cocos2d::CCNode *m_objectParent; // r6 GJGroundLayer *m_groundLayer; // r1 GJGroundLayer *m_groundLayer2; // r1 cocos2d::CCNode *m_aboveShaderParent; // r2 int v75; // r8 cocos2d::CCArray *v76; // r0 cocos2d::CCLayer *m_aboveShaderObjectLayer; // r2 cocos2d::CCLayer *m_objectLayer; // r3 int v79; // r7 cocos2d::CCArray *v80; // r0 cocos2d::CCArray *v81; // r0 cocos2d::CCArray *v82; // r10 cocos2d::CCArray *v83; // r0 cocos2d::CCArray *v84; // r0 cocos2d::CCArray *v85; // r11 cocos2d::CCArray *v86; // r0 int k; // r6 int v88; // r5 cocos2d::CCNode *v89; // r5 void (__fastcall *setVisible)(cocos2d::CCNode *__hidden, bool); // r6 _BOOL4 v91; // r1 cocos2d::CCNode *v92; // r5 void (__fastcall *v93)(cocos2d::CCNode *__hidden, bool); // r6 _BOOL4 v94; // r1 int v95; // r2 bool v96; // r3 cocos2d::CCNode *m_inShaderParent; // r2 bool v98; // cc bool v99; // cc cocos2d::CCArray *v100; // r3 cocos2d::ccArray *v101; // r3 cocos2d::CCObject **v102; // r9 cocos2d::CCNode *v103; // r1 cocos2d::CCNode *v104; // t1 int v105; // r0 cocos2d::CCLayer *v106; // r2 cocos2d::CCArray *v107; // [sp+0h] [bp-34h] cocos2d::CCLayer *v108; // [sp+4h] [bp-30h] cocos2d::CCLayer *v109; // [sp+8h] [bp-2Ch] cocos2d::CCObject **v110; // [sp+Ch] [bp-28h] cocos2d::CCNode *v111; // [sp+14h] [bp-20h] __int16 v112; // [sp+1Ch] [bp-18h] char v113; // [sp+1Eh] [bp-16h] cocos2d::CCPoint v114; // [sp+24h] [bp-10h] BYREF m_shaderLayer = a1->m_shaderLayer; if ( !m_shaderLayer ) goto LABEL_98; m_grayscaleTintChannel = m_shaderLayer->m_state.m_grayscaleTintChannel; v112 = -1; v113 = -1; if ( m_grayscaleTintChannel > 0 ) { *(cocos2d::ccColor3B *)&v6 = GJEffectManager::activeColorForIndex(a1->m_effectManager, m_grayscaleTintChannel); v112 = v6; v113 = BYTE2(v6); } v7 = a1->m_shaderLayer; *(_WORD *)&v7->m_state.m_grayscaleTint.r = v112; v7->m_state.m_grayscaleTint.b = v113; v8 = a1->m_shaderLayer; m_blurRefChannel = v8->m_state.m_blurRefChannel; if ( m_blurRefChannel <= 0 ) { v11 = a1->m_background->getColor(a1->m_background); b = v11->b; *(_WORD *)&v8->m_state.m_blurRefColor.r = *(_WORD *)&v11->r; v8->m_state.m_blurRefColor.b = b; } else { *(cocos2d::ccColor3B *)&v10 = GJEffectManager::activeColorForIndex(a1->m_effectManager, m_blurRefChannel); *(_WORD *)&v8->m_state.m_blurRefColor.r = v10; v8->m_state.m_blurRefColor.b = BYTE2(v10); } v13 = a1->m_shaderLayer; if ( v13->m_state.m_radialBlurTarget ) { m_radialBlurTargetID = v13->m_state.m_radialBlurTargetID; if ( m_radialBlurTargetID ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_radialBlurTargetID); cocos2d::CCPoint::operator=((PlayerObject *)&v13->m_state.m_radialBlurCenter, COERCE_FLOAT(&v114), v95, v96); } } v15 = a1->m_shaderLayer; if ( v15->m_state.m_pinchTargetEnabledX ) { m_pinchTargetIDX = v15->m_state.m_pinchTargetIDX; if ( m_pinchTargetIDX ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_pinchTargetIDX); v15->m_state.m_pinchCenter.x = v114.x; } } v17 = a1->m_shaderLayer; if ( v17->m_state.m_pinchTargetEnabledY ) { m_pinchTargetIDY = v17->m_state.m_pinchTargetIDY; if ( m_pinchTargetIDY ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_pinchTargetIDY); v17->m_state.m_pinchCenter.y = v114.y; } } v19 = a1->m_shaderLayer; m_shockWaveTargetID = v19->m_state.m_shockWaveTargetID; if ( m_shockWaveTargetID ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_shockWaveTargetID); LODWORD(v21.x) = &v114; ShaderLayer::updateShockWaveCenter(v19, v21); } v22 = a1->m_shaderLayer; m_shockLineTargetID = v22->m_state.m_shockLineTargetID; if ( m_shockLineTargetID ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_shockLineTargetID); LODWORD(v24.x) = &v114; ShaderLayer::updateShockLineCenter(v22, v24); } v25 = a1->m_shaderLayer; m_lensCircleTargetID = v25->m_state.m_lensCircleTargetID; if ( m_lensCircleTargetID ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_lensCircleTargetID); cocos2d::CCPoint::operator=((PlayerObject *)&v25->m_state.m_lensCircleCenter, COERCE_FLOAT(&v114), v27, v28); } v29 = a1->m_shaderLayer; m_bulgeTargetID = v29->m_state.m_bulgeTargetID; if ( m_bulgeTargetID ) { GJBaseGameLayer::positionForShaderTarget(&v114, a1, m_bulgeTargetID); cocos2d::CCPoint::operator=((PlayerObject *)&v29->m_state.m_bulgeCenter, COERCE_FLOAT(&v114), v31, v32); } m_lensCircleTintChannel = a1->m_shaderLayer->m_state.m_lensCircleTintChannel; if ( m_lensCircleTintChannel <= 0 ) { v37 = 0; v36 = 0; v35 = 0; shouldBlend = 0; } else { *(cocos2d::ccColor3B *)&v34 = GJEffectManager::activeColorForIndex(a1->m_effectManager, m_lensCircleTintChannel); v35 = v34; v36 = BYTE1(v34); v37 = BYTE2(v34); shouldBlend = GJEffectManager::shouldBlend(a1->m_effectManager, a1->m_shaderLayer->m_state.m_lensCircleTintChannel); } v39 = a1->m_shaderLayer; v39->m_state.m_lensCircleTint.r = v35; v39->m_state.m_lensCircleTint.g = v36; v39->m_state.m_lensCircleTint.b = v37; v40 = a1->m_shaderLayer; m_motionBlurTargetIDX = v40->m_state.m_motionBlurTargetIDX; v40->m_state.m_lensCircleAdditive = shouldBlend; if ( m_motionBlurTargetIDX ) { GJBaseGameLayer::speedForShaderTarget(&v114, a1, m_motionBlurTargetIDX); x = v114.x; } else { x = 0.0; } m_motionBlurTargetIDY = a1->m_shaderLayer->m_state.m_motionBlurTargetIDY; if ( m_motionBlurTargetIDY ) { GJBaseGameLayer::speedForShaderTarget(&v114, a1, m_motionBlurTargetIDY); y = v114.y; } else { y = 0.0; } ShaderLayer::updateMotionBlurSpeedX(a1->m_shaderLayer, x, a2 * 60.0); ShaderLayer::updateMotionBlurSpeedY(a1->m_shaderLayer, y, a2 * 60.0); ((void (__fastcall *)(ShaderLayer *, _DWORD))a1->m_shaderLayer->update)(a1->m_shaderLayer, LODWORD(a2)); ShaderLayer::performCalculations(a1->m_shaderLayer); v45 = a1->m_shaderLayer; getParent = (int (*)(void))v45->getParent; if ( !v45->m_state.m_usesShaders ) { if ( !getParent() ) goto LABEL_97; for ( i = 1; ; ++i ) { if ( i == 1 ) { v48 = a1->m_inShaderParent->getChildren(a1->m_inShaderParent); m_inShaderObjectLayer = a1->m_inShaderObjectLayer; v50 = v48; if ( !v48 ) continue; } else { v48 = a1->m_aboveShaderParent->getChildren(a1->m_aboveShaderParent); m_inShaderObjectLayer = a1->m_aboveShaderObjectLayer; v50 = v48; if ( !v48 ) goto LABEL_43; } v52 = (cocos2d::CCArray *)cocos2d::CCArray::create(v48); cocos2d::CCArray::addObjectsFromArray(v52, v50); if ( v52 ) { data = v52->data; if ( data->num ) { arr = data->arr; v55 = &arr[data->num] + 0x3FFFFFFF; while ( arr <= v55 ) { v57 = (cocos2d::CCNode *)*arr++; v56 = v57; if ( !v57 ) break; if ( v56 != m_inShaderObjectLayer ) GJBaseGameLayer::reparentObject(a1, v56, a1->m_objectParent); } } } LABEL_43: if ( i == 2 ) { for ( j = 1; ; ++j ) { if ( j == 1 ) { v58 = a1->m_inShaderObjectLayer->getChildren(a1->m_inShaderObjectLayer); v59 = v58; if ( !v58 ) continue; } else { v58 = a1->m_aboveShaderObjectLayer->getChildren(a1->m_aboveShaderObjectLayer); v59 = v58; if ( !v58 ) goto LABEL_55; } v60 = (cocos2d::CCArray *)cocos2d::CCArray::create(v58); cocos2d::CCArray::addObjectsFromArray(v60, v59); if ( v60 ) { v61 = v60->data; if ( v61->num ) { v62 = v61->arr; v63 = &v62[v61->num] + 0x3FFFFFFF; while ( v62 <= v63 ) { v65 = (cocos2d::CCNode *)*v62++; v64 = v65; if ( !v65 ) break; GJBaseGameLayer::reparentObject(a1, v64, a1->m_objectLayer); } } } LABEL_55: if ( j == 2 ) { GJBaseGameLayer::reparentObject(a1, a1->m_objectParent, a1); GJBaseGameLayer::reparentObject(a1, a1->m_inShaderParent, a1); a1->m_shaderLayer->removeFromParentAndCleanup(a1->m_shaderLayer, 0); goto LABEL_97; } } } } } if ( getParent() && !a1->m_shaderLayer->m_state.m_zLayerDirty ) goto LABEL_97; v66 = a1->m_shaderLayer; v67 = *((_DWORD *)v66 + 237); v68 = *((_DWORD *)v66 + 238); if ( v67 > 1 ) v66 = a1; GJBaseGameLayer::reparentObject(a1, a1->m_objectParent, (cocos2d::CCNode *)v66); if ( v67 <= 1 ) v69 = a1; else v69 = a1->m_shaderLayer; GJBaseGameLayer::reparentObject(a1, a1->m_inShaderParent, v69); m_middleground = a1->m_middleground; if ( m_middleground ) { if ( v67 == 2 && v68 > 1 ) m_inShaderParent = a1->m_inShaderParent; else m_inShaderParent = a1->m_objectParent; GJBaseGameLayer::reparentObject(a1, m_middleground, m_inShaderParent); } m_objectParent = a1->m_objectParent; if ( v67 <= 1 ) { v98 = v68 <= 12; } else { if ( v68 <= 12 ) { m_objectParent = a1->m_aboveShaderParent; goto LABEL_71; } v98 = v67 <= 13; } if ( v98 ) m_objectParent = a1->m_inShaderParent; LABEL_71: m_groundLayer = a1->m_groundLayer; if ( m_groundLayer ) GJBaseGameLayer::reparentObject(a1, m_groundLayer, m_objectParent); m_groundLayer2 = a1->m_groundLayer2; if ( m_groundLayer2 ) GJBaseGameLayer::reparentObject(a1, m_groundLayer2, m_objectParent); m_aboveShaderParent = a1->m_objectParent; if ( v67 <= 1 ) { v99 = v68 <= 13; } else { if ( v68 <= 13 ) { m_aboveShaderParent = a1->m_aboveShaderParent; goto LABEL_78; } v99 = v67 <= 14; } if ( v99 ) m_aboveShaderParent = a1->m_inShaderParent; LABEL_78: GJBaseGameLayer::reparentObject(a1, a1->m_uiTriggerUI, m_aboveShaderParent); v75 = GJBaseGameLayer::minZOrderForShaderZ(a1, v67); v76 = (cocos2d::CCArray *)GJBaseGameLayer::maxZOrderForShaderZ(a1, v68); m_aboveShaderObjectLayer = a1->m_aboveShaderObjectLayer; m_objectLayer = a1->m_inShaderObjectLayer; v79 = (int)v76; if ( !a1->m_shaderLayer->m_state.m_noPlayerParticles ) { LABEL_79: if ( v67 <= 1 ) m_aboveShaderObjectLayer = a1->m_inShaderObjectLayer; v108 = m_aboveShaderObjectLayer; if ( v67 <= 1 ) m_objectLayer = a1->m_objectLayer; v109 = m_objectLayer; goto LABEL_84; } if ( v67 != 8 ) { if ( v68 == 8 ) v79 = 60; goto LABEL_79; } if ( v68 != 8 ) { v75 = 40; goto LABEL_79; } v109 = a1->m_inShaderObjectLayer; v79 = 60; v108 = a1->m_aboveShaderObjectLayer; v75 = 40; LABEL_84: v107 = (cocos2d::CCArray *)cocos2d::CCArray::create(v76); v80 = a1->m_objectLayer->getChildren(a1->m_objectLayer); if ( v80 ) { v81 = a1->m_objectLayer->getChildren(a1->m_objectLayer); v80 = (cocos2d::CCArray *)cocos2d::CCArray::addObjectsFromArray(v107, v81); } v82 = (cocos2d::CCArray *)cocos2d::CCArray::create(v80); v83 = a1->m_inShaderObjectLayer->getChildren(a1->m_inShaderObjectLayer); if ( v83 ) { v84 = a1->m_inShaderObjectLayer->getChildren(a1->m_inShaderObjectLayer); v83 = (cocos2d::CCArray *)cocos2d::CCArray::addObjectsFromArray(v82, v84); } v85 = (cocos2d::CCArray *)cocos2d::CCArray::create(v83); if ( a1->m_aboveShaderObjectLayer->getChildren(a1->m_aboveShaderObjectLayer) ) { v86 = a1->m_aboveShaderObjectLayer->getChildren(a1->m_aboveShaderObjectLayer); cocos2d::CCArray::addObjectsFromArray(v85, v86); } for ( k = 1; k == 1; ++k ) { if ( v107 ) { v100 = v107; goto LABEL_129; } LABEL_125: ; } if ( k == 2 ) { if ( v82 ) { v100 = v82; goto LABEL_129; } goto LABEL_125; } if ( !v85 ) goto LABEL_94; v100 = v85; LABEL_129: v101 = v100->data; if ( v101->num ) { v102 = v101->arr; v110 = &v102[v101->num] + 0x3FFFFFFF; while ( v102 <= v110 ) { v104 = (cocos2d::CCNode *)*v102++; v103 = v104; if ( !v104 ) break; v111 = v103; v105 = v103->getZOrder(v103); if ( v105 >= v75 ) { v106 = v108; if ( v105 <= v79 ) v106 = v109; } else { v106 = a1->m_objectLayer; } GJBaseGameLayer::reparentObject(a1, v111, v106); } } LABEL_94: if ( k != 3 ) goto LABEL_125; v88 = v67 > 1; if ( a1->m_shaderLayer->getParent(a1->m_shaderLayer) ) { if ( a1->m_shaderLayer->getZOrder(a1->m_shaderLayer) != v88 ) a1->m_shaderLayer->setZOrder(a1->m_shaderLayer, v88); } else { a1->addChild_0(a1, a1->m_shaderLayer, v88); } LABEL_97: a1->m_shaderLayer->m_state.m_zLayerDirty = 0; LABEL_98: v89 = a1->m_inShaderParent; setVisible = v89->setVisible; v91 = v89->getChildrenCount(v89) > 1 || a1->m_inShaderObjectLayer->getChildrenCount(a1->m_inShaderObjectLayer) != 0; setVisible(v89, v91); v92 = a1->m_aboveShaderParent; v93 = v92->setVisible; v94 = v92->getChildrenCount(v92) > 1 || a1->m_aboveShaderObjectLayer->getChildrenCount(a1->m_aboveShaderObjectLayer) != 0; v93(v92, v94); }
GD Web Decomp Icon

GD Web Decomp

Raw Source