//
// cocos2d::CCLabelTTF::initWithString from 0x18004e4d0 to 0x18004e5c1 (241 bytes)
//
// 6 xrefs:
// > cocos2d::CCLabelTTF::create @ 0x18004ddcd
// > cocos2d::CCLabelTTF::create @ 0x18004dea4
// > cocos2d::CCLabelTTF::initWithString @ 0x18004e48a
// > cocos2d::CCLabelTTF::initWithString @ 0x18004e4be
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b1c98
//
// 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
char __fastcall cocos2d::CCLabelTTF::initWithString(
cocos2d::CCLabelTTF *this,
const char *a2,
char *a3,
float a4,
const struct cocos2d::CCSize *a5,
enum cocos2d::CCTextAlignment a6,
enum cocos2d::CCVerticalTextAlignment a7)
{
cocos2d::CCLabelTTF_vtbl *v10; // rbx
cocos2d::CCShaderCache *v11; // rax
struct cocos2d::CCGLProgram *v12; // rax
float *v13; // rax
std::string *v14; // rax
std::string *v16; // [rsp+20h] [rbp-28h] BYREF
if ( !cocos2d::CCSprite::init(this) )
return 0;
v10 = this->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v11 = cocos2d::CCShaderCache::sharedShaderCache();
v12 = cocos2d::CCShaderCache::programForKey(v11, "ShaderPositionTextureColor");
((void (__fastcall *)(cocos2d::CCLabelTTF *, struct cocos2d::CCGLProgram *))v10->setShaderProgram)(this, v12);
v13 = kmVec2Fill((float *)&v16, a5->width, a5->height);
cocos2d::CCSize::operator=(&this->m_tDimensions, v13);
this->m_hAlignment = a6;
this->m_vAlignment = a7;
v14 = (std::string *)operator new(0x20u);
v16 = v14;
if ( v14 )
v14 = (std::string *)sub_180005910(v14, a3);
this->m_pFontName = v14;
this->m_fFontSize = a4;
((void (__fastcall *)(cocos2d::CCLabelProtocol *, const char *))this->setString)(&this->cocos2d::CCLabelProtocol, a2);
return 1;
}