summaryrefslogtreecommitdiff
path: root/Week1-Pacman/src/animation.c
diff options
context:
space:
mode:
Diffstat (limited to 'Week1-Pacman/src/animation.c')
-rw-r--r--Week1-Pacman/src/animation.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Week1-Pacman/src/animation.c b/Week1-Pacman/src/animation.c
index 7e4bb57..50f5c6c 100644
--- a/Week1-Pacman/src/animation.c
+++ b/Week1-Pacman/src/animation.c
@@ -17,7 +17,11 @@ void init_animation(struct animation* animation,
exit(1);
}
- animation->texture = IMG_LoadTexture(init->ren, init->spritesheet);
+ if(init->spritesheet_texture == NULL) {
+ animation->texture = IMG_LoadTexture(init->ren, init->spritesheet);
+ } else {
+ animation->texture = init->spritesheet_texture;
+ }
if(animation->texture == NULL) {
printf("Failed to load spritesheet %s, error: %s, exitting!\n",