//
// ShaderLayer::preLensCircleShader from 0x100271d24 to 0x100271ea8 (388 bytes)
//
// 1 xrefs:
// > ShaderLayer::performCalculations @ 0x100273158
//
// 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 ShaderLayer::preLensCircleShader(ShaderLayer *a1)
{
float v2; // s0
GJBaseGameLayer *m_gameLayer; // x8
float v4; // s0
float m_lensCircleFade; // s1
float v6; // s1
float v7; // s8
float v8; // s9
cocos2d::CCGLProgram *v9; // x0
cocos2d::CCGLProgram *v10; // x0
cocos2d::CCGLProgram *v11; // x0
cocos2d::CCGLProgram *v12; // x0
unsigned int v13; // s0
unsigned int v14; // s1
unsigned int v15; // s3
cocos2d::CCGLProgram *v16; // x0
__n128 v17; // q0
int m_lensCircleStrengthUniform; // w1
float v19; // s0
if ( a1->m_state.m_lensCircleStrength > 0.0 || cocos2d::CCNode::getActionByTag(a1, 13) )
a1->m_state.m_usesShaders = 1;
if ( a1->m_state.m_lensCircleStrength <= 0.0 )
{
v16 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
m_lensCircleStrengthUniform = a1->m_lensCircleStrengthUniform;
v19 = 0.0;
}
else
{
v2 = 1.0;
if ( a1->m_state.m_lensCircleRelative )
{
m_gameLayer = a1->m_gameLayer;
if ( m_gameLayer )
v2 = fabsf(
((float (__fastcall *)(cocos2d::CCLayer *, float))m_gameLayer->m_objectLayer->getScale)(
m_gameLayer->m_objectLayer,
1.0));
}
v4 = (float)(v2 * a1->m_state.m_lensCircleSize) * a1->m_shockWaveTimeMult;
m_lensCircleFade = a1->m_state.m_lensCircleFade;
if ( m_lensCircleFade < 0.0 )
m_lensCircleFade = 0.0;
v6 = v4 - m_lensCircleFade;
if ( v6 >= 0.0 )
v7 = v6;
else
v7 = 0.0;
if ( v4 >= 0.0 )
v8 = v4;
else
v8 = 0.0;
v9 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
cocos2d::CCGLProgram::setUniformLocationWith1f(v9, a1->m_lensCircleStartUniform, v7);
v10 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
cocos2d::CCGLProgram::setUniformLocationWith1f(v10, a1->m_lensCircleEndUniform, v8);
v11 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
cocos2d::CCGLProgram::setUniformLocationWith1f(
v11,
a1->m_lensCircleStrengthUniform,
a1->m_state.m_lensCircleStrength);
v12 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
LOBYTE(v13) = a1->m_state.m_lensCircleTint.r;
LOBYTE(v14) = a1->m_state.m_lensCircleTint.g;
LOBYTE(v15) = a1->m_state.m_lensCircleTint.b;
cocos2d::CCGLProgram::setUniformLocationWith3f(
v12,
a1->m_lensCircleTintUniform,
(float)v13 / 255.0,
(float)v14 / 255.0,
(float)v15 / 255.0);
v17 = ((__n128 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getShaderProgram)(a1->m_sprite);
m_lensCircleStrengthUniform = a1->m_lensCircleAdditiveUniform;
v17.n128_u8[0] = a1->m_state.m_lensCircleAdditive;
v19 = (float)v17.n128_u32[0];
}
cocos2d::CCGLProgram::setUniformLocationWith1f(v16, m_lensCircleStrengthUniform, v19);
}