//
// LevelEditorLayer::breakApartTextObject from 0x3714f8 to 0x37168a (402 bytes)
//
// 1 xrefs:
// > CustomizeObjectLayer::onBreakApart @ 0x46134e
//
// 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 LevelEditorLayer::breakApartTextObject(LevelEditorLayer *a1, TextGameObject *a2)
{
EditorUI *m_editorUI; // r0
cocos2d::CCArray *v5; // r9
cocos2d::CCArray *v6; // r11
unsigned int i; // r7
float *v8; // r5
float v9; // s16
int v10; // r0
GameObject *Object; // r10
EditorUI *v12; // r0
bool v13; // [sp+0h] [bp-34h]
cocos2d::CCSpriteBatchNode *m_textLayerB1; // [sp+8h] [bp-2Ch]
_BYTE v15[4]; // [sp+10h] [bp-24h] BYREF
cocos2d::CCPoint v16; // [sp+14h] [bp-20h] BYREF
cocos2d::CCPoint v17; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v18; // [sp+24h] [bp-10h] BYREF
if ( a2 && a2->m_objectID == 914 )
{
m_editorUI = a1->m_editorUI;
if ( m_editorUI )
EditorUI::deselectAll(m_editorUI);
LevelEditorLayer::removeObject(a1, a2, 0);
a1->m_textLayerB1->addChild(a1->m_textLayerB1, a2);
sub_775C20(v15, &a2->m_text);
v5 = a2->getChildren(a2);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
for ( i = 0; i < cocos2d::CCArray::count(v5); ++i )
{
v8 = (float *)cocos2d::CCArray::objectAtIndex(v5, i);
if ( *(_BYTE *)sub_7757BC(v15, i) != 32 )
{
m_textLayerB1 = a1->m_textLayerB1;
v9 = *(float *)(*(int (__fastcall **)(float *))(*(_DWORD *)v8 + 96))(v8) - v8[127];
v10 = (*(int (__fastcall **)(float *))(*(_DWORD *)v8 + 156))(v8);
cocos2d::CCPoint::CCPoint(&v17, v9, v8[128] + (float)(*(float *)(v10 + 4) * 0.5));
cocos2d::CCNode::convertToWorldSpace(&v18, a2, &v17);
cocos2d::CCNode::convertToNodeSpace(&v16, m_textLayerB1, &v18);
cocos2d::CCPoint::CCPoint(&v18, &v16);
Object = LevelEditorLayer::createObject(a1, 914, (cocos2d::CCPoint)(unsigned int)&v18, v13);
GameObject::duplicateValues(Object);
sub_776158(&v18, v15, i, 1);
TextGameObject::updateTextObject((int *)Object, (const char **)&v18, 0);
sub_774008(&v18);
Object->m_updateEditorColor = 1;
cocos2d::CCArray::addObject(v6, Object);
}
}
a2->removeFromParentAndCleanup(a2, 0);
v12 = a1->m_editorUI;
if ( v12 )
EditorUI::selectObjects(v12, v6, 1);
sub_774008(v15);
}
}