OSDN Git Service

[Refactor] #40483 Changed panel_contains() from macro function to normal function
authorHourier <hourier@users.sourceforge.jp>
Sat, 20 Jun 2020 12:05:02 +0000 (21:05 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 20 Jun 2020 12:05:02 +0000 (21:05 +0900)
src/grid/grid.c
src/grid/grid.h
src/view/display-main-window.c
src/view/display-main-window.h

index 4dc3e7c..c6523c8 100644 (file)
@@ -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))
index 7dedf9a..5087dc4 100644 (file)
@@ -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);
index 7e67fa3..9999805 100644 (file)
@@ -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
index 14d5522..6da54be 100644 (file)
@@ -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);