//
// GJSmartBlockPreview::create from 0x100415460 to 0x100415549 (233 bytes)
//
// 2 xrefs:
// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1004e454e
// > BrowseSmartKeyLayer::init @ 0x1004e5b09
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:30:11 +0000
//
char *__fastcall GJSmartBlockPreview::create(std::string *a1)
{
char *v1; // rbx
char v2; // r14
float v4; // [rsp+8h] [rbp-38h] BYREF
std::string __str; // [rsp+10h] [rbp-30h] BYREF
v1 = (char *)operator new(0x170u);
cocos2d::CCNode::CCNode((__int64)v1);
*(_QWORD *)v1 = off_100B3E980;
*((_OWORD *)v1 + 20) = 0;
*((_OWORD *)v1 + 21) = 0;
*(_OWORD *)(v1 + 345) = 0;
if ( (*(_BYTE *)&a1->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&__str, a1->__r_.__value_.__l.__data_, a1->__r_.__value_.__l.__size_);
else
__str = *a1;
v2 = cocos2d::CCNode::init();
if ( v2 )
{
sub_100278260(&v4, 90.0, 90.0);
(*(void (__fastcall **)(char *, float *))(*(_QWORD *)v1 + 320LL))(v1, &v4);
std::string::operator=((std::string *)(v1 + 320), &__str);
}
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( v2 )
{
cocos2d::CCObject::autorelease(v1);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v1 + 16LL))(v1);
return nullptr;
}
return v1;
}