//
// LevelEditorLayer::breakApartTextObject from 0x1003623fc to 0x100362638 (572 bytes)
//
// 1 xrefs:
// > CustomizeObjectLayer::onBreakApart @ 0x10004fe50
//
// 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 __fastcall LevelEditorLayer::breakApartTextObject(LevelEditorLayer *a1, TextGameObject *a2)
{
EditorUI *m_editorUI; // x0
__int64 v5; // x22
cocos2d::CCArray *v6; // x21
unsigned __int64 i; // x23
float *v8; // x25
cocos2d::CCSpriteBatchNode *m_textLayerB1; // x24
float v10; // s9
float v11; // s10
__int64 v12; // x0
__n128 v13; // q0
__n128 v14; // q1
GameObject *Object; // x24
EditorUI *v16; // x0
std::string __p; // [xsp+0h] [xbp-B0h] BYREF
cocos2d::CCPoint v18; // [xsp+18h] [xbp-98h] BYREF
cocos2d::CCPoint __a; // [xsp+20h] [xbp-90h] BYREF
__int64 v20; // [xsp+28h] [xbp-88h] BYREF
std::string __str; // [xsp+30h] [xbp-80h] BYREF
cocos2d::CCPoint v22; // 0:s0.4,4:s1.4
if ( a2 && a2->m_objectID == 914 )
{
m_editorUI = a1->m_editorUI;
if ( m_editorUI )
EditorUI::deselectAll(m_editorUI);
LevelEditorLayer::removeObject(a1, a2, 0);
((void (__fastcall *)(cocos2d::CCSpriteBatchNode *, TextGameObject *))a1->m_textLayerB1->addChild)(
a1->m_textLayerB1,
a2);
if ( a2->m_text.m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__str, (void *)a2->m_text.m_data.m_long.capacitym1, a2->m_text.m_data.m_long.size);
else
__str = (std::string)a2->m_text;
v5 = ((__int64 (__fastcall *)(TextGameObject *))a2->getChildren)(a2);
v6 = (cocos2d::CCArray *)sub_10024A15C();
for ( i = 0; i < (unsigned int)sub_10024A36C(v5); ++i )
{
v8 = (float *)sub_10024A388(v5, i);
if ( *std::string::at(&__str, i) != 32 )
{
m_textLayerB1 = a1->m_textLayerB1;
v10 = *(float *)(*(__int64 (__fastcall **)(float *))(*(_QWORD *)v8 + 192LL))(v8);
v11 = v8[149];
v12 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v8 + 312LL))(v8);
v13.n128_f32[0] = v10 - v11;
v14.n128_f32[0] = (float)(*(float *)(v12 + 4) * 0.5) + v8[150];
sub_100022980(v13, v14, &v18);
cocos2d::CCNode::convertToWorldSpace(a2, &v18);
cocos2d::CCNode::convertToNodeSpace(m_textLayerB1, &__a);
v22.x = sub_1000229B8((__int64 *)&__a, &v20);
Object = LevelEditorLayer::createObject(a1, 914, v22, (bool)&__a);
GameObject::duplicateValues(Object);
std::string::basic_string(&__p, &__str, i, 1u, (std::allocator *)&__a);
TextGameObject::updateTextObject((__int64)Object, &__p, 0);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
Object->m_updateEditorColor = 1;
sub_10024A2D0((__int64)v6);
}
}
((void (__fastcall *)(TextGameObject *, _QWORD))a2->removeFromParentAndCleanup)(a2, 0);
v16 = a1->m_editorUI;
if ( v16 )
EditorUI::selectObjects(v16, v6, 1);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
}