diff options
Diffstat (limited to 'src/engine/level_const.c')
-rw-r--r-- | src/engine/level_const.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/engine/level_const.c b/src/engine/level_const.c index 5ba0187..3847ad8 100644 --- a/src/engine/level_const.c +++ b/src/engine/level_const.c @@ -1,5 +1,6 @@ #include "engine/level_const.h" +#include <stdio.h> hh_g_all_levels hh_init_game_levels(){ hh_g_all_levels levels; @@ -14,6 +15,10 @@ hh_g_all_levels hh_init_game_levels(){ levels.level[1].hh_level_completed=false; FILE *fp = fopen("../test/bin/level1_test.bin", "rb"); + if (fp == NULL) { + printf("level1_test.bin not found!\n"); + return levels; + } fseek(fp, 0, SEEK_END); int size = ftell(fp) / sizeof(int); fseek(fp, (0 * sizeof(int)) + sizeof(int), SEEK_SET); @@ -22,6 +27,10 @@ hh_g_all_levels hh_init_game_levels(){ fclose(fp); FILE *lvl2 = fopen("../test/bin/level2_test.bin", "rb"); + if (lvl2 == NULL) { + printf("level2_test.bin not found!\n"); + return levels; + } fseek(lvl2, 0, SEEK_END); size = ftell(lvl2) / sizeof(int); fseek(lvl2, (0 * sizeof(int)) + sizeof(int), SEEK_SET); |