//
// GameToolbox::getMultipliedHSV from 0x1004efec0 to 0x1004eff55 (149 bytes)
//
// 4 xrefs:
// > PlayLayer::applyCustomEnterEffect @ 0x1000b84a8
// > GJBaseGameLayer::processAreaTintGroupAction @ 0x100142c44
// > GJEffectManager::calculateInheritedColor @ 0x1002df2f0
// > GJEffectManager::colorForPulseEffect @ 0x1002df50e
//
// 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
//
cocos2d::ccHSVValue __fastcall GameToolbox::getMultipliedHSV(const cocos2d::ccHSVValue *a1, float a2)
{
__m128 v3; // xmm0
__int64 absoluteSaturation; // rcx
__int64 absoluteBrightness; // rsi
__m128 v6; // xmm2
float v; // eax
__m128i v8; // xmm3
cocos2d::ccHSVValue result; // 0:xmm0_8.8,8:rax.8
v3 = (__m128)*(unsigned __int64 *)&a1->h;
absoluteSaturation = a1->absoluteSaturation;
absoluteBrightness = a1->absoluteBrightness;
if ( (absoluteSaturation & 1) == 0 )
{
v6 = _mm_movehdup_ps(v3);
v6.f32[0] = (float)(v6.f32[0] * a2) + (float)(1.0 - a2);
v = a1->v;
if ( (absoluteBrightness & 1) == 0 )
goto LABEL_3;
LABEL_5:
v8 = _mm_cvtsi32_si128(LODWORD(v));
*(float *)v8.i32 = *(float *)v8.i32 * a2;
goto LABEL_6;
}
v6 = _mm_movehdup_ps(v3);
v6.f32[0] = v6.f32[0] * a2;
v = a1->v;
if ( (absoluteBrightness & 1) != 0 )
goto LABEL_5;
LABEL_3:
v8 = _mm_cvtsi32_si128(LODWORD(v));
*(float *)v8.i32 = (float)(*(float *)v8.i32 * a2) + (float)(1.0 - a2);
LABEL_6:
v3.f32[0] = v3.f32[0] * a2;
v3.i64[0] = _mm_insert_ps(v3, v6, 16).u64[0];
*(_QWORD *)&result.v = ((unsigned __int64)*(unsigned __int16 *)a1->__pad << 48)
| (absoluteBrightness << 40)
| (absoluteSaturation << 32)
| (unsigned int)_mm_cvtsi128_si32(v8);
result.h = v3.f32[0];
result.s = v3.f32[1];
return result;
}