diff options
author | BoredGuy <osome3717@gmail.com> | 2024-12-14 08:16:53 +0300 |
---|---|---|
committer | BoredGuy <osome3717@gmail.com> | 2024-12-14 08:16:53 +0300 |
commit | 36144cc98ed6d96cc4f28e73d8da3434774c5d7a (patch) | |
tree | 947de22d753cdba817bf3de7c48b97de8351c891 /Week1-Pacman/src/animation.h | |
parent | 0979d3fef156da87b906c55621b49634dced28ba (diff) |
Animation system updates
- implement draw_animation
- add dpi scaling
Diffstat (limited to 'Week1-Pacman/src/animation.h')
-rw-r--r-- | Week1-Pacman/src/animation.h | 9 |
1 files changed, 8 insertions, 1 deletions
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 <SDL2/SDL_rect.h> +#include <SDL2/SDL.h> #include <stdbool.h> +#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_ |