//
// SmartGameObject::updateSmartFrame from 0x4f5cf4 to 0x4f5dc6 (210 bytes)
//
// 5 xrefs:
// > EditorUI::createPrefab @ 0x48719a
// > EditorUI::createSmartObjectsFromTemplate @ 0x4880aa
// > SmartGameObject::customObjectSetup @ 0x4f5e16
// > SetupSmartBlockLayer::onClose @ 0x672612
// > SetupSmartBlockLayer::onClose @ 0x672638
//
// 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:51:16 +0000
//
int __fastcall SmartGameObject::updateSmartFrame(int this)
{
int v1; // r4
int v2; // r2
char *v3; // r5
size_t v4; // r0
_BOOL4 v5; // r9
int *v6; // r0
int (__fastcall *v7)(int, int); // r5
cocos2d::CCSpriteFrameCache *v8; // r0
const char *v9; // r1
int v10; // r0
int v11[3]; // [sp+0h] [bp-14h] BYREF
v1 = this;
v2 = *(_DWORD *)(this + 892);
switch ( v2 )
{
case 2896:
if ( *(_BYTE *)(this + 1167) )
v3 = "smartBlock02b_001.png";
else
v3 = "smartBlock02_001.png";
break;
case 2897:
if ( *(_BYTE *)(this + 1167) )
v3 = "smartBlock03b_001.png";
else
v3 = "smartBlock03_001.png";
break;
case 2895:
if ( *(_BYTE *)(this + 1167) )
v3 = "smartBlock01b_001.png";
else
v3 = "smartBlock01_001.png";
break;
default:
return this;
}
memset(v11, 0, sizeof(v11));
v4 = strlen(v3);
std::string::__init(v11, v3, v4);
v5 = sub_4E6580((unsigned __int8 *)(v1 + 1180), (unsigned __int8 *)v11);
this = std::string::~string((int)v11);
if ( !v5 )
{
v6 = std::string::assign((int *)(v1 + 1180), v3);
v7 = *(int (__fastcall **)(int, int))(*(_DWORD *)v1 + 580);
v8 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache((cocos2d::CCSpriteFrameCache *)v6);
if ( (*(_BYTE *)(v1 + 1180) & 1) != 0 )
v9 = *(const char **)(v1 + 1188);
else
v9 = (const char *)(v1 + 1181);
v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v8, v9);
return v7(v1, v10);
}
return this;
}