From: Hourier Date: Sat, 20 Jun 2020 12:05:02 +0000 (+0900) Subject: [Refactor] #40483 Changed panel_contains() from macro function to normal function X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=44ed088c4255d464165d44abffaa68c51606d9ee;p=hengband%2Fhengband.git [Refactor] #40483 Changed panel_contains() from macro function to normal function --- diff --git a/src/grid/grid.c b/src/grid/grid.c index 4dc3e7cf2..c6523c80d 100644 --- a/src/grid/grid.c +++ b/src/grid/grid.c @@ -467,7 +467,7 @@ bool no_lite(player_type *creature_ptr) /* * Place an attr/char pair at the given map coordinate, if legal. */ -void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x) +void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x) { /* Only do "legal" locations */ if (panel_contains(y, x)) diff --git a/src/grid/grid.h b/src/grid/grid.h index 7dedf9a43..5087dc456 100644 --- a/src/grid/grid.h +++ b/src/grid/grid.h @@ -184,7 +184,7 @@ extern bool player_can_enter(player_type *creature_ptr, FEAT_IDX feature, BIT_FL extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2); extern void update_local_illumination(player_type *creature_ptr, POSITION y, POSITION x); extern bool no_lite(player_type *creature_ptr); -extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x); +extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x); extern void note_spot(player_type *player_ptr, POSITION y, POSITION x); extern void lite_spot(player_type *player_ptr, POSITION y, POSITION x); extern void update_flow(player_type *subject_ptr); diff --git a/src/view/display-main-window.c b/src/view/display-main-window.c index 7e67fa3e4..999980500 100644 --- a/src/view/display-main-window.c +++ b/src/view/display-main-window.c @@ -2904,6 +2904,8 @@ void update_playtime(void) } } +bool panel_contains(POSITION y, POSITION x) { return (y >= panel_row_min) && (y <= panel_row_max) && (x >= panel_col_min) && (x <= panel_col_max); } + /* * Delayed visual update * Only used if update_view(), update_lite() or update_mon_lite() was called diff --git a/src/view/display-main-window.h b/src/view/display-main-window.h index 14d552234..6da54bef7 100644 --- a/src/view/display-main-window.h +++ b/src/view/display-main-window.h @@ -41,8 +41,5 @@ extern POSITION panel_col_prt, panel_row_prt; * Determines if a map location is currently "on screen" -RAK- * Note that "panel_contains(Y,X)" always implies "in_bounds2(Y,X)". */ -#define panel_contains(Y,X) \ - (((Y) >= panel_row_min) && ((Y) <= panel_row_max) && \ - ((X) >= panel_col_min) && ((X) <= panel_col_max)) - -extern void delayed_visual_update(player_type *player_ptr); +bool panel_contains(POSITION y, POSITION x); +void delayed_visual_update(player_type *player_ptr);