//
// AnimatedGameObject::updateObjectAnimation from 0x100383cbc to 0x100383e14 (344 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::updatePreviewAnim @ 0x1003640e0
// > AnimatedGameObject::activateObject @ 0x100383e88
// > AnimatedGameObject::resetObject @ 0x100384f3c
//
// 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 AnimatedGameObject::updateObjectAnimation(AnimatedGameObject *a1)
{
CCAnimatedSprite *m_animatedSprite; // x8
__int64 m_animationManager; // x19
std::string *p_m_currentAnimation; // x9
char *longStorage; // x8
std::string *v6; // x8
std::size_t size; // x2
void *capacitym1; // x1
SpriteAnimationManager *v9; // x19
unsigned int v10; // w0
std::string *p_m_currentAnim; // x8
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
char *v13; // [xsp+10h] [xbp-40h]
void *__dst[2]; // [xsp+20h] [xbp-30h] BYREF
char *v15; // [xsp+30h] [xbp-20h]
SpriteAnimationManager::stopAnimations(a1->m_animatedSprite->m_animationManager);
if ( a1->m_isActivated
&& (!a1->m_editorEnabled || GameManager::sharedState()->m_levelEditorLayer->m_previewAnimations) )
{
m_animatedSprite = a1->m_animatedSprite;
m_animationManager = (__int64)m_animatedSprite->m_animationManager;
if ( a1->m_playingAnimation )
{
p_m_currentAnimation = &a1->m_currentAnimation;
if ( a1->m_currentAnimation.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
size = a1->m_currentAnimation.m_data.m_long.size;
if ( size )
{
capacitym1 = (void *)p_m_currentAnimation->m_data.m_long.capacitym1;
goto LABEL_20;
}
}
else if ( a1->m_currentAnimation.m_data.m_short.shortStorage.__elems_[22] )
{
*(_OWORD *)__dst = *(_OWORD *)&p_m_currentAnimation->m_data.m_short.sizex2;
longStorage = a1->m_currentAnimation.m_data.m_long.longStorage;
LABEL_18:
v15 = longStorage;
goto LABEL_21;
}
if ( (m_animatedSprite->m_currentAnim.m_data.m_short.shortStorage.__elems_[22] & 0x80000000) == 0 )
{
p_m_currentAnim = &m_animatedSprite->m_currentAnim;
*(_OWORD *)__dst = *(_OWORD *)&p_m_currentAnim->m_data.m_short.sizex2;
longStorage = p_m_currentAnim->m_data.m_long.longStorage;
goto LABEL_18;
}
capacitym1 = (void *)m_animatedSprite->m_currentAnim.m_data.m_long.capacitym1;
size = m_animatedSprite->m_currentAnim.m_data.m_long.size;
LABEL_20:
sub_1000097D0(__dst, capacitym1, size);
LABEL_21:
SpriteAnimationManager::runAnimation(m_animationManager, (__int128 *)__dst);
if ( SHIBYTE(v15) < 0 )
operator delete(__dst[0]);
return;
}
if ( m_animatedSprite->m_currentAnim.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(
__p,
(void *)m_animatedSprite->m_currentAnim.m_data.m_long.capacitym1,
m_animatedSprite->m_currentAnim.m_data.m_long.size);
}
else
{
v6 = &m_animatedSprite->m_currentAnim;
*(_OWORD *)__p = *(_OWORD *)&v6->m_data.m_short.sizex2;
v13 = v6->m_data.m_long.longStorage;
}
SpriteAnimationManager::runAnimation(m_animationManager, (__int128 *)__p);
if ( SHIBYTE(v13) < 0 )
operator delete(__p[0]);
v9 = a1->m_animatedSprite->m_animationManager;
v10 = rand();
SpriteAnimationManager::offsetCurrentAnimation(v9, vcvts_n_f32_s32(v10, 0x1Fu));
}
}