//
// EditorUI::spriteFromObjectString from 0x1401f0860 to 0x1401f115d (2301 bytes)
//
// 4 xrefs:
// > EditorUI::menuItemFromObjectString @ 0x1401f11d5
// > GJSmartBlockPreview::addPreview @ 0x1403bcbf5
// > KeyframeGameObject::updateShadowObjects @ 0x14065699b
// > ??> @ 0x14091a9a8
//
// 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 11:28:07 +0000
//
// Hidden C++ exception states: #wind=7
__int64 __fastcall EditorUI::spriteFromObjectString(
__int64 a1,
__int64 a2,
unsigned __int8 a3,
char a4,
int a5,
cocos2d::CCArray *a6,
cocos2d::CCArray *a7,
__int64 a8)
{
unsigned __int8 v9; // r15
__int64 v11; // r12
__int64 v12; // r9
__int64 v13; // r8
cocos2d::CCArray *ObjectsFromString; // rax
cocos2d::CCArray *v15; // rbp
__int64 v16; // r13
unsigned int v17; // r14d
unsigned int v18; // esi
__int64 v19; // rbx
struct cocos2d::CCObject *v20; // r15
struct cocos2d::CCObject *v21; // rdi
unsigned int *v22; // rdx
unsigned int v23; // ecx
__int64 v24; // rdx
__int64 v25; // rcx
__int64 v26; // r9
int v27; // eax
__int64 ColorAction; // rbx
unsigned int *v29; // rdx
unsigned int v30; // eax
__int64 v31; // rdx
__int64 v32; // rbx
__int64 v33; // rax
unsigned int v34; // esi
struct cocos2d::CCObject *v35; // rax
struct cocos2d::CCObject *v36; // rdi
__int64 v37; // rax
cocos2d::CCArray *v38; // rax
__int64 v39; // rbx
__int64 v40; // rdx
struct cocos2d::CCObject *Object; // rax
__int64 v42; // rdx
struct cocos2d::CCObject *v43; // rbx
__int64 v44; // rdi
float v45; // xmm13_4
float v46; // xmm11_4
float v47; // xmm12_4
float v48; // xmm10_4
unsigned int v49; // r13d
__int64 v50; // rbx
__int64 v51; // rdi
struct cocos2d::CCObject *v52; // rax
__int64 v53; // rdx
struct cocos2d::CCObject *v54; // r15
__int64 v55; // rsi
__int64 v56; // rax
int v57; // ecx
int v58; // eax
__int64 v59; // r8
char shouldBlendColor; // cl
int *v61; // rdx
int v62; // eax
char v63; // al
char v64; // al
__int64 v65; // rdx
__int64 v66; // rcx
void (__fastcall ***v67)(_QWORD, __int64); // rcx
__int64 v68; // rdx
char v69; // al
int v70; // r13d
__int64 *v71; // r14
__int64 v72; // rsi
__int64 *v73; // r14
__int64 v74; // rsi
__int64 *v75; // r14
__int64 v76; // rsi
__int64 *v77; // r14
__int64 v78; // rsi
__int64 v79; // rax
__int64 v80; // rsi
const struct cocos2d::CCPoint *v81; // rax
__int64 v82; // rax
cocos2d::CCRect *v83; // rsi
float MinX; // xmm6_4
float MaxX; // xmm7_4
float MinY; // xmm8_4
float MaxY; // xmm0_4
__int64 v88; // rsi
__int64 v89; // rbx
__int64 v90; // rax
struct cocos2d::CCObject *v91; // rdi
__int64 v92; // rbx
__int64 v93; // rax
__int64 v94; // rax
__int64 v95; // rdx
unsigned int v98; // [rsp+24h] [rbp-104h] BYREF
__int64 v99; // [rsp+28h] [rbp-100h] BYREF
__int64 v100; // [rsp+30h] [rbp-F8h] BYREF
__int64 v101; // [rsp+38h] [rbp-F0h] BYREF
__int64 v102; // [rsp+40h] [rbp-E8h]
cocos2d::CCArray *v103; // [rsp+48h] [rbp-E0h] BYREF
char v104[8]; // [rsp+50h] [rbp-D8h] BYREF
__int64 v105; // [rsp+58h] [rbp-D0h]
__int64 v106; // [rsp+60h] [rbp-C8h]
v9 = a3;
v105 = a2;
v11 = a1;
v101 = a1;
v106 = a2;
v103 = a6;
v100 = (__int64)a7;
v102 = cocos2d::CCSprite::create();
LOBYTE(v12) = 1;
ObjectsFromString = (cocos2d::CCArray *)LevelEditorLayer::createObjectsFromString(
*(_QWORD *)(v11 + 1512),
a2,
v13,
v12);
v15 = ObjectsFromString;
v16 = *(_QWORD *)(*(_QWORD *)(v11 + 1512) + 3528LL);
v17 = 0;
if ( a4 )
{
if ( a7 )
{
v18 = 0;
if ( cocos2d::CCArray::count(ObjectsFromString) )
{
v19 = a8;
do
{
if ( v18 >= cocos2d::CCArray::count(a7) )
break;
v20 = cocos2d::CCArray::objectAtIndex(a7, v18);
v21 = cocos2d::CCArray::objectAtIndex(v15, v18);
v22 = *((unsigned int **)v21 + 138);
if ( v22 )
{
v23 = v22[1];
v24 = *v22;
if ( v23 == (_DWORD)v24 || !(_DWORD)v24 )
v24 = v23;
v25 = *(_QWORD *)(v16 + 320);
v26 = v25;
v27 = v24;
if ( (int)v24 < 0 )
v27 = 0;
if ( v27 > 1101 )
v27 = 1101;
}
else
{
v24 = 0;
v25 = *(_QWORD *)(v16 + 320);
v26 = v25;
v27 = 0;
}
if ( *(_QWORD *)(*(_QWORD *)(v26 + 736) + 8LL * v27) )
{
ColorAction = GJEffectManager::getColorAction(v25, v24);
LOWORD(v98) = *(_WORD *)(ColorAction + 72);
BYTE2(v98) = *(_BYTE *)(ColorAction + 74);
(*(void (__fastcall **)(struct cocos2d::CCObject *, unsigned int *))(*(_QWORD *)v21 + 1432LL))(v21, &v98);
*(_DWORD *)(*((_QWORD *)v21 + 138) + 8LL) = *(_DWORD *)(ColorAction + 96);
v19 = a8;
}
if ( *((_QWORD *)v20 + 112) )
{
v29 = *((unsigned int **)v21 + 139);
if ( v29 )
{
v30 = v29[1];
v31 = *v29;
if ( v30 == (_DWORD)v31 || !(_DWORD)v31 )
v31 = v30;
}
else
{
v31 = 0;
}
v32 = GJEffectManager::getColorAction(*(_QWORD *)(v16 + 320), v31);
LOWORD(v99) = *(_WORD *)(v32 + 72);
BYTE2(v99) = *(_BYTE *)(v32 + 74);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64 *))(*(_QWORD *)v21 + 1440LL))(v21, &v99);
*(_DWORD *)(*((_QWORD *)v21 + 139) + 8LL) = *(_DWORD *)(v32 + 96);
v19 = a8;
}
LOBYTE(v24) = -1;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v21 + 40) + 40LL))((__int64)v21 + 320, v24);
if ( v19 )
*((_BYTE *)v21 + 1158) = v20 == (struct cocos2d::CCObject *)v19;
++v18;
}
while ( v18 < cocos2d::CCArray::count(v15) );
v11 = v101;
v9 = a3;
}
}
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 1000.0, 1000.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v101, (const struct cocos2d::CCPoint *)v104);
EditorUI::repositionObjectsToCenter(v11, v15, v33, v9);
EditorUI::deleteSmartBlocksFromObjects(v11, v15);
v34 = 0;
while ( v34 < cocos2d::CCArray::count(v15) )
{
v35 = cocos2d::CCArray::objectAtIndex(v15, v34);
v36 = v35;
if ( *((_DWORD *)v35 + 259) == 2065 )
{
v37 = *((int *)v35 + 220);
if ( (int)v37 > 0 )
{
v38 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(*(_QWORD *)(v11 + 1512) + 4256LL), v37);
if ( v38 )
cocos2d::CCArray::removeObject(v38, v36, 1);
}
*((_BYTE *)v36 + 1140) = *((_BYTE *)v36 + 1141);
EditorUI::deselectObject(v11, (__int64)v36);
v39 = *(_QWORD *)(v11 + 1512);
LOBYTE(v40) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v36 + 1160LL))(v36, v40);
GJBaseGameLayer::removeObjectFromSection(v39, v36);
LevelEditorLayer::removeSpecial(v39, v36);
*(_BYTE *)(v39 + 15666) = 1;
EditorUI::deactivateRotationControl(v11);
EditorUI::deactivateScaleControl(v11);
EditorUI::deactivateTransformControl(v11);
cocos2d::CCArray::removeObjectAtIndex(v15, v34, 1);
}
else
{
++v34;
}
}
if ( a5 > 0 && cocos2d::CCArray::count(v15) > a5 )
{
do
{
Object = cocos2d::CCArray::lastObject(v15);
v43 = Object;
v44 = *(_QWORD *)(v11 + 1512);
if ( Object )
{
LOBYTE(v42) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)Object + 1160LL))(Object, v42);
GJBaseGameLayer::removeObjectFromSection(v44, v43);
LevelEditorLayer::removeSpecial(v44, v43);
*(_BYTE *)(v44 + 15666) = 1;
}
cocos2d::CCArray::removeLastObject(v15, 1);
}
while ( cocos2d::CCArray::count(v15) > a5 );
}
v45 = 0.0;
v46 = 0.0;
v47 = 0.0;
v48 = 0.0;
v99 = 0x30300000001LL;
v100 = 0x100000302LL;
v49 = 0;
v98 = 0;
if ( cocos2d::CCArray::count(v15) )
{
v50 = v99;
v51 = v100;
do
{
v52 = cocos2d::CCArray::objectAtIndex(v15, v49);
v54 = v52;
v55 = *(_QWORD *)(v11 + 1512);
if ( v52 )
{
LOBYTE(v53) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v52 + 1160LL))(v52, v53);
GJBaseGameLayer::removeObjectFromSection(v55, v54);
LevelEditorLayer::removeSpecial(v55, v54);
*(_BYTE *)(v55 + 15666) = 1;
}
v56 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 200LL))(v54);
cocos2d::CCPoint::operator-(v56, &v101, v104);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64 *))(*(_QWORD *)v54 + 184LL))(v54, &v101);
v57 = *((_DWORD *)v54 + 284);
if ( !v57 )
v57 = *((_DWORD *)v54 + 264);
v58 = *((_DWORD *)v54 + 283);
if ( !v58 )
v58 = *((_DWORD *)v54 + 281);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v102 + 456LL))(
v102,
v54,
(unsigned int)(v57 + 10000 * v58));
if ( v103 )
cocos2d::CCArray::addObject(v103, v54);
LOBYTE(v59) = 1;
shouldBlendColor = GameObject::shouldBlendColor(v54, *((_QWORD *)v54 + 138), v59);
*((_BYTE *)v54 + 892) = shouldBlendColor;
if ( !*((_QWORD *)v54 + 112) )
goto LABEL_60;
v61 = *((int **)v54 + 139);
v62 = *v61;
if ( v61[1] == *v61 || !v62 )
v62 = v61[1];
if ( v62 == 1012 )
{
v63 = shouldBlendColor;
}
else
{
v63 = GameObject::shouldBlendColor(v54, v61, 0);
shouldBlendColor = *((_BYTE *)v54 + 892);
}
if ( v63 )
v64 = 1;
else
LABEL_60:
v64 = 0;
*((_BYTE *)v54 + 893) = v64;
v65 = v51;
if ( !shouldBlendColor )
v65 = v50;
(**((void (__fastcall ***)(__int64, __int64))v54 + 43))((__int64)v54 + 344, v65);
v66 = *((_QWORD *)v54 + 112);
if ( v66 && !*((_BYTE *)v54 + 656) )
{
v67 = (void (__fastcall ***)(_QWORD, __int64))(v66 + 344);
v68 = v51;
if ( !*((_BYTE *)v54 + 893) )
v68 = v50;
(**v67)(v67, v68);
v69 = *((_BYTE *)v54 + 893);
if ( *((_BYTE *)v54 + 892) == v69 )
{
GameObject::addColorSpriteToSelf(v54);
}
else
{
v70 = *((_DWORD *)v54 + 283);
if ( !v70 )
v70 = *((_DWORD *)v54 + 281);
if ( v69 && *((_BYTE *)v54 + 1061) )
++v70;
LODWORD(v99) = *((_DWORD *)v54 + 284);
if ( !(_DWORD)v99 )
LODWORD(v99) = *((_DWORD *)v54 + 264);
*((_BYTE *)v54 + 874) = 0;
v71 = *((__int64 **)v54 + 112);
v72 = *v71;
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 128LL))(v54);
(*(void (__fastcall **)(__int64 *))(v72 + 120))(v71);
v73 = *((__int64 **)v54 + 112);
v74 = *v73;
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 144LL))(v54);
(*(void (__fastcall **)(__int64 *))(v74 + 136))(v73);
v75 = *((__int64 **)v54 + 112);
v76 = *v75;
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 360LL))(v54);
(*(void (__fastcall **)(__int64 *))(v76 + 352))(v75);
v77 = *((__int64 **)v54 + 112);
v78 = *v77;
v79 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 200LL))(v54);
(*(void (__fastcall **)(__int64 *, __int64))(v78 + 184))(v77, v79);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)v54 + 112) + 520LL))(*((_QWORD *)v54 + 112), 0);
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)v102 + 456LL))(
v102,
*((_QWORD *)v54 + 112),
(unsigned int)(v99 + 10000 * v70));
v49 = v98;
}
}
v80 = *(_QWORD *)v54;
v81 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 200LL))(v54);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v81);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v80 + 1216))(v54, v82);
v83 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v54 + 1200LL))(v54);
MinX = cocos2d::CCRect::getMinX(v83);
MaxX = cocos2d::CCRect::getMaxX(v83);
MinY = cocos2d::CCRect::getMinY(v83);
MaxY = cocos2d::CCRect::getMaxY(v83);
if ( v45 == 0.0 || v45 > MinX )
v45 = MinX;
if ( v46 == 0.0 || MaxX > v46 )
v46 = MaxX;
if ( v47 == 0.0 || v47 > MinY )
v47 = MinY;
if ( v48 == 0.0 || MaxY > v48 )
v48 = MaxY;
v98 = ++v49;
}
while ( v49 < cocos2d::CCArray::count(v15) );
v17 = 0;
}
v88 = v102;
v89 = *(_QWORD *)v102;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v103, v46 - v45, v48 - v47);
(*(void (__fastcall **)(__int64, __int64))(v89 + 312))(v88, v90);
if ( cocos2d::CCArray::count(v15) )
{
do
{
v91 = cocos2d::CCArray::objectAtIndex(v15, v17);
v92 = *(_QWORD *)v91;
v93 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v91 + 200LL))(v91);
cocos2d::CCNode::convertToNodeSpace(v88, &v103, v93);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v92 + 184))(v91, v94);
LOBYTE(v95) = *((_BYTE *)v91 + 1302) == 0;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v91 + 336LL))(v91, v95);
++v17;
}
while ( v17 < cocos2d::CCArray::count(v15) );
}
sub_14003D310(v105);
return v88;
}