//
// GJSmartBlockPreview::addPreview from 0x66f59c to 0x66f69a (254 bytes)
//
// 2 xrefs:
// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x673c2a
// > BrowseSmartKeyLayer::init @ 0x674de6
//
// 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:55:49 +0000
//
cocos2d::CCArray *__fastcall GJSmartBlockPreview::addPreview(
cocos2d::CCArray *result,
unsigned __int8 *a2,
unsigned __int8 *a3,
LevelEditorLayer *a4)
{
cocos2d::CCArray *v6; // r5
int v8; // r3
int v9; // r3
cocos2d::CCArray *v10; // r0
int v11; // r11
cocos2d::CCArray *v12; // r9
int v13; // r10
int v14; // r6
float v15; // s16
int v16; // r0
_BYTE v17[8]; // [sp+10h] [bp-2Ch] BYREF
_BYTE v18[8]; // [sp+18h] [bp-24h] BYREF
_BYTE v19[8]; // [sp+20h] [bp-1Ch] BYREF
int v20[3]; // [sp+28h] [bp-14h] BYREF
v6 = result;
v8 = *a3;
if ( (v8 & 1) != 0 )
v9 = *((_DWORD *)a3 + 1);
else
v9 = v8 >> 1;
if ( v9 )
{
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(result);
v11 = *((_DWORD *)a4 + 2964);
v12 = v10;
std::string::basic_string(v20, (int)a3);
v13 = EditorUI::spriteFromObjectString(v11, v20, 0, 0, 0, v12, 0, 0);
std::string::~string((int)v20);
(*(void (__fastcall **)(cocos2d::CCArray *, int, int))(*(_DWORD *)v6 + 232))(v6, v13, 10);
v14 = *std::string::at(a2, 0);
v15 = *(float *)(*(int (__fastcall **)(cocos2d::CCArray *))(*(_DWORD *)v6 + 164))(v6);
v16 = (*(int (__fastcall **)(cocos2d::CCArray *))(*(_DWORD *)v6 + 164))(v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, v15 * 0.5, *(float *)(v16 + 4) * 0.5);
GJSmartTemplate::offsetForType((cocos2d::CCPoint *)v19, v14);
cocos2d::CCPoint::operator+(v17, v18, v19);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 92))(v13, v17);
return (cocos2d::CCArray *)LevelEditorLayer::updateObjectColors(a4, v12);
}
return result;
}