//
// LevelEditorLayer::transferDefaultColors from 0x1403fa630 to 0x1403fa953 (803 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::updateGameObjects @ 0x1403fb039
// > LevelEditorLayer::onPlaytest @ 0x1403fea37
// > ??> @ 0x14092567c
//
// 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 11:31:52 +0000
//
char *__fastcall LevelEditorLayer::transferDefaultColors(__int64 a1, __int64 a2, __int64 a3)
{
__int64 AllColorActions; // rax
unsigned int *v6; // rdi
__int64 v7; // rax
__int64 *v8; // rdi
__int64 *i; // r14
__int64 v10; // rbx
char *ColorAction; // rax
int v12; // edx
char *v13; // rcx
__int16 v14; // dx
char v15; // al
__int64 v16; // rax
__int64 v17; // r8
int v18; // edx
__int64 v19; // rax
__int16 v20; // di
char v21; // r14
char *v22; // rbx
char *ColorSprite; // rax
__int64 v24; // rax
__int16 v25; // di
char v26; // r14
char *v27; // rbx
char *v28; // rax
__int64 v29; // rax
__int16 v30; // bx
char v31; // di
char *v32; // rax
__int64 v33; // rax
__int16 v34; // bx
char v35; // di
char *v36; // rax
__int64 v37; // rax
__int16 v38; // bx
char v39; // di
char *v40; // rax
__int64 v41; // rax
__int16 v42; // bx
char v43; // di
char *v44; // rax
char *v45; // rax
__int16 v46; // cx
char v47; // al
__int64 v48; // rcx
__int16 v50; // [rsp+40h] [rbp+8h] BYREF
char v51; // [rsp+42h] [rbp+Ah]
AllColorActions = GJEffectManager::getAllColorActions(a2);
if ( AllColorActions )
{
v6 = *(unsigned int **)(AllColorActions + 56);
v7 = *v6;
if ( (_DWORD)v7 )
{
v8 = *((__int64 **)v6 + 2);
for ( i = &v8[v7 - 1]; v8 <= i; ++v8 )
{
v10 = *v8;
if ( !*v8 )
break;
ColorAction = GJEffectManager::getColorAction(a3, *(_DWORD *)(v10 + 92));
v12 = *(_DWORD *)(v10 + 88);
v13 = ColorAction;
if ( v12 > 0 )
{
v16 = *(_QWORD *)(a1 + 3512);
if ( v12 == 1 )
{
v14 = *(_WORD *)(v16 + 2706);
v15 = *(_BYTE *)(v16 + 2708);
}
else
{
v14 = *(_WORD *)(v16 + 2709);
v15 = *(_BYTE *)(v16 + 2711);
}
}
else
{
v14 = *(_WORD *)(v10 + 72);
v15 = *(_BYTE *)(v10 + 74);
}
v17 = *((int *)v13 + 23);
*(_WORD *)(v13 + 75) = v14;
v13[77] = v15;
*((_DWORD *)v13 + 25) = *(_DWORD *)(v10 + 96);
v13[84] = *(_BYTE *)(v10 + 84);
v18 = *(_DWORD *)(v10 + 120);
*((_DWORD *)v13 + 30) = v18;
*(_OWORD *)(v13 + 104) = *(_OWORD *)(v10 + 104);
v13[125] = *(_BYTE *)(v10 + 125);
if ( v18 <= 0 )
cocos2d::CCDictionary::removeObjectForKey(*(cocos2d::CCDictionary **)(a3 + 632), v17);
else
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a3 + 632), (struct cocos2d::CCObject *)v13, v17);
}
}
}
v19 = *(_QWORD *)(a1 + 3512);
v20 = *(_WORD *)(v19 + 2706);
v21 = *(_BYTE *)(v19 + 2708);
v22 = *(char **)(*(_QWORD *)(a3 + 736) + 8040LL);
if ( !v22 )
{
v22 = ColorAction::create();
*((_DWORD *)v22 + 23) = 1005;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a3 + 328), (struct cocos2d::CCObject *)v22, 1005);
*(_QWORD *)(*(_QWORD *)(a3 + 736) + 8040LL) = v22;
ColorSprite = GJEffectManager::getColorSprite(a3, 1005);
*((_QWORD *)v22 + 18) = ColorSprite;
*((_QWORD *)ColorSprite + 43) = v22;
}
*(_WORD *)(v22 + 75) = v20;
v22[77] = v21;
v24 = *(_QWORD *)(a1 + 3512);
v25 = *(_WORD *)(v24 + 2709);
v26 = *(_BYTE *)(v24 + 2711);
v27 = *(char **)(*(_QWORD *)(a3 + 736) + 8048LL);
if ( !v27 )
{
v27 = ColorAction::create();
*((_DWORD *)v27 + 23) = 1006;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a3 + 328), (struct cocos2d::CCObject *)v27, 1006);
*(_QWORD *)(*(_QWORD *)(a3 + 736) + 8048LL) = v27;
v28 = GJEffectManager::getColorSprite(a3, 1006);
*((_QWORD *)v27 + 18) = v28;
*((_QWORD *)v28 + 43) = v27;
}
*(_WORD *)(v27 + 75) = v25;
v27[77] = v26;
v29 = *(_QWORD *)(a1 + 3512);
v30 = *(_WORD *)(v29 + 2706);
v31 = *(_BYTE *)(v29 + 2708);
v32 = GJEffectManager::getColorSprite(a3, 1005);
*((_WORD *)v32 + 162) = v30;
v32[326] = v31;
v33 = *(_QWORD *)(a1 + 3512);
v34 = *(_WORD *)(v33 + 2706);
v35 = *(_BYTE *)(v33 + 2708);
v36 = GJEffectManager::getColorSprite(a3, 1005);
*(_WORD *)(v36 + 327) = v34;
v36[329] = v35;
v37 = *(_QWORD *)(a1 + 3512);
v38 = *(_WORD *)(v37 + 2709);
v39 = *(_BYTE *)(v37 + 2711);
v40 = GJEffectManager::getColorSprite(a3, 1006);
*((_WORD *)v40 + 162) = v38;
v40[326] = v39;
v41 = *(_QWORD *)(a1 + 3512);
v42 = *(_WORD *)(v41 + 2709);
v43 = *(_BYTE *)(v41 + 2711);
v44 = GJEffectManager::getColorSprite(a3, 1006);
*(_WORD *)(v44 + 327) = v42;
v44[329] = v43;
v45 = GJEffectManager::getColorSprite(*(_QWORD *)(a1 + 2408), 1005);
if ( v45 )
{
v46 = *(_WORD *)(v45 + 327);
v47 = v45[329];
}
else
{
v46 = -1;
v47 = -1;
}
v50 = v46;
v48 = *(_QWORD *)(a1 + 2408);
v51 = v47;
return GJEffectManager::calculateLightBGColor(v48, (__int64)&v50);
}