//
// FMODAudioEngine::updateChannelTweens from 0x5b35f8 to 0x5b374c (340 bytes)
//
// 2 xrefs:
// > FMODAudioEngine::update @ 0x5bb268
// > ??> @ 0xc68e8
//
// 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 FMODAudioEngine::updateChannelTweens(FMODAudioEngine *a1, float a2)
{
AudioTargetType i; // w23
std::map,FMODSoundTween> *TweenContainer; // x0
__int64 m_left; // x19
std::map,FMODSoundTween> *v6; // x22
std::_rb_tree_base *p_m_header; // x21
int v8; // w3
float v9; // s1
int v10; // w1
float v11; // s0
int v12; // w2
float v13; // s2
float v14; // s0
__int64 v15; // x2
__int64 v16; // x0
void *v17; // x0
for ( i = SFXChannel; i != (MusicChannel|SFXGroup); ++i )
{
TweenContainer = FMODAudioEngine::getTweenContainer(a1, i);
m_left = (__int64)TweenContainer->m_header.m_left;
v6 = TweenContainer;
p_m_header = &TweenContainer->m_header;
while ( p_m_header != (std::_rb_tree_base *)m_left )
{
while ( 1 )
{
v8 = *(_DWORD *)(m_left + 36);
v9 = a1->m_audioState.m_interval + *(float *)(m_left + 40);
v10 = *(_DWORD *)(m_left + 32);
v11 = v9 / *(float *)(m_left + 44);
*(float *)(m_left + 40) = v9;
if ( v11 < 1.0 )
{
if ( v11 > 0.0 )
{
v12 = v11 == 1.0;
}
else
{
v12 = 0;
v11 = 0.0;
}
}
else
{
v12 = 1;
v11 = 1.0;
}
v13 = *(float *)(m_left + 48);
*(_BYTE *)(m_left + 60) = v12;
v14 = v13 + (float)((float)(*(float *)(m_left + 52) - v13) * v11);
*(float *)(m_left + 56) = v14;
if ( v8 )
{
if ( v8 == 1 )
{
FMODAudioEngine::setChannelPitch(a1, v10, i, v14);
v12 = *(unsigned __int8 *)(m_left + 60);
}
}
else
{
FMODAudioEngine::setChannelVolume(a1, v10, i, v14);
v12 = *(unsigned __int8 *)(m_left + 60);
}
if ( v12 )
break;
m_left = sub_CFAB14(m_left);
if ( p_m_header == (std::_rb_tree_base *)m_left )
goto LABEL_11;
}
v15 = sub_CFAB14(m_left);
v16 = m_left;
m_left = v15;
v17 = (void *)sub_CFAF34(v16, p_m_header);
operator delete(v17);
--v6->m_nodecount;
}
LABEL_11:
;
}
}