From cbd6433a30b8def5ebbfc95e116d5b13a6425f50 Mon Sep 17 00:00:00 2001 From: PS Date: Fri, 9 Apr 2021 15:45:28 -1000 Subject: [PATCH] Hue fading --- src/app/engine/animation/foldhaus_animation.h | 2 +- src/app/ss_blumen_lumen/phrase_hue_map.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/engine/animation/foldhaus_animation.h b/src/app/engine/animation/foldhaus_animation.h index 313ee68..8ae3430 100644 --- a/src/app/engine/animation/foldhaus_animation.h +++ b/src/app/engine/animation/foldhaus_animation.h @@ -678,7 +678,7 @@ AnimationSystem_Init(animation_system_desc Desc) Result.ActiveFadeGroup.FadeElapsed = 0; // Settings - Result.Multithreaded = true; + Result.Multithreaded = false; return Result; } diff --git a/src/app/ss_blumen_lumen/phrase_hue_map.h b/src/app/ss_blumen_lumen/phrase_hue_map.h index da3516d..3667210 100644 --- a/src/app/ss_blumen_lumen/phrase_hue_map.h +++ b/src/app/ss_blumen_lumen/phrase_hue_map.h @@ -70,11 +70,17 @@ LerpPHue(r32 T, p_hue A, p_hue B) { 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 { - Result.Hue = LerpR64(T, A.Hue + 360.0f, B.Hue); - Result.Hue = ModR32(Result.Hue, 360.0f); + Result.Hue = LerpR64(T, A.Hue - 360.0f, B.Hue); } + 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) {