//
// GJSmartBlockPreview::addPreview from 0x53b73c to 0x53b838 (252 bytes)
//
// 2 xrefs:
// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x53eac8
// > BrowseSmartKeyLayer::init @ 0x53f402
//
// 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 GJSmartBlockPreview::addPreview(cocos2d::CCArray *a1, int a2, _DWORD *a3, LevelEditorLayer *a4)
{
cocos2d::CCArray *v7; // r0
EditorUI *m_editorUI; // r11
cocos2d::CCArray *v9; // r7
cocos2d::CCSprite *v10; // r10
SmartBlockType v11; // r9
float v12; // s16
int v13; // r0
cocos2d::CCPoint v14; // [sp+14h] [bp-20h] BYREF
cocos2d::CCPoint v15; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v16; // [sp+24h] [bp-10h] BYREF
if ( *(_DWORD *)(*a3 - 12) )
{
v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
m_editorUI = a4->m_editorUI;
v9 = v7;
sub_775C20(&v16);
v10 = EditorUI::spriteFromObjectString(m_editorUI, &v16, 0.0, 0, 0, (bool)v9, nullptr, 0);
sub_774008(&v16);
((void (__fastcall *)(cocos2d::CCArray *, cocos2d::CCSprite *, int))a1->__vftable[5].encodeWithCoder)(a1, v10, 10);
v11 = *(unsigned __int8 *)sub_7757BC(a2, 0);
v12 = *(float *)((int (__fastcall *)(cocos2d::CCArray *))a1->__vftable[3].setTag)(a1);
v13 = ((int (__fastcall *)(cocos2d::CCArray *))a1->__vftable[3].setTag)(a1);
cocos2d::CCPoint::CCPoint(&v15, v12 * 0.5, *(float *)(v13 + 4) * 0.5);
GJSmartTemplate::offsetForType(&v16, v11);
cocos2d::CCPoint::operator+(&v14, &v15, &v16);
v10->setPosition(v10, &v14);
LevelEditorLayer::updateObjectColors(a4, v9);
}
}