//
// ShaderLayer::init from 0x140481c90 to 0x140481d94 (260 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::setupLayers @ 0x14020afd0
// > GJBaseGameLayer::setupLayers @ 0x14020afc1
// > ??> @ 0x140609de8
// > ??> @ 0x1406dbb28
//
// 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
//
// Hidden C++ exception states: #wind=1
bool ShaderLayer::init(ShaderLayer *a1)
{
bool result; // al
__int64 v3; // rdx
double v4; // xmm0_8
void *v5; // [rsp+38h] [rbp+10h]
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v5 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
ShaderLayer::setupShader(a1, *(_BYTE *)(v3 + 1620));
v4 = (float)((float)((float)((float)rand() / 32767.0) * 100.0) + 10000.0);
a1->m_state.m_startTime = v4;
a1->m_state.m_time = v4;
if ( a1->m_state.m_minBlendingLayer != 1 )
{
a1->m_state.m_minBlendingLayer = 1;
a1->m_state.m_zLayerDirty = 1;
}
if ( a1->m_state.m_maxBlendingLayer != 15 )
{
a1->m_state.m_maxBlendingLayer = 15;
a1->m_state.m_zLayerDirty = 1;
}
if ( a1->m_state.m_noPlayerParticles )
a1->m_state.m_noPlayerParticles = 0;
a1->m_state.m_zLayerDirty = 1;
return 1;
}
return result;
}