From c85d87845946a410ccff99f171001322be249b70 Mon Sep 17 00:00:00 2001 From: Katajisto Date: Sun, 2 Nov 2025 10:07:54 +0200 Subject: [PATCH] implement new animation helper --- src/rendering/animation.jai | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rendering/animation.jai b/src/rendering/animation.jai index ece80f5..b11c11c 100644 --- a/src/rendering/animation.jai +++ b/src/rendering/animation.jai @@ -33,6 +33,12 @@ animation_draw :: (player: *Animation_Player, position: Vector3, flipX: bool = f animation_set :: (player: *Animation_Player, animation: string) { player.current_frame = 0; player.current_animation = table_find_pointer(*g_animations, animation); + +} +animation_set_if_not :: (player: *Animation_Player, animation: string) { + if !animation_is(player, animation) { + animation_set(player, animation); + } } animation_is :: (player: *Animation_Player, animation: string) -> bool {