formatting

This commit is contained in:
briaguya 2022-06-03 14:59:06 -04:00
commit 08364154d4

View file

@ -272,8 +272,8 @@ namespace SohImGui {
std::string Cvar_RBM = cvarName; std::string Cvar_RBM = cvarName;
Cvar_RBM += "RBM"; Cvar_RBM += "RBM";
std::string RBM_HUE = cvarName; std::string RBM_HUE = cvarName;
RBM_HUE+="Hue"; RBM_HUE += "Hue";
f32 Canon = 10.f*s; f32 Canon = 10.f * s;
ImVec4 NewColor; ImVec4 NewColor;
const f32 deltaTime = 1.0f / ImGui::GetIO().Framerate; const f32 deltaTime = 1.0f / ImGui::GetIO().Framerate;
f32 hue = CVar_GetFloat(RBM_HUE.c_str(), 0.0f); f32 hue = CVar_GetFloat(RBM_HUE.c_str(), 0.0f);
@ -285,7 +285,7 @@ namespace SohImGui {
u8 i = current_hue / 60 + 1; u8 i = current_hue / 60 + 1;
u8 a = (-current_hue / 60.0f + i) * 255; u8 a = (-current_hue / 60.0f + i) * 255;
u8 b = (current_hue / 60.0f + (1 - i)) * 255; u8 b = (current_hue / 60.0f + (1 - i)) * 255;
switch (i) { switch (i) {
case 1: NewColor.x = 255; NewColor.y = b; NewColor.z = 0; break; case 1: NewColor.x = 255; NewColor.y = b; NewColor.z = 0; break;
case 2: NewColor.x = a; NewColor.y = 255; NewColor.z = 0; break; case 2: NewColor.x = a; NewColor.y = 255; NewColor.z = 0; break;
@ -295,10 +295,10 @@ namespace SohImGui {
case 6: NewColor.x = 255; NewColor.y = 0; NewColor.z = a; break; case 6: NewColor.x = 255; NewColor.y = 0; NewColor.z = a; break;
} }
if(CVar_GetS32(Cvar_RBM.c_str(), 0) != 0) { if (CVar_GetS32(Cvar_RBM.c_str(), 0) != 0) {
CVar_SetS32(Cvar_Red.c_str(), ClampFloatToInt(NewColor.x,0,255)); CVar_SetS32(Cvar_Red.c_str(), ClampFloatToInt(NewColor.x, 0, 255));
CVar_SetS32(Cvar_Green.c_str(), ClampFloatToInt(NewColor.y,0,255)); CVar_SetS32(Cvar_Green.c_str(), ClampFloatToInt(NewColor.y, 0, 255));
CVar_SetS32(Cvar_Blue.c_str(), ClampFloatToInt(NewColor.z,0,255)); CVar_SetS32(Cvar_Blue.c_str(), ClampFloatToInt(NewColor.z, 0, 255));
} }
} }
} }