//
// ColorAction::step from 0x1002d9930 to 0x1002d9a32 (258 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::runColorEffect @ 0x1000efdb7
// > LevelEditorLayer::stopTriggersInGroup @ 0x1000f00be
// > GJBaseGameLayer::updateColor @ 0x10013c9a2
//
// 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 ColorAction::step(ColorAction *a1, float a2)
{
float v2; // xmm2_4
float v3; // xmm2_4
float m_duration; // xmm3_4
float v5; // xmm0_4
float m_fromOpacity; // xmm1_4
float v7; // [rsp-14h] [rbp-14h]
if ( !a1->m_stepFinished && !a1->m_paused )
{
v2 = a2 + a1->m_deltaTime;
a1->m_deltaTime = v2;
v3 = v2 + a1->m_stepInterval;
m_duration = a1->m_duration;
if ( v3 < m_duration )
{
if ( v3 <= 0.0 )
{
LABEL_9:
a1->m_color = a1->m_fromColor;
m_fromOpacity = a1->m_fromOpacity;
goto LABEL_10;
}
v5 = v3 / m_duration;
if ( (float)(v3 / m_duration) < 1.0 )
{
if ( v5 > 0.0 )
{
v7 = v3 / m_duration;
a1->m_color = GameToolbox::multipliedColorValue(
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a1->m_fromColor.r | (a1->m_fromColor.b << 16)),
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a1->m_toColor.r | (a1->m_toColor.b << 16)),
v5);
m_duration = a1->m_duration;
a1->m_currentOpacity = (float)((float)(a1->m_toOpacity - a1->m_fromOpacity) * v7) + a1->m_fromOpacity;
LABEL_11:
a1->m_stepFinished = v3 >= m_duration;
return;
}
goto LABEL_9;
}
}
a1->m_color = a1->m_toColor;
m_fromOpacity = a1->m_toOpacity;
LABEL_10:
a1->m_currentOpacity = m_fromOpacity;
goto LABEL_11;
}
}