//
// cocos2d::CCTextFieldTTF::initWithPlaceHolder from 0x1800b57c0 to 0x1800b58f3 (307 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8ab4
//
// 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
bool __fastcall cocos2d::CCTextFieldTTF::initWithPlaceHolder(
cocos2d::CCTextFieldTTF *this,
const char *a2,
const struct cocos2d::CCSize *a3,
enum cocos2d::CCTextAlignment a4,
const char *a5,
float a6)
{
std::string *m_pPlaceHolder; // rbx
unsigned __int64 m_capacity; // rdx
char *m_bigStorage; // rcx
std::string *v13; // rax
std::string *v14; // rbx
size_t v15; // r8
std::string *v16; // rdx
if ( a2 )
{
m_pPlaceHolder = this->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);
this->m_pPlaceHolder = nullptr;
}
v13 = (std::string *)operator new(0x20u);
v14 = v13;
if ( v13 )
{
v13->m_data.0 = 0;
v13->m_data.m_size = 0;
v13->m_data.m_capacity = 0;
v15 = -1;
do
++v15;
while ( a2[v15] );
sub_18000CE60(v13, a2, v15);
}
else
{
v14 = nullptr;
}
this->m_pPlaceHolder = v14;
}
v16 = this->m_pPlaceHolder;
if ( v16->m_data.m_capacity > 0xF )
v16 = (std::string *)v16->m_data.m_bigStorage;
return cocos2d::CCLabelTTF::initWithString(this, v16->m_data.m_smallStorage._Elems, a5, a6, a3, a4);
}