//
// GameObject::addToOpacityGroup from 0x1005be8b0 to 0x1005be947 (151 bytes)
//
// 1 xrefs:
// > PlayLayer::optimizeOpacityGroups @ 0x1000aedee
//
// 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 GameObject::addToOpacityGroup(GameObject *a1, int a2)
{
__int64 m_opacityGroupCount; // r14
std::array *m_opacityGroups; // rax
__int64 v4; // rcx
m_opacityGroupCount = a1->m_opacityGroupCount;
if ( m_opacityGroupCount < 10 && (unsigned int)(a2 - 10000) >= 0xFFFFD8F1 )
{
m_opacityGroups = a1->m_opacityGroups;
if ( m_opacityGroups )
{
if ( (__int16)m_opacityGroupCount <= 0 )
goto LABEL_9;
}
else
{
m_opacityGroups = (std::array *)operator new[](0x14u);
a1->m_opacityGroups = m_opacityGroups;
*(_OWORD *)m_opacityGroups->__elems_ = 0;
*(_DWORD *)&m_opacityGroups->__elems_[8] = 0;
if ( (__int16)m_opacityGroupCount <= 0 )
{
LABEL_9:
m_opacityGroups->__elems_[m_opacityGroupCount] = a2;
++a1->m_opacityGroupCount;
return;
}
}
v4 = 0;
while ( m_opacityGroups->__elems_[v4] != a2 )
{
if ( m_opacityGroupCount == ++v4 )
goto LABEL_9;
}
}
}