//
// ConfigureHSVWidget::textChanged from 0x100431320 to 0x100431548 (552 bytes)
//
// 2 xrefs:
// > sub_100431570 @ 0x10043157c
// > ??> @ 0x100936548
//
// 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 ConfigureHSVWidget::textChanged(ConfigureHSVWidget *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int v4; // eax
int v5; // r14d
const char *v6; // rdi
const char *v7; // rdi
cocos2d::CCString *v8; // rax
float v9; // xmm0_4
cocos2d::CCString *v10; // rax
float v11; // xmm0_4
void *v12; // r15
int v13; // eax
int v14; // ecx
Slider *m_hueSlider; // r14
float v16; // xmm0_4
Slider *m_saturationSlider; // r14
float s; // xmm0_4
float v19; // xmm0_4
Slider *m_brightnessSlider; // r14
float v; // xmm0_4
float v22; // xmm0_4
char v23; // [rsp+0h] [rbp-40h]
void *v24[2]; // [rsp+8h] [rbp-38h] BYREF
void *__p; // [rsp+18h] [rbp-28h]
float v26; // [rsp+24h] [rbp-1Ch]
if ( !a1->m_updating )
{
v4 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
switch ( v4 )
{
case 3:
CCTextInputNode::getString(v24, (__int64)a2, v2);
if ( ((__int64)v24[0] & 1) != 0 )
v7 = (const char *)__p;
else
v7 = (char *)v24 + 1;
atof(v7);
v10 = (cocos2d::CCString *)sub_1007AB580("%.2f", v23);
v11 = cocos2d::CCString::floatValue(v10);
if ( ((__int64)v24[0] & 1) != 0 )
{
v26 = v11;
operator delete(__p);
v11 = v26;
}
a1->m_hsv.v = v11;
break;
case 2:
CCTextInputNode::getString(v24, (__int64)a2, v2);
if ( ((__int64)v24[0] & 1) != 0 )
v6 = (const char *)__p;
else
v6 = (char *)v24 + 1;
atof(v6);
v8 = (cocos2d::CCString *)sub_1007AB580("%.2f", v23);
v9 = cocos2d::CCString::floatValue(v8);
if ( ((__int64)v24[0] & 1) != 0 )
{
v26 = v9;
operator delete(__p);
v9 = v26;
}
a1->m_hsv.s = v9;
break;
case 1:
CCTextInputNode::getString(v24, (__int64)a2, v2);
if ( ((__int64)v24[0] & 1) != 0 )
{
v12 = __p;
v5 = atoi((const char *)__p);
operator delete(v12);
}
else
{
v5 = atoi((const char *)v24 + 1);
}
v13 = -360;
if ( v5 >= -359 )
v13 = v5;
v14 = 360;
if ( v13 < 360 )
v14 = v13;
a1->m_hsv.h = (float)v14;
break;
}
m_hueSlider = a1->m_hueSlider;
v16 = cocos2d::clampf((float)(a1->m_hsv.h + 180.0) / 360.0, 0.0, 1.0);
Slider::setValue(m_hueSlider, v16);
m_saturationSlider = a1->m_saturationSlider;
s = a1->m_hsv.s;
if ( a1->m_hsv.absoluteSaturation )
s = s + 1.0;
v19 = cocos2d::clampf(s * 0.5, 0.0, 1.0);
Slider::setValue(m_saturationSlider, v19);
m_brightnessSlider = a1->m_brightnessSlider;
v = a1->m_hsv.v;
if ( a1->m_hsv.absoluteBrightness )
v = v + 1.0;
v22 = cocos2d::clampf(v * 0.5, 0.0, 1.0);
Slider::setValue(m_brightnessSlider, v22);
}
}