//
// GameObject::getRelativeSpriteColor from 0x1401a1ab0 to 0x1401a1b1a (106 bytes)
//
// 7 xrefs:
// > ConfigureHSVWidget::getHSV @ 0x140098244
// > CustomizeObjectLayer::hsvPopupClosed @ 0x1400a8de9
// > CustomizeObjectLayer::getActiveMode @ 0x1400a93eb
// > CustomizeObjectLayer::updateSelected @ 0x1400a9d9b
// > CustomizeObjectLayer::updateSelected @ 0x1400a9e5c
// > GameObject::setupCustomSprites @ 0x1401c2222
// > HSVLiveOverlay::hsvChanged @ 0x1402ba366
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GJSpriteColor *GameObject::getRelativeSpriteColor(GameObject *a1, int a2)
{
__int16 m_customColorType; // ax
bool m_maybeNotColorable; // al
int m_defaultColorID; // edx
bool v6; // al
m_customColorType = a1->m_customColorType;
if ( m_customColorType )
m_maybeNotColorable = m_customColorType == 1;
else
m_maybeNotColorable = a1->m_maybeNotColorable;
v6 = false;
if ( !m_maybeNotColorable && !a1->m_colorSprite )
{
m_defaultColorID = a1->m_baseColor->m_defaultColorID;
if ( m_defaultColorID != 1004 )
{
if ( m_defaultColorID )
v6 = true;
}
}
if ( a2 == 2 )
{
if ( !v6 )
return a1->m_detailColor;
}
else if ( v6 )
{
return nullptr;
}
return a1->m_baseColor;
}