//
// AnimatedGameObject::playAnimation from 0x100199190 to 0x1001992a8 (280 bytes)
//
// 3 xrefs:
// > PlayLayer::loadFromCheckpoint @ 0x10008b368
// > PlayLayer::loadActiveSaveObjects @ 0x10008b7d8
// > GJBaseGameLayer::playAnimationCommand @ 0x100108235
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:25:56 +0000
//
void __fastcall AnimatedGameObject::playAnimation(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
void **p_data; // rax
std::string v4; // [rsp+0h] [rbp-60h] BYREF
std::string v5; // [rsp+20h] [rbp-40h] BYREF
std::string __str; // [rsp+38h] [rbp-28h] BYREF
AnimatedGameObject::animationForID(&__str, a2, *(unsigned int *)(a1 + 1028));
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;
}
*(_DWORD *)(a1 + 1524) = a2;
std::string::operator=((std::string *)(a1 + 1496), &__str);
*(_BYTE *)(a1 + 1489) = 1;
v2 = *(_QWORD *)(a1 + 1464);
if ( *(_BYTE *)(a1 + 773) == 1 )
{
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v4, __str.__r_.__value_.__l.__data_, __str.__r_.__value_.__l.__size_);
else
v4 = __str;
CCAnimatedSprite::tweenToAnimation(v2, &v4, 0.050000001);
if ( (*(_BYTE *)&v4.__r_.__value_.__s.0 & 1) != 0 )
{
p_data = (void **)&v4.__r_.__value_.__l.__data_;
LABEL_16:
operator delete(*p_data);
}
}
else
{
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v5, __str.__r_.__value_.__l.__data_, __str.__r_.__value_.__l.__size_);
else
v5 = __str;
CCAnimatedSprite::runAnimationForced(v2, &v5);
if ( (*(_BYTE *)&v5.__r_.__value_.__s.0 & 1) != 0 )
{
p_data = (void **)&v5.__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_);
}