//
// cocos2d::CCTextFieldTTF::textFieldWithPlaceHolder from 0x1800b6300 to 0x1800b6477 (375 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8b14
//
// 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=2
cocos2d::CCTextFieldTTF *__fastcall cocos2d::CCTextFieldTTF::textFieldWithPlaceHolder(
const char *a1,
const struct cocos2d::CCSize *a2,
enum cocos2d::CCTextAlignment a3,
const char *a4,
float a5)
{
cocos2d::CCTextFieldTTF *v9; // rax
cocos2d::CCTextFieldTTF *v10; // rbx
std::string *m_pPlaceHolder; // rdi
unsigned __int64 m_capacity; // rdx
char *m_bigStorage; // rcx
std::string *v14; // rax
v9 = (cocos2d::CCTextFieldTTF *)operator new(0x300u);
if ( v9 )
v10 = cocos2d::CCTextFieldTTF::CCTextFieldTTF(v9);
else
v10 = nullptr;
if ( !v10 )
return nullptr;
m_pPlaceHolder = v10->m_pPlaceHolder;
if ( m_pPlaceHolder )
{
m_capacity = m_pPlaceHolder->m_data.m_capacity;
if ( m_capacity > 0xF )
{
m_bigStorage = m_pPlaceHolder->m_data.m_bigStorage;
if ( m_capacity + 1 >= 0x1000 )
{
if ( (unsigned __int64)&m_bigStorage[-*((_QWORD *)m_bigStorage - 1) - 8] > 0x1F )
invalid_parameter_noinfo_noreturn();
m_bigStorage = *((char **)m_bigStorage - 1);
}
j_j_free_0(m_bigStorage);
}
m_pPlaceHolder->m_data.m_size = 0;
m_pPlaceHolder->m_data.m_capacity = 15;
m_pPlaceHolder->m_data.m_smallStorage._Elems[0] = 0;
j_j_free_0(m_pPlaceHolder);
v10->m_pPlaceHolder = nullptr;
}
v14 = (std::string *)operator new(0x20u);
if ( v14 )
{
v14->m_data.0 = 0;
v14->m_data.m_size = 0;
v14->m_data.m_capacity = 15;
v14->m_data.m_smallStorage._Elems[0] = 0;
}
else
{
v14 = nullptr;
}
v10->m_pPlaceHolder = v14;
if ( v14->m_data.m_capacity > 0xF )
v14 = (std::string *)v14->m_data.m_bigStorage;
if ( !cocos2d::CCLabelTTF::initWithString(v10, v14->m_data.m_smallStorage._Elems, a4, a5, a2, a3) )
{
((void (__fastcall *)(cocos2d::CCTextFieldTTF *, __int64))v10->~CCTextFieldTTF)(v10, 1);
return nullptr;
}
cocos2d::CCObject::autorelease(v10);
if ( a1 )
((void (__fastcall *)(cocos2d::CCTextFieldTTF *, const char *))v10->setColorSpaceHolder)(v10, a1);
return v10;
}