From 36144cc98ed6d96cc4f28e73d8da3434774c5d7a Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Sat, 14 Dec 2024 08:16:53 +0300 Subject: Animation system updates - implement draw_animation - add dpi scaling --- Week1-Pacman/src/animation.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Week1-Pacman/src/animation.h') diff --git a/Week1-Pacman/src/animation.h b/Week1-Pacman/src/animation.h index 795b6c7..f225142 100644 --- a/Week1-Pacman/src/animation.h +++ b/Week1-Pacman/src/animation.h @@ -1,10 +1,13 @@ #ifndef ANIMATION_H_ #define ANIMATION_H_ -#include +#include #include +#include "demo.h" struct animation_init { + SDL_Renderer* ren; + const char* spritesheet; int initial_frame_count; float* initial_frame_times; @@ -12,6 +15,7 @@ struct animation_init { }; struct animation { + SDL_Texture* texture; int num_frames; int current_frame; @@ -25,5 +29,8 @@ void init_animation(struct animation* animation, struct animation_init* init); void update_animation(struct animation* animation, float dt); void free_animation(struct animation* animation); +void draw_animation(struct demo* demo, + struct animation* animation, + SDL_Rect* d_rect); #endif // ANIMATION_H_ -- cgit v1.2.3