//
// TextGameObject::updateTextObject from 0x100264e88 to 0x100265128 (672 bytes)
//
// 8 xrefs:
// > CustomizeObjectLayer::onClear @ 0x10004fe98
// > CustomizeObjectLayer::textChanged @ 0x100050bbc
// > TextGameObject::customObjectSetup @ 0x1002651fc
// > LevelEditorLayer::updateLevelFont @ 0x1003622cc
// > LevelEditorLayer::breakApartTextObject @ 0x1003625b0
// > EditorUI::getCreateBtn @ 0x1003ea370
// > EditorUI::getCreateBtn @ 0x1003ea3ac
// > EditorUI::onCreateObject @ 0x1003eb5a8
//
// 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
//
__int64 __fastcall TextGameObject::updateTextObject(__int64 a1, std::string *this, char a3)
{
std::string *v4; // x20
__int64 v6; // x24
size_t v7; // x8
void *v8; // x22
size_t size; // x9
int v10; // w10
std::string *v11; // x0
_QWORD *v12; // x1
size_t v13; // x2
_BOOL4 v14; // w23
__int64 v15; // x0
__int64 v16; // x0
__int64 v17; // x0
unsigned __int8 v18; // w8
_BOOL4 v19; // w23
cocos2d::CCArray *v20; // x22
const char *FontFile; // x1
GameManager *v22; // x21
GameManager *v23; // x0
cocos2d::CCLabelBMFont *Batched; // x20
__int64 v25; // x0
unsigned int v26; // w20
__int64 v27; // x0
__int64 v28; // x21
__int64 result; // x0
__int16 v30; // [xsp+4h] [xbp-4Ch] BYREF
unsigned __int8 v31; // [xsp+6h] [xbp-4Ah]
_QWORD v32[2]; // [xsp+8h] [xbp-48h] BYREF
char v33; // [xsp+1Fh] [xbp-31h]
cocos2d::CCPoint v34; // 0:kr00_8.8
v4 = this;
if ( (SHIBYTE(this->__r_.__value_.__r.__words[2]) & 0x8000000000000000LL) != 0 )
{
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_20;
}
else if ( !*((_BYTE *)&this->__r_.__value_.__s + 23) )
{
goto LABEL_20;
}
sub_100009900(v32, " ");
v6 = v33;
v8 = (void *)v32[0];
v7 = v32[1];
size = HIBYTE(v4->__r_.__value_.__r.__words[2]);
v10 = (char)size;
if ( (size & 0x80u) != 0LL )
size = v4->__r_.__value_.__l.__size_;
if ( v10 >= 0 )
v11 = v4;
else
v11 = (std::string *)v4->__r_.__value_.__r.__words[0];
if ( v33 < 0 )
{
v12 = (_QWORD *)v32[0];
}
else
{
v7 = v33;
v12 = v32;
}
if ( v7 >= size )
v13 = size;
else
v13 = v7;
v14 = v7 == size;
if ( memcmp(v11, v12, v13) )
v14 = 0;
if ( v6 < 0 )
{
operator delete(v8);
if ( !v14 )
goto LABEL_21;
goto LABEL_20;
}
if ( v14 )
LABEL_20:
std::string::assign(v4, "A");
LABEL_21:
std::string::operator=((std::string *)(a1 + 1352), v4);
v31 = -1;
v30 = -1;
v15 = *(_QWORD *)(a1 + 208);
if ( v15 && (unsigned int)sub_10024A36C(v15) )
{
v16 = sub_10024A388(*(_QWORD *)(a1 + 208), 0);
v17 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 928LL))(v16);
v18 = *(_BYTE *)(v17 + 2);
v30 = *(_WORD *)v17;
v31 = v18;
}
if ( *(_BYTE *)(a1 + 1133) == 1 )
{
v19 = 1;
if ( (unsigned __int8)v30 == 255 && HIBYTE(v30) == 255 )
v19 = v31 != 255;
}
else
{
v19 = 0;
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 568LL))(a1, 1);
v20 = (cocos2d::CCArray *)sub_10024A15C();
if ( SHIBYTE(v4->__r_.__value_.__r.__words[2]) < 0 )
{
v4 = (std::string *)v4->__r_.__value_.__r.__words[0];
if ( (a3 & 1) != 0 )
goto LABEL_31;
}
else if ( (a3 & 1) != 0 )
{
LABEL_31:
FontFile = "bigFont.fnt";
goto LABEL_34;
}
v22 = GameManager::sharedState();
v23 = GameManager::sharedState();
FontFile = GameManager::getFontFile(v22, v23->m_loadedFont);
LABEL_34:
Batched = cocos2d::CCLabelBMFont::createBatched((const char *)v4, FontFile, v20, *(_DWORD *)(a1 + 1376));
v25 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))Batched->getContentSize)(Batched);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 304LL))(a1, v25);
v34 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)a1, &stru_10086D4E0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD *, float, float))Batched->setPosition)(
Batched,
v32,
v34.x,
v34.y);
if ( (unsigned int)sub_10024A36C((__int64)v20) )
{
v26 = 0;
do
{
v27 = sub_10024A388((__int64)v20, v26);
v28 = v27;
if ( v19 )
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v27 + 944LL))(v27, &v30);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 440LL))(a1, v28);
++v26;
}
while ( v26 < (unsigned int)sub_10024A36C((__int64)v20) );
}
*(_BYTE *)(a1 + 886) = 1;
*(_WORD *)(a1 + 864) = 257;
*(_BYTE *)(a1 + 840) = 1;
result = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1184LL))(a1, 1);
*(_BYTE *)(a1 + 559) = 1;
return result;
}