//
// GJBaseGameLayer::createTextLayers from 0x14020ec90 to 0x14020f151 (1217 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::init @ 0x1402d299c
// > LevelEditorLayer::updateLevelFont @ 0x1402df401
// > PlayLayer::setupHasCompleted @ 0x1403a6727
// > ??> @ 0x1406ccec4
//
// 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
void GJBaseGameLayer::createTextLayers(GJBaseGameLayer *a1)
{
GameManager *v2; // rcx
GameManager *v3; // rbx
int m_loadedFont; // eax
int v5; // ebx
cocos2d::CCString *v6; // rax
const char *CString; // rsi
cocos2d::CCTextureCache *v8; // rax
struct cocos2d::CCTexture2D *v9; // rdi
cocos2d::CCSpriteBatchNode *v10; // rax
struct cocos2d::CCSpriteBatchNode *v11; // rax
cocos2d::CCSpriteBatchNode *v12; // rax
struct cocos2d::CCSpriteBatchNode *v13; // rax
cocos2d::CCSpriteBatchNode *v14; // rax
struct cocos2d::CCSpriteBatchNode *v15; // rax
cocos2d::CCSpriteBatchNode *v16; // rax
struct cocos2d::CCSpriteBatchNode *v17; // rax
cocos2d::CCTextureCache *v18; // rax
struct cocos2d::CCTexture2D *v19; // rax
cocos2d::CCSpriteBatchNode *v20; // rax
cocos2d::CCTextureCache *v21; // rax
struct cocos2d::CCTexture2D *v22; // rax
struct cocos2d::CCSpriteBatchNode *v23; // rax
cocos2d::CCSpriteBatchNode *v24; // rax
struct cocos2d::CCSpriteBatchNode *v25; // rax
cocos2d::CCSpriteBatchNode *v26; // rax
struct cocos2d::CCSpriteBatchNode *v27; // rax
cocos2d::CCSpriteBatchNode *v28; // rax
struct cocos2d::CCSpriteBatchNode *v29; // rax
cocos2d::CCSpriteBatchNode *v30; // rax
struct cocos2d::CCSpriteBatchNode *v31; // rax
void *v32; // [rsp+48h] [rbp+10h]
void *v33; // [rsp+48h] [rbp+10h]
v2 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v32 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = (GameManager *)qword_1406C2ED8;
}
v3 = v2;
if ( !v2 )
{
v33 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = (GameManager *)qword_1406C2ED8;
}
m_loadedFont = v3->m_loadedFont;
v5 = 59;
if ( m_loadedFont < 59 )
v5 = m_loadedFont;
if ( v5 <= 0 )
{
GameManager::loadFont(v2, 0);
CString = "bigFont.png";
}
else
{
GameManager::loadFont(v2, v5);
v6 = cocos2d::CCString::createWithFormat("gjFont%02d.png", v5);
CString = cocos2d::CCString::getCString(v6);
}
v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
v9 = cocos2d::CCTextureCache::addImage(v8, CString, 0);
v10 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerT4 = v10;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v10, 1260);
v11 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerT4 = v11;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v11->setBlendFunc)(
&v11->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerT4, 1280);
v12 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerT3 = v12;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v12, 880);
v13 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerT3 = v13;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v13->setBlendFunc)(
&v13->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerT3, 900);
v14 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerT2 = v14;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v14, 580);
v15 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerT2 = v15;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v15->setBlendFunc)(
&v15->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerT2, 600);
v16 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerT1 = v16;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v16, 280);
v17 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerT1 = v17;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v17->setBlendFunc)(
&v17->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerT1, 300);
v18 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
v19 = cocos2d::CCTextureCache::addImage(v18, CString, 0);
v20 = cocos2d::CCSpriteBatchNode::createWithTexture(v19);
a1->m_textLayerB1 = v20;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v20, -100);
v21 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
v22 = cocos2d::CCTextureCache::addImage(v21, CString, 0);
v23 = cocos2d::CCSpriteBatchNode::createWithTexture(v22);
a1->m_textBlendingLayerB1 = v23;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v23->setBlendFunc)(
&v23->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerB1, -80);
v24 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerB2 = v24;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v24, -400);
v25 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerB2 = v25;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v25->setBlendFunc)(
&v25->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerB2, -380);
v26 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerB3 = v26;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v26, -700);
v27 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerB3 = v27;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v27->setBlendFunc)(
&v27->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerB3, -680);
v28 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerB4 = v28;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v28, -1000);
v29 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerB4 = v29;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v29->setBlendFunc)(
&v29->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerB4, -980);
v30 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textLayerB5 = v30;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v30, -1300);
v31 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);
a1->m_textBlendingLayerB5 = v31;
((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v31->setBlendFunc)(
&v31->cocos2d::CCTextureProtocol,
0x100000302LL);
a1->m_objectLayer->addChild_0(a1->m_objectLayer, a1->m_textBlendingLayerB5, -1280);
}