//
// SpriteAnimationManager::runAnimation from 0x3d8560 to 0x3d8662 (258 bytes)
//
// 7 xrefs:
// > CCAnimatedSprite::runAnimation @ 0x3c36b4
// > CCAnimatedSprite::runAnimationForced @ 0x3c3708
// > CCAnimatedSprite::loadType @ 0x3c3b54
// > AnimatedGameObject::updateObjectAnimation @ 0x4ec538
// > AnimatedGameObject::updateObjectAnimation @ 0x4ec556
// > GJMapObject::createMonster @ 0x63fe36
// > GJMapObject::startMonsterJumpLoop @ 0x63ffde
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:46:45 +0000
//
int __fastcall SpriteAnimationManager::runAnimation(int a1, unsigned __int8 *a2)
{
const char *v2; // r8
int result; // r0
int Prio; // r9
bool v7; // nf
size_t v8; // r0
const char *v9; // r8
bool v10; // nf
size_t v11; // r0
int v12; // r2
int v13; // r3
int v14; // [sp+0h] [bp-14h] BYREF
int v15; // [sp+4h] [bp-10h]
int v16; // [sp+8h] [bp-Ch]
result = sub_3D7D88((unsigned __int8 *)(a1 + 304), a2);
if ( !result )
{
std::string::basic_string(&v14, (int)a2);
Prio = SpriteAnimationManager::getPrio(a1, (int)&v14);
std::string::~string((int)&v14);
v7 = (*(_BYTE *)(a1 + 304) & 1) != 0;
if ( (*(_BYTE *)(a1 + 304) & 1) == 0 )
v2 = (const char *)(a1 + 305);
v14 = 0;
if ( v7 )
v2 = *(const char **)(a1 + 312);
v15 = 0;
v16 = 0;
v8 = strlen(v2);
std::string::__init(&v14, v2, v8);
v9 = (const char *)SpriteAnimationManager::getPrio(a1, (int)&v14);
std::string::~string((int)&v14);
if ( Prio > (int)v9 )
{
std::string::basic_string(&v14, (int)a2);
SpriteAnimationManager::queueAnimation(a1, (unsigned __int8 *)&v14);
}
else
{
v10 = (*(_BYTE *)(a1 + 304) & 1) != 0;
if ( (*(_BYTE *)(a1 + 304) & 1) == 0 )
v9 = (const char *)(a1 + 305);
v14 = 0;
if ( v10 )
v9 = *(const char **)(a1 + 312);
v15 = 0;
v16 = 0;
v11 = strlen(v9);
std::string::__init(&v14, v9, v11);
SpriteAnimationManager::queueAnimation(a1, (unsigned __int8 *)&v14);
std::string::~string((int)&v14);
std::string::basic_string(&v14, (int)a2);
SpriteAnimationManager::executeAnimation(a1, (int)&v14, v12, v13);
}
return std::string::~string((int)&v14);
}
return result;
}