//
// AnimatedGameObject::playAnimation from 0x1001b8b20 to 0x1001b8c38 (280 bytes)
//
// 3 xrefs:
// > PlayLayer::loadFromCheckpoint @ 0x1000bd718
// > PlayLayer::loadActiveSaveObjects @ 0x1000bdac8
// > GJBaseGameLayer::playAnimationCommand @ 0x10012a285
//
// 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::playAnimation(AnimatedGameObject *a1, int a2)
{
double v2; // xmm0_8
CCAnimatedSprite *m_animatedSprite; // rbx
void **p_data; // rax
std::string v5; // [rsp+0h] [rbp-60h] BYREF
std::string v6; // [rsp+20h] [rbp-40h] BYREF
std::string __str; // [rsp+38h] [rbp-28h] BYREF
AnimatedGameObject::animationForID(&__str, a2, (unsigned int)a1->m_objectID);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
{
if ( !__str.__r_.__value_.__l.__size_ )
goto LABEL_17;
}
else if ( !(*(_BYTE *)&__str.__r_.__value_.__l.0 >> 1) )
{
goto LABEL_17;
}
a1->m_animationID = a2;
std::string::operator=((std::string *)&a1->m_currentAnimation, &__str);
a1->m_playingAnimation = 1;
m_animatedSprite = a1->m_animatedSprite;
if ( a1->m_isActivated )
{
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
sub_100006B70(&v5, __str.__r_.__value_.__l.__data_, __str.__r_.__value_.__l.__size_, v2);
else
v5 = __str;
CCAnimatedSprite::tweenToAnimation(m_animatedSprite, &v5, 0.050000001);
if ( (*(_BYTE *)&v5.__r_.__value_.__s.0 & 1) != 0 )
{
p_data = (void **)&v5.__r_.__value_.__l.__data_;
LABEL_16:
operator delete(*p_data);
}
}
else
{
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
sub_100006B70(&v6, __str.__r_.__value_.__l.__data_, __str.__r_.__value_.__l.__size_, v2);
else
v6 = __str;
CCAnimatedSprite::runAnimationForced(m_animatedSprite, &v6);
if ( (*(_BYTE *)&v6.__r_.__value_.__s.0 & 1) != 0 )
{
p_data = (void **)&v6.__r_.__value_.__l.__data_;
goto LABEL_16;
}
}
LABEL_17:
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}