streamline the tty perm_invent bounder box set up

For the tty perm_invent boundary box initialiation, instead of doing
one of many assignments that do glyph lookup, do one of many symbol
assignments and one glyph lookup.  No change in observable behavior.

Also, use the main dungeon's walls for box rendering instead of
selecting ones for whatever branch the hero happens to be in at the
time perm_invent gets enabled.
This commit is contained in:
PatR
2022-06-24 23:35:26 -07:00
parent 1967b7616e
commit cde9b7e481
2 changed files with 29 additions and 18 deletions

View File

@@ -582,6 +582,8 @@ enum glyph_offsets {
: ((expltyp) == EXPL_NOXIOUS) ? GLYPH_EXPLODE_NOXIOUS_OFF \
: GLYPH_EXPLODE_FIERY_OFF))
/* cmap_walls_to_glyph(): return the glyph number for specified wall
symbol; result varies by dungeon branch */
#define cmap_walls_to_glyph(cmap_idx) \
((cmap_idx) - S_vwall \
+ (In_mines(&u.uz) ? GLYPH_CMAP_MINES_OFF \
@@ -590,6 +592,12 @@ enum glyph_offsets {
: In_sokoban(&u.uz) ? GLYPH_CMAP_SOKO_OFF \
: GLYPH_CMAP_MAIN_OFF))
/* cmap_D0walls_to_glyph(): simpler version of cmap_walls_to_glyph()
which returns the glyph that would be used in the main dungeon,
regardless of hero's current location */
#define cmap_D0walls_to_glyph(cmap_idx) \
((cmap_idx) - S_vwall + GLYPH_CMAP_MAIN_OFF)
#define cmap_a_to_glyph(cmap_idx) \
(((cmap_idx) - S_ndoor) + GLYPH_CMAP_A_OFF)