From 0f25d9fb178e9fb32793331aa1ed724d9747702d Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Sat, 23 Aug 2025 08:58:57 +0300 Subject: Animation System Complete --- include/game.h | 2 +- include/utils.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/game.h b/include/game.h index 530ae73..ec44b3e 100644 --- a/include/game.h +++ b/include/game.h @@ -85,7 +85,7 @@ void UpdateGame(float deltaTime); void DrawGame(); void UpdateCurrentSpriteAnimation(Sprite* sprite, float dt); -void DrawEntitySprite(const Sprite* sprite, int spriteIndex); +void DrawEntitySprite(const Entity* e, int spriteIndex); #ifdef BEATEMUP_DEBUG void DebugHighlights(const Entity* e); diff --git a/include/utils.h b/include/utils.h index 59c1bc4..0ba8c32 100644 --- a/include/utils.h +++ b/include/utils.h @@ -52,4 +52,8 @@ static inline Animation* GetCurrentAnimation(Sprite* s) { return &s->animations[s->currentAnimation]; } +static inline Rectangle GetCurrentSourceRectangle(const Animation* animation) { + return animation->srcRects[animation->currentFrame]; +} + #endif // UTILS_H_ -- cgit v1.2.3