Hue fading
This commit is contained in:
parent
37c30e1cb2
commit
cbd6433a30
|
@ -678,7 +678,7 @@ AnimationSystem_Init(animation_system_desc Desc)
|
||||||
Result.ActiveFadeGroup.FadeElapsed = 0;
|
Result.ActiveFadeGroup.FadeElapsed = 0;
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
Result.Multithreaded = true;
|
Result.Multithreaded = false;
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,17 @@ LerpPHue(r32 T, p_hue A, p_hue B)
|
||||||
{
|
{
|
||||||
Result.Hue = LerpR64(T, A.Hue, B.Hue);
|
Result.Hue = LerpR64(T, A.Hue, B.Hue);
|
||||||
}
|
}
|
||||||
|
else if (B.Hue > A.Hue)
|
||||||
|
{
|
||||||
|
Result.Hue = LerpR64(T, A.Hue, B.Hue - 360.0f);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Result.Hue = LerpR64(T, A.Hue + 360.0f, B.Hue);
|
Result.Hue = LerpR64(T, A.Hue - 360.0f, B.Hue);
|
||||||
Result.Hue = ModR32(Result.Hue, 360.0f);
|
|
||||||
}
|
}
|
||||||
|
if (Result.Hue < 360) Result.Hue += 360;
|
||||||
|
if (Result.Hue > 360) Result.Hue -= 360;
|
||||||
|
Result.Hue = Clamp(0, Result.Hue, 360);
|
||||||
|
|
||||||
if (T < 0.5f)
|
if (T < 0.5f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue