aboutsummaryrefslogtreecommitdiff
path: root/src/engine/draw_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/draw_screen.c')
-rw-r--r--src/engine/draw_screen.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/draw_screen.c b/src/engine/draw_screen.c
index 58553bd..0c31bf6 100644
--- a/src/engine/draw_screen.c
+++ b/src/engine/draw_screen.c
@@ -3,7 +3,7 @@
uint8_t hh_world_to_tile(vec2 pos){
//TODO: remove magic file name here
- FILE* level = fopen("static/tiles.bin", "rb"); /* open binary file */
+ FILE* level = fopen("static/level1_test.bin", "rb"); /* open binary file */
if (!level) { /* check if file opened successfully */
fprintf(stderr, "Error: Failed to open file.\n");
return 0;
@@ -61,7 +61,6 @@ void hh_setup_screen(){
}
free(tile);
}
-
void hh_clear_screen(){
// (HH_PPU_SCREEN_HEIGHT*HH_PPU_SCREEN_WIDTH)/(HH_PPU_SPRITE_HEIGHT*HH_PPU_SPRITE_WIDTH)
for (int i = 0; i < HH_PPU_BG_CANVAS_TILES_H*HH_PPU_BG_CANVAS_TILES_V; i++) {
@@ -82,6 +81,9 @@ void hh_clear_screen(){
void hh_clear_sprite(){
for (int i = 0; i < HH_PPU_FG_SPRITE_COUNT; i++) {
- hh_ppu_update_sprite(i,(hh_s_ppu_loc_sprite){0});
+ hh_ppu_update_foreground(i,(hh_s_ppu_loc_fam_entry){
+ .position_x = -16,
+ .position_y = -16,
+ });
}
}