//
// EditorUI::spriteFromObjectString from 0x14010de60 to 0x14010e76a (2314 bytes)
//
// 4 xrefs:
// > EditorUI::menuItemFromObjectString @ 0x14010e7df
// > GJSmartBlockPreview::addPreview @ 0x1402b6675
// > KeyframeGameObject::updateShadowObjects @ 0x1404b55c7
// > ??> @ 0x1406c8e08
//
// 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
//
// Hidden C++ exception states: #wind=7
cocos2d::CCNode *__fastcall EditorUI::spriteFromObjectString(
__int64 a1,
__int64 a2,
bool a3,
char a4,
int a5,
cocos2d::CCArray *a6,
cocos2d::CCArray *a7,
__int64 a8)
{
bool v9; // r14
EditorUI *v11; // r13
__int64 v12; // r9
__int64 v13; // r8
cocos2d::CCArray *ObjectsFromString; // rax
cocos2d::CCArray *v15; // r12
LevelSettingsObject *m_levelSettings; // r15
unsigned int v17; // ebp
unsigned int v18; // esi
__int64 v19; // rbx
struct cocos2d::CCObject *v20; // r14
struct cocos2d::CCObject *v21; // rdi
unsigned int *v22; // rdx
unsigned int v23; // ecx
__int64 v24; // rdx
GJEffectManager *m_effectManager; // rcx
GJEffectManager *v26; // r9
int v27; // eax
ColorAction *ColorAction; // rbx
int *v29; // rdx
int v30; // eax
int v31; // edx
ColorAction *v32; // rbx
cocos2d::CCPoint v33; // rax
unsigned int v34; // esi
struct cocos2d::CCObject *v35; // rax
GameObject *v36; // rdi
__int64 m_unknown2; // rax
cocos2d::CCArray *v38; // rax
LevelEditorLayer *m_editorLayer; // rbx
_BOOL8 v40; // rdx
struct cocos2d::CCObject *Object; // rax
__int64 v42; // rdx
GameObject *v43; // rbx
LevelEditorLayer *v44; // rdi
float v45; // xmm13_4
float v46; // xmm11_4
float v47; // xmm12_4
float v48; // xmm10_4
unsigned int v49; // r14d
cocos2d::CCPoint v50; // rbx
cocos2d::CCPoint v51; // rdi
struct cocos2d::CCObject *v52; // rax
__int64 v53; // rdx
struct cocos2d::CCObject *v54; // r15
LevelEditorLayer *v55; // rsi
__int64 v56; // rax
int m_nTag; // ecx
int m_nLuaID; // eax
bool v59; // r8
char shouldBlendColor; // cl
GJSpriteColor *v61; // rdx
int m_defaultColorID; // r8d
int m_colorID; // eax
bool v64; // al
char v65; // al
cocos2d::CCPoint v66; // rdx
cocos2d::CCObject_vtbl *v67; // rcx
void (__fastcall ***p_getTag)(_QWORD, cocos2d::CCPoint); // rcx
cocos2d::CCPoint v69; // rdx
char v70; // cl
int v71; // eax
int m_uOrderOfArrival; // ecx
unsigned int v73; // r14d
cocos2d::CCObject_vtbl *v74; // rsi
cocos2d::CCObject *(__fastcall *copyWithZone)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *); // rbp
cocos2d::CCObject_vtbl *v76; // rsi
cocos2d::CCObject *(__fastcall *v77)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *); // rbp
cocos2d::CCObject_vtbl *v78; // rsi
cocos2d::CCObject *(__fastcall *v79)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *); // rbp
cocos2d::CCObject_vtbl *v80; // rsi
cocos2d::CCObject *(__fastcall *v81)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *); // rbp
__int64 v82; // rax
cocos2d::CCObject_vtbl *v83; // rsi
const struct cocos2d::CCPoint *v84; // rax
__int64 v85; // rax
cocos2d::CCRect *v86; // rsi
float MinX; // xmm6_4
float MaxX; // xmm7_4
float MinY; // xmm8_4
float MaxY; // xmm0_4
cocos2d::CCNode *v91; // rsi
__int64 v92; // rbx
__int64 v93; // rax
struct cocos2d::CCObject *v94; // rdi
cocos2d::CCObject_vtbl *v95; // rbx
struct cocos2d::CCPoint v96; // rax
__int64 v97; // rdx
unsigned int v100; // [rsp+24h] [rbp-104h] BYREF
cocos2d::ccColor3B m_fromColor; // [rsp+28h] [rbp-100h] BYREF
__int64 v102; // [rsp+30h] [rbp-F8h] BYREF
__int64 v103; // [rsp+38h] [rbp-F0h] BYREF
__int64 v104; // [rsp+40h] [rbp-E8h]
cocos2d::CCArray *v105; // [rsp+48h] [rbp-E0h] BYREF
cocos2d::CCPoint v106; // [rsp+50h] [rbp-D8h] BYREF
__int64 v107; // [rsp+58h] [rbp-D0h]
__int64 v108; // [rsp+60h] [rbp-C8h]
v9 = a3;
v107 = a2;
v11 = (EditorUI *)a1;
v103 = a1;
v108 = a2;
v105 = a6;
v102 = (__int64)a7;
v104 = cocos2d::CCSprite::create();
LOBYTE(v12) = 1;
ObjectsFromString = (cocos2d::CCArray *)LevelEditorLayer::createObjectsFromString(v11->m_editorLayer, a2, v13, v12);
v15 = ObjectsFromString;
m_levelSettings = v11->m_editorLayer->m_levelSettings;
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[19].m_unknown2;
if ( v22 )
{
v23 = v22[1];
v24 = *v22;
if ( v23 == (_DWORD)v24 || !(_DWORD)v24 )
v24 = v23;
m_effectManager = m_levelSettings->m_effectManager;
v26 = m_effectManager;
v27 = v24;
if ( (int)v24 < 0 )
v27 = 0;
if ( v27 > 1101 )
v27 = 1101;
}
else
{
v24 = 0;
m_effectManager = m_levelSettings->m_effectManager;
v26 = m_effectManager;
v27 = 0;
}
if ( v26->m_colorActionVector._Mypair._Myval2._Myfirst[v27] )
{
ColorAction = GJEffectManager::getColorAction(m_effectManager, v24);
m_fromColor = ColorAction->m_fromColor;
((void (__fastcall *)(struct cocos2d::CCObject *, cocos2d::ccColor3B *))v21->__vftable[19].canEncode)(
v21,
&m_fromColor);
*(float *)(*(_QWORD *)&v21[19].m_unknown2 + 8LL) = ColorAction->m_fromOpacity;
v19 = a8;
}
if ( v20[16].__vftable )
{
v29 = *(int **)&v21[19].m_uOrderOfArrival;
if ( v29 )
{
v30 = v29[1];
v31 = *v29;
if ( v30 == v31 || !v31 )
v31 = v30;
}
else
{
v31 = 0;
}
v32 = GJEffectManager::getColorAction(m_levelSettings->m_effectManager, v31);
*(cocos2d::ccColor3B *)&v100 = v32->m_fromColor;
((void (__fastcall *)(struct cocos2d::CCObject *, unsigned int *))v21->__vftable[19].getTag)(v21, &v100);
*(float *)(*(_QWORD *)&v21[19].m_uOrderOfArrival + 8LL) = v32->m_fromOpacity;
v19 = a8;
}
LOBYTE(v24) = -1;
(*(void (__fastcall **)(int *, __int64))(*(_QWORD *)&v21[5].m_unknown2 + 40LL))(&v21[5].m_unknown2, v24);
if ( v19 )
BYTE2(v21[20].m_uUnknown) = v20 == (struct cocos2d::CCObject *)v19;
++v18;
}
while ( v18 < cocos2d::CCArray::count(v15) );
v11 = (EditorUI *)v103;
v9 = a3;
}
}
}
cocos2d::CCPoint::CCPoint(&v106, 1000.0, 1000.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v102, &v106);
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 = (GameObject *)v35;
if ( v35[18].m_eObjType == 2065 )
{
m_unknown2 = v35[15].m_unknown2;
if ( (int)m_unknown2 > 0 )
{
v38 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v11->m_editorLayer->m_linkedGroupDict, m_unknown2);
if ( v38 )
cocos2d::CCArray::removeObject(v38, v36, 1);
}
v36->m_wasSelected = v36->m_isSelected;
EditorUI::deselectObject(v11, v36);
m_editorLayer = v11->m_editorLayer;
LOBYTE(v40) = 1;
v36->deactivateObject(v36, v40);
GJBaseGameLayer::removeObjectFromSection(m_editorLayer, v36);
LevelEditorLayer::removeSpecial(m_editorLayer, v36);
m_editorLayer->m_unk3b22 = 1;
v11->m_rotationTouchID = -1;
if ( v11->m_rotationControl->isVisible(v11->m_rotationControl) )
{
v11->m_rotationControl->setVisible(v11->m_rotationControl, 0);
GJRotationControl::finishTouch(v11->m_rotationControl);
}
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 = (GameObject *)Object;
v44 = v11->m_editorLayer;
if ( Object )
{
LOBYTE(v42) = 1;
Object->__vftable[15].setTag(Object, v42);
GJBaseGameLayer::removeObjectFromSection(v44, v43);
LevelEditorLayer::removeSpecial(v44, v43);
v44->m_unk3b22 = 1;
}
cocos2d::CCArray::removeLastObject(v15, 1);
}
while ( cocos2d::CCArray::count(v15) > a5 );
}
v45 = 0.0;
v46 = 0.0;
v47 = 0.0;
v48 = 0.0;
v103 = 0x30300000001LL;
v102 = 0x100000302LL;
v49 = 0;
v100 = 0;
if ( cocos2d::CCArray::count(v15) )
{
v50 = (cocos2d::CCPoint)v103;
v51 = (cocos2d::CCPoint)v102;
do
{
v52 = cocos2d::CCArray::objectAtIndex(v15, v49);
v54 = v52;
v55 = v11->m_editorLayer;
if ( v52 )
{
LOBYTE(v53) = 1;
v52->__vftable[15].setTag(v52, v53);
GJBaseGameLayer::removeObjectFromSection(v55, (GameObject *)v54);
LevelEditorLayer::removeSpecial(v55, (GameObject *)v54);
v55->m_unk3b22 = 1;
}
v56 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v54->__vftable[2].getTag)(v54);
cocos2d::CCPoint::operator-(v56, &v102, &v106);
v54->__vftable[2].encodeWithCoder(v54, (DS_Dictionary *)&v102);
m_nTag = v54[20].m_nTag;
if ( !m_nTag )
m_nTag = v54[18].m_uOrderOfArrival;
m_nLuaID = v54[20].m_nLuaID;
if ( !m_nLuaID )
m_nLuaID = HIDWORD(v54[20].__vftable);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v104 + 440LL))(
v104,
v54,
(unsigned int)(m_nTag + 10000 * m_nLuaID));
if ( v105 )
cocos2d::CCArray::addObject(v105, v54);
shouldBlendColor = GameObject::shouldBlendColor((GameObject *)v54, *(GJSpriteColor **)&v54[19].m_unknown2, v59);
LOBYTE(v54[15].m_unknown5) = shouldBlendColor;
if ( !v54[16].__vftable )
goto LABEL_62;
v61 = *(GJSpriteColor **)&v54[19].m_uOrderOfArrival;
m_defaultColorID = v61->m_defaultColorID;
m_colorID = v61->m_colorID;
if ( m_defaultColorID == v61->m_colorID || !m_colorID )
m_colorID = v61->m_defaultColorID;
if ( m_colorID == 1012 )
{
v64 = shouldBlendColor;
}
else
{
v64 = GameObject::shouldBlendColor((GameObject *)v54, v61, m_defaultColorID);
shouldBlendColor = v54[15].m_unknown5;
}
if ( v64 )
v65 = 1;
else
LABEL_62:
v65 = 0;
BYTE1(v54[15].m_unknown5) = v65;
v66 = v51;
if ( !shouldBlendColor )
v66 = v50;
(**(void (__fastcall ***)(__int64, cocos2d::CCPoint))&v54[6].m_uID)((__int64)&v54[6].m_uID, v66);
v67 = v54[16].__vftable;
if ( v67 && !LOBYTE(v54[11].m_unknown2) )
{
p_getTag = (void (__fastcall ***)(_QWORD, cocos2d::CCPoint))&v67[4].getTag;
v69 = v51;
if ( !BYTE1(v54[15].m_unknown5) )
v69 = v50;
(**p_getTag)(p_getTag, v69);
v70 = BYTE1(v54[15].m_unknown5);
if ( LOBYTE(v54[15].m_unknown5) == v70 )
{
GameObject::addColorSpriteToSelf((GameObject *)v54);
}
else
{
v71 = v54[20].m_nLuaID;
if ( !v71 )
v71 = HIDWORD(v54[20].__vftable);
if ( v70 && BYTE1(v54[18].m_unknown5) )
++v71;
m_uOrderOfArrival = v54[20].m_nTag;
if ( !m_uOrderOfArrival )
m_uOrderOfArrival = v54[18].m_uOrderOfArrival;
v73 = m_uOrderOfArrival + 10000 * v71;
BYTE2(v54[15].m_uIndexInArray) = 0;
v74 = v54[16].__vftable;
copyWithZone = v74->copyWithZone;
v54->__vftable[1].getTag(v54);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *))copyWithZone + 15))(v74);
v76 = v54[16].__vftable;
v77 = v76->copyWithZone;
((void (__fastcall *)(struct cocos2d::CCObject *))v54->__vftable[2].copyWithZone)(v54);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *))v77 + 17))(v76);
v78 = v54[16].__vftable;
v79 = v78->copyWithZone;
v54->__vftable[4].getTag(v54);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *))v79 + 42))(v78);
v80 = v54[16].__vftable;
v81 = v80->copyWithZone;
v82 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v54->__vftable[2].getTag)(v54);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *, __int64))v81 + 23))(v80, v82);
(*((void (__fastcall **)(cocos2d::CCObject_vtbl *, _QWORD))v54[16].copyWithZone + 63))(v54[16].__vftable, 0);
(*(void (__fastcall **)(__int64, cocos2d::CCObject_vtbl *, _QWORD))(*(_QWORD *)v104 + 440LL))(
v104,
v54[16].__vftable,
v73);
v49 = v100;
}
}
v83 = v54->__vftable;
v84 = (const struct cocos2d::CCPoint *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v54->__vftable[2].getTag)(v54);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v103, v84);
((void (__fastcall *)(struct cocos2d::CCObject *, __int64))v83[16].canEncode)(v54, v85);
v86 = (cocos2d::CCRect *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v54->__vftable[16].update)(v54);
MinX = cocos2d::CCRect::getMinX(v86);
MaxX = cocos2d::CCRect::getMaxX(v86);
MinY = cocos2d::CCRect::getMinY(v86);
MaxY = cocos2d::CCRect::getMaxY(v86);
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;
v100 = ++v49;
}
while ( v49 < cocos2d::CCArray::count(v15) );
v17 = 0;
}
v91 = (cocos2d::CCNode *)v104;
v92 = *(_QWORD *)v104;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v105, v46 - v45, v48 - v47);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(v92 + 296))(v91, v93);
if ( cocos2d::CCArray::count(v15) )
{
do
{
v94 = cocos2d::CCArray::objectAtIndex(v15, v17);
v95 = v94->__vftable;
v94->__vftable[2].getTag(v94);
v96 = cocos2d::CCNode::convertToNodeSpace(v91, (const struct cocos2d::CCPoint *)&v105);
((void (__fastcall *)(struct cocos2d::CCObject *, struct cocos2d::CCPoint))v95[2].encodeWithCoder)(v94, v96);
LOBYTE(v97) = BYTE2(v94[23].m_nLuaID) == 0;
((void (__fastcall *)(struct cocos2d::CCObject *, __int64))v94->__vftable[4].update)(v94, v97);
++v17;
}
while ( v17 < cocos2d::CCArray::count(v15) );
}
sub_14003A830(v107);
return v91;
}