From 8c3bcbce8599f1f8262e82a32a75a3f21c0bf8ff Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 23 Nov 2023 09:16:53 +0100 Subject: [PATCH] fix: animation_sprite_new now returns self --- core/src/animation_sprite.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/animation_sprite.c b/core/src/animation_sprite.c index 53f972b..9c9e240 100644 --- a/core/src/animation_sprite.c +++ b/core/src/animation_sprite.c @@ -23,6 +23,8 @@ AnimationSprite* animation_sprite_new(Spritesheet* sheet, float framerate) { .start_time = game_time(), .sprite = sprite_from_spritesheet(sheet, 0) }; + + return self; } void animation_sprite_destroy(AnimationSprite* self) { @@ -52,6 +54,6 @@ void animation_sprite_set_framerate(AnimationSprite* self, float framerate) { self->frame_interval = 1.0f / framerate; } -float animation_sprite_get_framerate(AnimationSprite* self) { +float animation_sprite_get_framerate(const AnimationSprite* self) { return 1.0f / self->frame_interval; }