//
// AnimatedGameObject::updateObjectAnimation from 0x1404a38a0 to 0x1404a3b0c (620 bytes)
//
// 4 xrefs:
// > EditorPauseLayer::togglePreviewAnim @ 0x1400dd23e
// > AnimatedGameObject::activateObject @ 0x1404a3bc6
// > AnimatedGameObject::resetObject @ 0x1404a536a
// > ??> @ 0x1406dc7e8
//
// 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=3
void AnimatedGameObject::updateObjectAnimation(AnimatedGameObject *a1)
{
SpriteAnimationManager *m_animationManager; // rdi
cocos2d::CCNode *m_paSprite; // rcx
cocos2d::CCNode *m_fbfSprite; // rcx
__int64 v5; // rax
_QWORD *v6; // rax
char v7; // di
SpriteAnimationManager *v8; // rbx
struct cocos2d::CCAction *ActionByTag; // rax
struct cocos2d::CCAction *v10; // rbx
void *v11; // [rsp+28h] [rbp-90h]
__int128 v12; // [rsp+30h] [rbp-88h] BYREF
__int128 v13; // [rsp+40h] [rbp-78h]
_QWORD v14[4]; // [rsp+50h] [rbp-68h] BYREF
_BYTE v15[32]; // [rsp+70h] [rbp-48h] BYREF
m_animationManager = a1->m_animatedSprite->m_animationManager;
SpriteAnimationManager::overridePrio(m_animationManager);
m_paSprite = m_animationManager->m_sprite->m_paSprite;
if ( m_paSprite )
cocos2d::CCNode::stopAllActions(m_paSprite);
m_fbfSprite = m_animationManager->m_sprite->m_fbfSprite;
if ( m_fbfSprite )
cocos2d::CCNode::stopAllActions(m_fbfSprite);
if ( a1->m_isActivated )
{
if ( !a1->m_editorEnabled )
goto LABEL_24;
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v11 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
if ( *(_BYTE *)(*(_QWORD *)(v5 + 528) + 14260LL) )
{
LABEL_24:
if ( a1->m_playingAnimation )
{
if ( a1->m_currentAnimation.m_data.m_size )
{
v6 = (_QWORD *)sub_14003BDB0((__int64)v15, (__int64)&a1->m_currentAnimation);
v7 = 2;
}
else
{
sub_14003BDB0((__int64)v14, (__int64)&a1->m_animatedSprite->m_currentAnim);
v6 = v14;
v7 = 9;
}
v12 = 0;
v13 = 0u;
v12 = *(_OWORD *)v6;
v13 = *((_OWORD *)v6 + 1);
v6[2] = 0;
v6[3] = 15;
*(_BYTE *)v6 = 0;
SpriteAnimationManager::runAnimation((__int64)a1->m_animatedSprite->m_animationManager, &v12);
if ( (v7 & 2) != 0 )
{
v7 &= ~2u;
sub_14003A830((__int64)v15);
}
if ( (v7 & 1) != 0 )
sub_14003A830((__int64)v14);
}
else
{
sub_14003BDB0((__int64)v14, (__int64)&a1->m_animatedSprite->m_currentAnim);
SpriteAnimationManager::runAnimation((__int64)a1->m_animatedSprite->m_animationManager, v14);
v8 = a1->m_animatedSprite->m_animationManager;
rand();
ActionByTag = cocos2d::CCNode::getActionByTag(v8->m_sprite->m_sprite, 1);
v10 = ActionByTag;
if ( ActionByTag )
{
if ( LOBYTE(ActionByTag[1].m_nLuaID) )
((void (__fastcall *)(struct cocos2d::CCAction *))ActionByTag->step)(ActionByTag);
((void (__fastcall *)(struct cocos2d::CCAction *))v10->step)(v10);
}
}
}
}
}