From d7a616284fe3d82de5dfb73d5af320e137381ddd Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 13 Jan 2026 05:55:18 +0100 Subject: [PATCH] map: uncovering now works based entierly on the view range --- assets | 2 +- maps/l1.inc | 6 +++--- src/actor.s | 2 +- src/map.s | 2 +- src/player.s | 20 -------------------- 5 files changed, 6 insertions(+), 26 deletions(-) diff --git a/assets b/assets index 29e2314..b47e4f8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 29e2314c3eb913a6fd39600662306cdf1ebca3f5 +Subproject commit b47e4f809f809de27f2e55f9660ad03dabb8f2be diff --git a/maps/l1.inc b/maps/l1.inc index 6411427..4bb89bc 100644 --- a/maps/l1.inc +++ b/maps/l1.inc @@ -13,7 +13,7 @@ .db 0x0, 0x3, 0x1, 0x3, 0x0, 0x0, 0x0, 0x3, 0x1, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x1, 0x3, 0x0, 0x0, 0x0, 0x3 .db 0x1, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 -.db 0x0, 0x0, 0x0, 0x3, 0x3, 0x3, 0x2, 0x3, 0x3, 0x3, 0x0, 0x3, 0x2, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0 +.db 0x0, 0x0, 0x0, 0x3, 0x3, 0x3, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x2, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x1, 0x1, 0x1, 0x1 .db 0x1, 0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0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x3, 0x3, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x1, 0x1 diff --git a/src/actor.s b/src/actor.s index 6b4bb17..736ca78 100644 --- a/src/actor.s +++ b/src/actor.s @@ -178,7 +178,7 @@ act_d_bat: ld [hl+], a ; flags - xor a, a + ld a, OAM_FPRIO ld [hl], a ret diff --git a/src/map.s b/src/map.s index fe6da99..0ee3ffc 100644 --- a/src/map.s +++ b/src/map.s @@ -281,7 +281,7 @@ map_set_visible_row: ; hl = tile ld a, [hl] - or a, TF0_VISIBLE + or a, TF0_VISIBLE | TF0_UNCOVERED ld [hl], a @skip: diff --git a/src/player.s b/src/player.s index 7855fc8..17b98b9 100644 --- a/src/player.s +++ b/src/player.s @@ -58,23 +58,8 @@ player_update: ld de, player call player_handle_move - - ; check if player is currently in uncovered tile - ld a, [player+act_pos_y] - ld b, a - ld a, [player+act_pos_x] - ld c, a - call map_get_tile - inc hl ; hl = flags - ld a, [hl] - and a, TF0_UNCOVERED - jp z, @need_to_uncover ret -@need_to_uncover: - call map_uncover_player - call map_full_draw - ret ; draws player player_draw: @@ -213,11 +198,6 @@ player_collided: xor a, a ld [hl], a - ld a, [col_y] - ld b, a - ld a, [col_x] - ld c, a - call map_uncover call map_full_draw call player_end_turn ret -- 2.30.2