Skip to content

Commit

Permalink
Use MAP_CONNECTION_PADDING_WIDTH in MACRO connection
Browse files Browse the repository at this point in the history
Fixes #1033
  • Loading branch information
Rangi42 committed Aug 15, 2023
1 parent 9c0ef02 commit f3b3108
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions data/maps/attributes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,52 @@ MACRO connection

; Calculate tile offsets for source (current) and target maps
DEF _src = 0
DEF _tgt = (\4) + 3
DEF _tgt = (\4) + MAP_CONNECTION_PADDING_WIDTH
if _tgt < 0
DEF _src = -_tgt
DEF _tgt = 0
endc

if !STRCMP("\1", "north")
DEF _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
DEF _blk = \3_WIDTH * (\3_HEIGHT - MAP_CONNECTION_PADDING_WIDTH) + _src
DEF _map = _tgt
DEF _win = (\3_WIDTH + 6) * \3_HEIGHT + 1
DEF _win = (\3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * \3_HEIGHT + 1
DEF _y = \3_HEIGHT * 2 - 1
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
DEF _len = CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "south")
DEF _blk = _src
DEF _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
DEF _win = \3_WIDTH + 7
DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * (CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH) + _tgt
DEF _win = \3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2 + 1
DEF _y = 0
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
DEF _len = CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "west")
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - 3
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt
DEF _win = (\3_WIDTH + 6) * 2 - 6
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - MAP_CONNECTION_PADDING_WIDTH
DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * _tgt
DEF _win = (\3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * 2 - MAP_CONNECTION_PADDING_WIDTH * 2
DEF _y = (\4) * -2
DEF _x = \3_WIDTH * 2 - 1
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
DEF _len = CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc

elif !STRCMP("\1", "east")
DEF _blk = (\3_WIDTH * _src)
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
DEF _win = \3_WIDTH + 7
DEF _map = (CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2) * _tgt + CURRENT_MAP_WIDTH + MAP_CONNECTION_PADDING_WIDTH
DEF _win = \3_WIDTH + MAP_CONNECTION_PADDING_WIDTH * 2 + 1
DEF _y = (\4) * -2
DEF _x = 0
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
DEF _len = CURRENT_MAP_HEIGHT + MAP_CONNECTION_PADDING_WIDTH - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc
Expand Down

0 comments on commit f3b3108

Please sign in to comment.