//
// GameObject::duplicateColorMode from 0x14029eab0 to 0x14029eb8a (218 bytes)
//
// 8 xrefs:
// > CustomizeObjectLayer::onPaste @ 0x14014218c
// > CustomizeObjectLayer::onPaste @ 0x1401421d2
// > EditorUI::onPasteColor @ 0x1401c737a
// > EditorUI::onPasteColor @ 0x1401c73ba
// > EditorUI::createRockEdges @ 0x1401fa0fe
// > GameObject::duplicateValues @ 0x14029ed9e
// > LevelEditorLayer::copyObjectState @ 0x140400d76
// > ??> @ 0x14091d918
//
// 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:29:15 +0000
//
__int64 __fastcall GameObject::duplicateColorMode(__int64 a1, __int64 a2)
{
__int64 v3; // r10
__int64 v4; // r8
int v5; // eax
int v6; // eax
int v7; // ecx
__int64 result; // rax
int *v9; // r10
int v10; // eax
int v11; // edx
bool v12; // sf
v3 = *(_QWORD *)(a2 + 1104);
v4 = *(_QWORD *)(a2 + 1112);
if ( *(_BYTE *)(a1 + 1046) && !*(_QWORD *)(a1 + 1112) && v4 )
{
if ( (v5 = *(_DWORD *)(v4 + 4), v5 != *(_DWORD *)v4) && *(_DWORD *)v4 || v5 )
v3 = *(_QWORD *)(a2 + 1112);
}
v6 = *(_DWORD *)v3;
if ( *(_DWORD *)(v3 + 4) == *(_DWORD *)v3 || !v6 )
v6 = *(_DWORD *)(v3 + 4);
v7 = 1101;
if ( v6 < 0 )
v6 = 0;
if ( v6 > 1101 )
v6 = 1101;
**(_DWORD **)(a1 + 1104) = v6;
result = *(_QWORD *)(a1 + 1104);
*(_OWORD *)(result + 16) = *(_OWORD *)(v3 + 16);
if ( v4 )
{
v9 = *(int **)(a1 + 1112);
if ( v9 )
{
v10 = *(_DWORD *)v4;
v11 = *(_DWORD *)(v4 + 4);
if ( v11 == *(_DWORD *)v4 || (v12 = v10 < 0, !v10) )
{
v10 = *(_DWORD *)(v4 + 4);
v12 = v11 < 0;
}
if ( v12 )
v10 = 0;
if ( v10 <= 1101 )
{
v7 = v10;
if ( v10 < 0 )
v7 = 1011;
}
*v9 = v7;
result = *(_QWORD *)(a1 + 1112);
*(_OWORD *)(result + 16) = *(_OWORD *)(v4 + 16);
}
}
return result;
}