diff options
Diffstat (limited to 'src/engine/draw_screen.c')
-rw-r--r-- | src/engine/draw_screen.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/engine/draw_screen.c b/src/engine/draw_screen.c index 43d3cd4..c4f3389 100644 --- a/src/engine/draw_screen.c +++ b/src/engine/draw_screen.c @@ -19,6 +19,7 @@ uint8_t hh_world_to_tile(vec2 pos){ return tile; } + // remeber old value to know which part to update. vec2 previousViewport = { .x = 0, .y = 0 }; void hh_draw_screen(vec_cor viewport){ @@ -59,52 +60,3 @@ void hh_setup_screen(){ } free(tile); } - -void hh_setup_startingScreen(){ - return; - int size = 300; // 40 x as tiles 30 y as tiles - FILE* level = fopen("../test/bin/startingScreen.bin", "rb"); /* open binary file */ - if (!level) { /* check if file opened successfully */ - fprintf(stderr, "Error: Failed to open file. AAAA\n"); - return; - } - fseek(level, (0* sizeof(int)) + sizeof(int), SEEK_SET); - int* tile = (int*)malloc(size*sizeof(int)); - fread(tile, sizeof(int), size, level); // read 1 tile from binary - - fclose(level); - - for(int BAM_index = 0; BAM_index < size; BAM_index++){ - hh_ppu_update_background(BAM_index, (hh_s_ppu_loc_bam_entry){ - .horizontal_flip = false, - .vertical_flip = false, - .palette_index = hh_get_palette(tile[BAM_index]), - .tilemap_index = tile[BAM_index], - }); - } - free(tile); -} - -void hh_setup_shopScreen(){ - int size = 300; // 40 x as tiles 30 y as tiles - FILE* level = fopen("../test/bin/shopScreen.bin", "rb"); /* open binary file */ - if (!level) { /* check if file opened successfully */ - fprintf(stderr, "Error: Failed to open file.\n"); - return; - } - fseek(level, (0* sizeof(int)) + sizeof(int), SEEK_SET); - int* tile = (int*)malloc(size*sizeof(int)); - fread(tile, sizeof(int), size, level); // read 1 tile from binary - - fclose(level); - - for(int BAM_index = 0; BAM_index < size; BAM_index++){ - hh_ppu_update_background(BAM_index, (hh_s_ppu_loc_bam_entry){ - .horizontal_flip = false, - .vertical_flip = false, - .palette_index = hh_get_palette(tile[BAM_index]), - .tilemap_index = tile[BAM_index], - }); - } - free(tile); -} |