From 24220135c425966213783105c35af74254bc047b Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 16 Jan 2019 21:14:43 +0900 Subject: [PATCH 1/1] =?utf8?q?[Refactor]=20#37353=20=E5=9E=8B=E3=81=AE?= =?utf8?q?=E7=BD=AE=E6=8F=9B(cave.c)=20/=20Type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 27 +++++++++++---------------- src/externs.h | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/cave.c b/src/cave.c index a15f0f623..7c531ece8 100644 --- a/src/cave.c +++ b/src/cave.c @@ -1361,13 +1361,8 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, if (player_bold(y, x)) { monster_race *r_ptr = &r_info[0]; - - /* Get the "player" attr */ *ap = r_ptr->x_attr; - - /* Get the "player" char */ *cp = r_ptr->x_char; - feat_priority = 31; } } @@ -1401,7 +1396,7 @@ void move_cursor_relative(int row, int col) /* * Place an attr/char pair at the given map coordinate, if legal. */ -void print_rel(char c, byte a, TERM_LEN y, TERM_LEN x) +void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x) { /* Only do "legal" locations */ if (panel_contains(y, x)) @@ -1561,10 +1556,10 @@ void display_dungeon(void) { TERM_LEN x, y; TERM_COLOR a; - char c; + SYMBOL_CODE c; TERM_COLOR ta = 0; - char tc = '\0'; + SYMBOL_CODE tc = '\0'; for (x = p_ptr->x - Term->wid / 2 + 1; x <= p_ptr->x + Term->wid / 2; x++) { @@ -1619,10 +1614,10 @@ void lite_spot(POSITION y, POSITION x) if (panel_contains(y, x) && in_bounds2(y, x)) { TERM_COLOR a; - char c; + SYMBOL_CODE c; TERM_COLOR ta; - char tc; + SYMBOL_CODE tc; /* Examine the grid */ map_info(y, x, &a, &c, &ta, &tc); @@ -1902,23 +1897,23 @@ void display_map(int *cy, int *cx) int i, j, x, y; TERM_COLOR ta; - char tc; + SYMBOL_CODE tc; byte tp; TERM_COLOR **bigma; - char **bigmc; + SYMBOL_CODE **bigmc; byte **bigmp; TERM_COLOR **ma; - char **mc; + SYMBOL_CODE **mc; byte **mp; /* Save lighting effects */ bool old_view_special_lite = view_special_lite; bool old_view_granite_lite = view_granite_lite; - int hgt, wid, yrat, xrat; + TERM_LEN hgt, wid, yrat, xrat; int **match_autopick_yx; object_type ***object_autopick_yx; @@ -2148,7 +2143,7 @@ void display_map(int *cy, int *cx) { /* Free one row each array */ C_KILL(ma[y], (wid + 2), TERM_COLOR); - C_KILL(mc[y], (wid + 2), char); + C_KILL(mc[y], (wid + 2), SYMBOL_CODE); C_KILL(mp[y], (wid + 2), byte); C_KILL(match_autopick_yx[y], (wid + 2), int); C_KILL(object_autopick_yx[y], (wid + 2), object_type *); @@ -2166,7 +2161,7 @@ void display_map(int *cy, int *cx) { /* Free one row each array */ C_KILL(bigma[y], (cur_wid + 2), TERM_COLOR); - C_KILL(bigmc[y], (cur_wid + 2), char); + C_KILL(bigmc[y], (cur_wid + 2), SYMBOL_CODE); C_KILL(bigmp[y], (cur_wid + 2), byte); } diff --git a/src/externs.h b/src/externs.h index 0ddb9e56f..dc7c25e5d 100644 --- a/src/externs.h +++ b/src/externs.h @@ -486,7 +486,7 @@ extern bool no_lite(void); extern void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], SYMBOL_CODE f_char[F_LIT_MAX]); extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, char *tcp); extern void move_cursor_relative(int row, int col); -extern void print_rel(char c, byte a, TERM_LEN y, TERM_LEN x); +extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x); extern void note_spot(POSITION y, POSITION x); extern void display_dungeon(void); extern void lite_spot(POSITION y, POSITION x); -- 2.11.0