//
// GameObject::duplicateColorMode from 0x10069b980 to 0x10069ba2d (173 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::copyObjectState @ 0x1000c79f0
// > LevelEditorLayer::pasteColorState @ 0x1000c7b75
// > LevelEditorLayer::pasteColorState @ 0x1000c7bc2
// > EditorUI::createRockEdges @ 0x1006f0eee
//
// 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:35:16 +0000
//
__int64 __fastcall GameObject::duplicateColorMode(__int64 a1, __int64 a2)
{
__int64 v2; // rcx
__int64 result; // rax
__int64 v4; // rdx
int v5; // esi
int v6; // r8d
int v7; // esi
__int64 v8; // rcx
int v9; // edx
int v10; // esi
int v11; // edx
v2 = *(_QWORD *)(a2 + 1096);
result = *(_QWORD *)(a2 + 1104);
if ( *(_BYTE *)(a1 + 1038) == 1 && *(_QWORD *)(a1 + 1104) == 0 && result != 0 && *(_QWORD *)result )
v2 = *(_QWORD *)(a2 + 1104);
v4 = *(_QWORD *)(a1 + 1096);
v5 = *(_DWORD *)v2;
if ( !*(_DWORD *)v2 )
v5 = *(_DWORD *)(v2 + 4);
v6 = 0;
if ( v5 > 0 )
v6 = v5;
v7 = 1101;
if ( v6 < 1101 )
v7 = v6;
*(_DWORD *)v4 = v7;
*(_OWORD *)(v4 + 16) = *(_OWORD *)(v2 + 16);
if ( result )
{
v8 = *(_QWORD *)(a1 + 1104);
if ( v8 )
{
v9 = *(_DWORD *)result;
if ( !*(_DWORD *)result )
v9 = *(_DWORD *)(result + 4);
v10 = 0;
if ( v9 > 0 )
v10 = v9;
v11 = 1101;
if ( v10 < 1101 )
v11 = v10;
*(_DWORD *)v8 = v11;
*(_OWORD *)(v8 + 16) = *(_OWORD *)(result + 16);
}
}
return result;
}