//
// TextArea::fadeInCharacters from 0x10030de50 to 0x10030e24f (1023 bytes)
//
// 3 xrefs:
// > DialogLayer::displayDialogObject @ 0x1003b10ff
// > SecretLayer5::fadeInMessage @ 0x100470bfa
// > SecretLayer5::fadeOutMessage @ 0x100470c73
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:28:37 +0000
//
float __fastcall TextArea::fadeInCharacters(__int64 a1, char a2, int a3, float a4, float a5)
{
char v5; // r14
__int64 v6; // rbx
__int64 v7; // rdi
_QWORD *v8; // rax
__int64 v9; // rax
__int64 v10; // r12
int v11; // r15d
__int64 v12; // rdi
__int64 v13; // rax
unsigned int *v14; // rcx
__int64 *v15; // rbx
__int64 v16; // r13
__int64 *v17; // rbx
float v18; // xmm0_4
int v19; // eax
int v20; // r12d
int v21; // eax
int v22; // ecx
int v23; // r8d
int v24; // r9d
__int64 v25; // rsi
float v26; // xmm0_4
float v27; // xmm1_4
__int64 v28; // r12
int v29; // r14d
int v30; // eax
int v31; // ecx
int v32; // r8d
int v33; // r9d
__int64 v34; // rsi
int v35; // r12d
_QWORD *v36; // rax
__int64 v37; // rdi
__int64 v38; // rax
__int64 v39; // r14
float v40; // xmm1_4
int v41; // r14d
int v42; // eax
int v43; // edi
int v44; // ecx
int v45; // r8d
int v46; // r9d
__int64 v47; // rsi
unsigned __int64 v49; // [rsp+8h] [rbp-88h]
__int64 v50; // [rsp+10h] [rbp-80h]
int *v51; // [rsp+18h] [rbp-78h]
__int64 v52; // [rsp+20h] [rbp-70h]
__int64 v53; // [rsp+28h] [rbp-68h]
char v54; // [rsp+30h] [rbp-60h]
__int64 v57; // [rsp+48h] [rbp-48h]
float v60; // [rsp+5Ch] [rbp-34h]
float v61; // [rsp+60h] [rbp-30h]
float v62; // [rsp+64h] [rbp-2Ch]
v5 = a2;
v6 = a1;
v7 = *(_QWORD *)(a1 + 704);
if ( v7 )
{
cocos2d::CCObject::release(v7);
*(_QWORD *)(v6 + 704) = 0;
}
v8 = cocos2d::CCDictionary::create();
*(_QWORD *)(v6 + 704) = v8;
cocos2d::CCObject::retain(v8);
v51 = *(int **)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v6 + 608) + 488LL))(*(_QWORD *)(v6 + 608)) + 56);
v9 = *v51;
if ( v9 <= 0 )
{
cocos2d::CCNode::unscheduleUpdate(v6);
v60 = 0.0;
goto LABEL_39;
}
v57 = v6;
v53 = (unsigned int)(v9 - 1);
v54 = 0;
v60 = 0.0;
v10 = 0;
v62 = 0.0;
v11 = 0;
v52 = *v51;
while ( 2 )
{
v12 = *(_QWORD *)(*((_QWORD *)v51 + 2) + 8 * v10);
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 488LL))(v12);
v50 = v10;
if ( !v13 || (v14 = *(unsigned int **)(v13 + 56), !*v14) )
{
v40 = 0.0;
if ( v10 == v53 )
goto LABEL_31;
goto LABEL_5;
}
v15 = *((__int64 **)v14 + 2);
v16 = *v15;
if ( !*v15 )
{
v40 = 0.0;
if ( v10 == v53 )
goto LABEL_31;
goto LABEL_5;
}
v49 = (unsigned __int64)&v15[*v14 - 1];
v17 = v15 + 1;
while ( 1 )
{
if ( v5 )
{
v18 = a4;
if ( *(_BYTE *)(v16 + 604) == 1 )
goto LABEL_12;
}
else
{
cocos2d::CCNode::stopAllActions(v16);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 912LL))(v16, 0);
v62 = v62 + *(float *)(v16 + 612);
v18 = a4;
if ( *(_BYTE *)(v16 + 604) == 1 )
{
LABEL_12:
v18 = *(float *)(v16 + 608);
v61 = v18;
if ( !v5 )
goto LABEL_13;
goto LABEL_16;
}
}
v61 = v18;
if ( !v5 )
{
LABEL_13:
v19 = cocos2d::CCFadeIn::create(v18);
goto LABEL_17;
}
LABEL_16:
v19 = cocos2d::CCFadeOut::create(v18);
LABEL_17:
v20 = v19;
v21 = cocos2d::CCDelayTime::create((float)((float)v11 * a5) + v62);
v25 = sub_10039EB60(v21, v20, 0, v22, v23, v24);
cocos2d::CCNode::runAction(v16, v25);
if ( a3 == 1 )
{
if ( v5 )
{
v26 = v61;
v27 = 1.4;
}
else
{
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 1.4);
v26 = v61 * 0.5;
v27 = 1.0;
}
v28 = cocos2d::CCScaleTo::create_1(v26, v27);
v29 = cocos2d::CCDelayTime::create((float)((float)v11 * a5) + v62);
v30 = cocos2d::CCEaseInOut::create(v28, 2.0);
v34 = sub_10039EB60(v29, v30, 0, v31, v32, v33);
cocos2d::CCNode::runAction(v16, v34);
v5 = a2;
}
v35 = *(unsigned __int8 *)(v16 + 604);
if ( *(int *)(v16 + 628) > 0 )
{
v36 = (_QWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 192LL))(v16);
sub_100278300((_QWORD *)(v16 + 632), v36);
v37 = *(_QWORD *)(v57 + 704);
v38 = cocos2d::CCDictionary::objectForKey_1(v37, *(int *)(v16 + 628));
if ( !v38 )
{
v39 = sub_1007FE900(v37);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(v57 + 704), v39, *(int *)(v16 + 628));
v38 = v39;
v5 = a2;
}
sub_1007FEBF0(v38, v16);
v54 = 1;
}
v11 += v35 ^ 1;
if ( (unsigned __int64)v17 > v49 )
break;
v16 = *v17++;
v40 = v61;
if ( !v16 )
{
v10 = v50;
if ( v50 != v53 )
goto LABEL_5;
goto LABEL_31;
}
}
v40 = v61;
v10 = v50;
if ( v50 != v53 )
goto LABEL_5;
LABEL_31:
v60 = (float)((float)((float)v11 * a5) + v40) + v62;
v41 = cocos2d::CCDelayTime::create(v60);
v42 = cocos2d::CCCallFunc::create(v57, TextArea::finishFade, 0);
v43 = v41;
v5 = a2;
v47 = sub_10039EB60(v43, v42, 0, v44, v45, v46);
cocos2d::CCNode::runAction(v57, v47);
LABEL_5:
if ( ++v10 != v52 )
continue;
break;
}
v6 = v57;
cocos2d::CCNode::unscheduleUpdate(v57);
if ( (v54 & 1) == 0 )
{
LABEL_39:
cocos2d::CCNode::unscheduleUpdate(v6);
return v60;
}
cocos2d::CCNode::scheduleUpdate(v57);
return v60;
}