//
// CreateParticlePopup::onSelectColor from 0x100467ac0 to 0x100467ba0 (224 bytes)
//
// 3 xrefs:
// > CreateParticlePopup::init @ 0x100463963
// > CreateParticlePopup::init @ 0x100464779
// > CreateParticlePopup::init @ 0x1004648da
//
// 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:30:29 +0000
//
__int64 __fastcall CreateParticlePopup::onSelectColor(__int64 a1, __int64 a2)
{
__int64 v3; // rdi
int v4; // eax
unsigned __int16 *v5; // rax
float *v6; // rax
_QWORD *v7; // r15
unsigned int v8; // eax
v3 = a2;
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
switch ( v4 )
{
case 2:
v6 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 712) + 1384LL))(*(_QWORD *)(a1 + 712));
goto LABEL_7;
case 1:
v6 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 712) + 1352LL))(*(_QWORD *)(a1 + 712));
LABEL_7:
v3 = ((int)(float)(255.0 * v6[2]) << 16)
| ((unsigned __int8)(int)(float)(_mm_movehdup_ps((__m128)*(unsigned __int64 *)v6).f32[0] * 255.0) << 8)
| (unsigned int)(unsigned __int8)(int)(float)(COERCE_FLOAT(*(_QWORD *)v6) * 255.0);
break;
case 0:
v5 = (unsigned __int16 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 792) + 1200LL))(*(_QWORD *)(a1 + 792));
v3 = *v5 | (*((unsigned __int8 *)v5 + 2) << 16);
break;
}
v7 = (_QWORD *)ColorSelectPopup::create_2(v3);
v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
(*(void (__fastcall **)(_QWORD *, _QWORD))(*v7 + 72LL))(v7, v8);
v7[140] = a1 + 664;
return (*(__int64 (__fastcall **)(_QWORD *))(*v7 + 1312LL))(v7);
}