//
// EnhancedGameObject::setupAnimationVariables from 0x1401a9b70 to 0x1401a9ecc (860 bytes)
//
// 4 xrefs:
// > EnhancedGameObject::saveActiveColors @ 0x1401a4c35
// > SetupAnimSettingsPopup::onClose @ 0x14040ab2c
// > SetupAnimSettingsPopup::onClose @ 0x14040ab62
// > ??> @ 0x1406cc15c
//
// 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=2
void EnhancedGameObject::setupAnimationVariables(EnhancedGameObject *a1)
{
__int64 v2; // rcx
struct cocos2d::CCObject *v3; // rax
int v4; // eax
__int64 v5; // rcx
struct cocos2d::CCObject *v6; // rax
float v7; // xmm0_4
float m_randomFrameTime; // xmm1_4
float m_animationSpeed; // xmm2_4
int m_objectID; // ecx
int v11; // ecx
int v12; // ecx
int v13; // ecx
int v14; // ecx
bool v15; // zf
int v16; // ecx
int v17; // ecx
int v18; // ecx
void *v19; // [rsp+30h] [rbp+8h]
void *v20; // [rsp+30h] [rbp+8h]
if ( a1->m_objectID != 2065 )
{
v2 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v19 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = qword_1406C2ED8;
}
v3 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v2 + 384), a1->m_objectID);
if ( v3 )
v4 = (int)v3[1].__vftable;
else
LOWORD(v4) = 1;
a1->m_frames = v4;
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v20 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
v6 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v5 + 376), a1->m_objectID);
if ( v6 )
v7 = *(float *)&v6[1].__vftable;
else
v7 = 1.0;
a1->m_frameTime = v7;
}
m_randomFrameTime = a1->m_randomFrameTime;
if ( a1->m_animationShouldUseSpeed )
{
m_animationSpeed = a1->m_animationSpeed;
if ( m_animationSpeed != 0.0 )
m_randomFrameTime = fabs(m_animationSpeed);
}
a1->m_frameTime = a1->m_frameTime / m_randomFrameTime;
m_objectID = a1->m_objectID;
if ( m_objectID > 1851 )
{
if ( m_objectID > 2867 )
{
switch ( m_objectID )
{
case 2868:
case 2869:
case 2870:
case 2871:
case 2872:
case 2875:
case 2876:
case 2877:
case 2878:
case 2880:
case 2882:
case 2883:
case 2885:
case 2886:
case 2887:
goto LABEL_33;
default:
goto LABEL_21;
}
}
if ( m_objectID != 2867 )
{
switch ( m_objectID )
{
case 1852:
case 1854:
case 1855:
case 1856:
case 1860:
case 2020:
case 2021:
case 2022:
case 2024:
case 2025:
case 2026:
case 2027:
case 2028:
case 2029:
case 2030:
case 2031:
case 2033:
case 2035:
case 2036:
case 2037:
case 2038:
case 2039:
case 2040:
case 2043:
case 2044:
case 2045:
case 2046:
case 2047:
case 2048:
case 2049:
case 2050:
case 2051:
case 2052:
case 2053:
case 2054:
case 2055:
break;
default:
goto LABEL_21;
}
}
}
else if ( m_objectID != 1851 )
{
v11 = m_objectID - 921;
if ( v11 )
{
v12 = v11 - 598;
if ( v12 )
{
if ( v12 != 99 )
goto LABEL_21;
}
}
}
LABEL_33:
if ( a1->m_disableDelayedLoop )
{
LABEL_21:
a1->m_visible = 0;
a1->m_isDisabled2 = 0;
goto LABEL_22;
}
a1->m_visible = 1;
LABEL_22:
v13 = a1->m_objectID;
if ( v13 == 1855 )
{
a1->m_shouldNotHideAnimFreeze = 1;
}
else
{
a1->m_shouldNotHideAnimFreeze = 0;
if ( v13 <= 1841 )
{
if ( v13 == 1841 )
goto LABEL_40;
v17 = v13 - 1591;
if ( !v17 )
goto LABEL_40;
v18 = v17 - 2;
if ( !v18 )
goto LABEL_40;
v16 = v18 - 246;
v15 = v16 == 0;
goto LABEL_26;
}
}
v14 = v13 - 1842;
if ( !v14 )
goto LABEL_40;
v16 = v14 - 1050;
v15 = v16 == 0;
LABEL_26:
if ( !v15 && v16 != 1 )
{
a1->m_usesSpecialAnimation = 0;
return;
}
LABEL_40:
a1->m_usesSpecialAnimation = 1;
}