//
// LevelEditorLayer::updateObjectLabel from 0x1402d7660 to 0x1402d7bb5 (1365 bytes)
//
// 5 xrefs:
// > CollisionBlockPopup::updateEditorLabel @ 0x14008b9ae
// > EditorUI::dynamicGroupUpdate @ 0x140118f6e
// > LevelEditorLayer::addSpecial @ 0x1402d7c7f
// > SetupTriggerPopup::updateEditorLabel @ 0x14047555e
// > ??> @ 0x1406d3104
//
// 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=1
void LevelEditorLayer::updateObjectLabel(GameObject *a1)
{
int m_objectID; // edx
float b; // r9d
__int64 m_targetColor; // r8
__m128i v5; // xmm0
__int64 v6; // rdx
cocos2d::CCString *v7; // rax
char *CString; // rax
size_t v9; // r8
cocos2d::CCString *v10; // rax
cocos2d::CCString *v11; // rax
cocos2d::CCString *v12; // rax
__m128i *v13; // rbx
void *v14; // rcx
cocos2d::CCLabelBMFont *v15; // rax
struct cocos2d::CCLabelBMFont *v16; // rsi
void **v17; // rcx
void **v18; // rdx
cocos2d::CCLabelBMFont_vtbl *v19; // rbx
const cocos2d::CCSize *v20; // rax
const cocos2d::CCPoint *v21; // rax
void *Block[2]; // [rsp+30h] [rbp-21h] BYREF
__m128i si128; // [rsp+40h] [rbp-11h]
_QWORD v24[4]; // [rsp+50h] [rbp-1h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID <= 1585 )
{
if ( m_objectID != 1585 )
{
if ( m_objectID > 1049 )
{
if ( m_objectID != 1268 && (unsigned int)(m_objectID - 1346) >= 2 )
return;
}
else if ( m_objectID != 1049 && m_objectID != 899 && m_objectID != 901 && (unsigned int)(m_objectID - 1006) >= 2 )
{
return;
}
}
goto LABEL_29;
}
if ( m_objectID <= 1811 )
{
if ( m_objectID != 1811 && m_objectID != 1595 && m_objectID != 1611 && m_objectID != 1616 )
return;
goto LABEL_29;
}
if ( m_objectID > 2062 )
{
if ( m_objectID > 3609 )
{
if ( m_objectID != 3640 && m_objectID != 3660 )
return;
}
else if ( m_objectID != 3609 && m_objectID != 2067 && m_objectID != 3016 && m_objectID != 3033 )
{
return;
}
LABEL_29:
b = a1[1].m_sAdditionalTransform.b;
m_targetColor = LODWORD(b);
switch ( m_objectID )
{
case 899:
m_targetColor = (unsigned int)a1->m_targetColor;
break;
case 1811:
LABEL_33:
m_targetColor = *(unsigned int *)&a1[1]._cascadeColorEnabled;
break;
case 1816:
m_targetColor = *(unsigned int *)&a1[1]._cascadeColorEnabled;
break;
case 1817:
goto LABEL_33;
default:
break;
}
v5.m128i_i32[0] = 0;
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
switch ( m_objectID )
{
case 1816:
v6 = *(unsigned int *)&a1[1]._cascadeColorEnabled;
if ( a1[1]._realColor.r )
{
v7 = cocos2d::CCString::createWithFormat("%i.", v6, m_targetColor);
CString = (char *)cocos2d::CCString::getCString(v7);
v9 = -1;
do
++v9;
while ( CString[v9] );
}
else
{
v10 = cocos2d::CCString::createWithFormat("%i", v6);
CString = (char *)cocos2d::CCString::getCString(v10);
v9 = -1;
do
++v9;
while ( CString[v9] );
}
break;
case 3640:
v11 = cocos2d::CCString::createWithFormat("%i\n%i", b, a1[1].m_sAdditionalTransform.c);
CString = (char *)cocos2d::CCString::getCString(v11);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
case 1912:
v12 = cocos2d::CCString::createWithFormat("%i/%i", b, a1[1].m_sAdditionalTransform.c);
CString = (char *)cocos2d::CCString::getCString(v12);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
default:
if ( (int)m_targetColor < 1000 || m_objectID != 899 && (m_objectID != 1006 || LODWORD(a1[1].m_pActionManager)) )
{
v13 = (__m128i *)GameToolbox::intToString(v24, m_targetColor);
if ( Block != (void **)v13 )
{
if ( si128.m128i_i64[1] > 0xFuLL )
{
v14 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
v5 = *v13;
*(__m128i *)Block = *v13;
si128 = v13[1];
v13[1].m128i_i64[0] = 0;
v13[1].m128i_i64[1] = 15;
v13->m128i_i8[0] = 0;
}
sub_14003A830((__int64)v24);
goto LABEL_67;
}
CString = (char *)GJSpecialColorSelect::textForColorIdx(m_targetColor);
v9 = -1;
do
++v9;
while ( CString[v9] );
break;
}
sub_14003CCE0(Block, CString, v9);
LABEL_67:
v15 = a1->getObjectLabel(a1);
v16 = v15;
if ( v15 )
{
v18 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v18 = (void **)Block[0];
v15->setString(&v15->cocos2d::CCLabelProtocol, (const char *)v18);
}
else
{
v17 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v17 = (void **)Block[0];
v16 = cocos2d::CCLabelBMFont::create((const char *)v17, (const char *)&qword_14052A4D8);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v16->setScale_0)(v16);
a1->addChild_0(a1, v16, 1);
a1->setObjectLabel(a1, v16);
}
v19 = v16->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->getContentSize(a1);
v20 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(*(float *)v5.m128i_i32, v20->width * 0.5);
v19->setPosition_0(v16, v21);
cocos2d::CCLabelBMFont::limitLabelWidth(v16, 30.0, 0.5, 0.0);
sub_14003A830((__int64)Block);
return;
}
if ( m_objectID == 2062 )
goto LABEL_29;
switch ( m_objectID )
{
case 1812:
case 1814:
case 1815:
case 1816:
case 1817:
case 1912:
goto LABEL_29;
default:
return;
}
}