//
// GameObject::saveActiveColors from 0x1005c8bd0 to 0x1005c8d54 (388 bytes)
//
// 6 xrefs:
// > EnhancedGameObject::saveActiveColors @ 0x1005cc309
// > ??> @ 0x1008c7eb0
// > ??> @ 0x100923978
// > ??> @ 0x100933d40
// > ??> @ 0x100971a28
// > ??> @ 0x100972a20
//
// 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
//
void __fastcall GameObject::saveActiveColors(GameObject *a1)
{
GJSpriteColor *m_baseColor; // rax
int m_defaultColorID; // ecx
unsigned int m_colorID; // edx
GJSpriteColor *m_detailColor; // rsi
bool v5; // cl
GameObjectType m_objectType; // eax
int v7; // edx
a1->m_savedObjectType = a1->m_objectType;
m_baseColor = a1->m_baseColor;
m_defaultColorID = 0;
m_colorID = 0;
if ( m_baseColor )
{
m_colorID = m_baseColor->m_colorID;
if ( !m_baseColor->m_colorID )
m_colorID = m_baseColor->m_defaultColorID;
}
m_detailColor = a1->m_detailColor;
if ( m_detailColor )
{
m_defaultColorID = m_detailColor->m_colorID;
if ( !m_detailColor->m_colorID )
m_defaultColorID = m_detailColor->m_defaultColorID;
}
*(_QWORD *)&a1->m_activeMainColorID = _mm_min_epi32(
_mm_max_epi32(
(__m128i)0LL,
_mm_insert_epi32(_mm_cvtsi32_si128(m_colorID), m_defaultColorID, 1)),
(__m128i)xmmword_10081F400).u64[0];
a1->m_baseUsesHSV = m_baseColor->m_usesHSV;
if ( m_detailColor )
{
a1->m_detailUsesHSV = m_detailColor->m_usesHSV;
if ( GameManager::sharedState()->m_editorEnabled )
goto LABEL_10;
goto LABEL_9;
}
a1->m_detailUsesHSV = 0;
if ( !GameManager::sharedState()->m_editorEnabled )
{
LABEL_9:
a1->m_mainActionSprite = GJEffectManager::getColorSprite(a1->m_goEffectManager, a1->m_activeMainColorID);
a1->m_detailActionSprite = GJEffectManager::getColorSprite(a1->m_goEffectManager, a1->m_activeDetailColorID);
}
LABEL_10:
if ( !a1->m_isDontEnter )
{
if ( !a1->m_isDontFade )
goto LABEL_12;
LABEL_15:
a1->m_ignoreFade = 1;
if ( a1->m_isNoTouch )
goto LABEL_13;
goto LABEL_16;
}
a1->m_ignoreEnter = 1;
if ( a1->m_isDontFade )
goto LABEL_15;
LABEL_12:
if ( a1->m_isNoTouch )
{
LABEL_13:
a1->m_objectType = Decoration;
v5 = 1;
m_objectType = Decoration;
goto LABEL_18;
}
LABEL_16:
m_objectType = a1->m_objectType;
v5 = 1;
if ( (unsigned int)m_objectType <= Slope )
{
v7 = 35651585;
v5 = !_bittest(&v7, m_objectType);
}
LABEL_18:
a1->m_canRotateFree = v5;
a1->m_isDecoration = m_objectType == Decoration;
a1->m_isDecoration2 = m_objectType == Decoration;
if ( a1->m_isHide && !a1->m_editorEnabled )
a1->m_isInvisible = 1;
}