//
// SpriteAnimationManager::runAnimation from 0x2f386c to 0x2f392e (194 bytes)
//
// 7 xrefs:
// > CCAnimatedSprite::loadType @ 0x2e402c
// > CCAnimatedSprite::runAnimation @ 0x2e42dc
// > CCAnimatedSprite::runAnimationForced @ 0x2e4386
// > AnimatedGameObject::updateObjectAnimation @ 0x3e7f80
// > AnimatedGameObject::updateObjectAnimation @ 0x3e7f9e
// > GJMapObject::startMonsterJumpLoop @ 0x50e26e
// > GJMapObject::createMonster @ 0x50e3fe
//
// 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
//
int __fastcall SpriteAnimationManager::runAnimation(
int a1,
int a2,
stl::StringData::Internal *a3,
stl::StringData::Internal *a4)
{
int result; // r0
int Prio; // r10
int v8; // r9
stl::StringData::Internal *v9; // r2
stl::StringData::Internal *v10; // r3
std::string v11[2]; // [sp+8h] [bp-8h] BYREF
v11[0].m_data.m_data = a3;
v11[1].m_data.m_data = a4;
result = sub_774DBC(a1 + 296, a2);
if ( result )
{
sub_775C20(v11, a2);
Prio = SpriteAnimationManager::getPrio(a1, v11);
sub_774008(v11);
sub_776584((int)v11, *(char **)(a1 + 296));
v8 = SpriteAnimationManager::getPrio(a1, v11);
sub_774008(v11);
if ( Prio > v8 )
{
sub_775C20(v11, a2);
SpriteAnimationManager::queueAnimation(a1, (int)v11);
}
else
{
sub_776584((int)v11, *(char **)(a1 + 296));
SpriteAnimationManager::queueAnimation(a1, (int)v11);
sub_774008(v11);
sub_775C20(v11, a2);
SpriteAnimationManager::executeAnimation(a1, v11, v9, v10);
}
return sub_774008(v11);
}
return result;
}