OSDN Git Service

[Refactor] #38997 verify_panel() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 12:00:32 +0000 (21:00 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 12:00:32 +0000 (21:00 +0900)
src/cmd/cmd-item.c
src/cmd/cmd-pet.c
src/core.c
src/player-move.c
src/targeting.c
src/targeting.h
src/view-mainwindow.c

index 39da131..228cbe5 100644 (file)
@@ -1174,7 +1174,7 @@ void do_cmd_locate(player_type *creature_ptr)
 
 
        /* Recenter the map around the player */
-       verify_panel();
+       verify_panel(creature_ptr);
 
        creature_ptr->update |= (PU_MONSTERS);
        creature_ptr->redraw |= (PR_MAP);
index f345e30..9b56b6b 100644 (file)
@@ -1065,7 +1065,7 @@ bool rakuba(player_type *creature_ptr, HIT_POINT dam, bool force)
                lite_spot(creature_ptr->y, creature_ptr->x);
 
                /* Check for new panel */
-               verify_panel();
+               verify_panel(creature_ptr);
        }
 
        creature_ptr->riding = 0;
index 1d74555..b0ed03f 100644 (file)
@@ -4965,7 +4965,7 @@ static void dungeon(player_type *player_ptr, bool load_game)
        panel_bounds_center();
 
        /* Verify the panel */
-       verify_panel();
+       verify_panel(player_ptr);
 
        msg_erase();
 
index 59a5a1d..11f92e0 100644 (file)
@@ -354,7 +354,7 @@ void py_pickup_aux(player_type *owner_ptr, OBJECT_IDX o_idx)
 void carry(player_type *creature_ptr, bool pickup)
 {
        /* Recenter the map around the player */
-       verify_panel();
+       verify_panel(creature_ptr);
 
        creature_ptr->update |= (PU_MONSTERS);
        creature_ptr->redraw |= (PR_MAP);
@@ -623,7 +623,7 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
                lite_spot(ny, nx);
 
                /* Check for new panel (redraw map) */
-               verify_panel();
+               verify_panel(creature_ptr);
 
                if (mpe_mode & MPE_FORGET_FLOW)
                {
@@ -2247,7 +2247,7 @@ void disturb(player_type *creature_ptr, bool stop_search, bool stop_travel)
                creature_ptr->running = 0;
 
                /* Check for new panel if appropriate */
-               if (center_player && !center_running) verify_panel();
+               if (center_player && !center_running) verify_panel(creature_ptr);
 
                /* Calculate torch radius */
                creature_ptr->update |= (PU_TORCH);
@@ -2263,7 +2263,7 @@ void disturb(player_type *creature_ptr, bool stop_search, bool stop_travel)
                travel.run = 0;
 
                /* Check for new panel if appropriate */
-               if (center_player && !center_running) verify_panel();
+               if (center_player && !center_running) verify_panel(creature_ptr);
 
                /* Calculate torch radius */
                creature_ptr->update |= (PU_TORCH);
index 5ba303a..69d78b5 100644 (file)
@@ -89,6 +89,7 @@ static bool change_panel_xy(player_type *creature_ptr, POSITION y, POSITION x)
 
 /*!
  * @brief マップ描画のフォーカスを当てるべき座標を更新する
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @details
  * Given an row (y) and col (x), this routine detects when a move
  * off the screen has occurred and figures new borders. -RAK-
@@ -96,10 +97,10 @@ static bool change_panel_xy(player_type *creature_ptr, POSITION y, POSITION x)
  * The map is reprinted if necessary, and "TRUE" is returned.
  * @return 実際に再描画が必要だった場合TRUEを返す
  */
-void verify_panel(void)
+void verify_panel(player_type *creature_ptr)
 {
-       POSITION y = p_ptr->y;
-       POSITION x = p_ptr->x;
+       POSITION y = creature_ptr->y;
+       POSITION x = creature_ptr->x;
        TERM_LEN wid, hgt;
 
        int prow_min;
@@ -109,15 +110,15 @@ void verify_panel(void)
 
        get_screen_size(&wid, &hgt);
 
-       max_prow_min = p_ptr->current_floor_ptr->height - hgt;
-       max_pcol_min = p_ptr->current_floor_ptr->width - wid;
+       max_prow_min = creature_ptr->current_floor_ptr->height - hgt;
+       max_pcol_min = creature_ptr->current_floor_ptr->width - wid;
 
        /* Bounds checking */
        if (max_prow_min < 0) max_prow_min = 0;
        if (max_pcol_min < 0) max_pcol_min = 0;
 
                /* Center on player */
-       if (center_player && (center_running || !p_ptr->running))
+       if (center_player && (center_running || !creature_ptr->running))
        {
                /* Center vertically */
                prow_min = y - hgt / 2;
@@ -183,13 +184,13 @@ void verify_panel(void)
        panel_col_min = pcol_min;
 
        /* Hack -- optional disturb on "panel change" */
-       if (disturb_panel && !center_player) disturb(p_ptr, FALSE, FALSE);
+       if (disturb_panel && !center_player) disturb(creature_ptr, FALSE, FALSE);
 
        panel_bounds_center();
 
-       p_ptr->update |= (PU_MONSTERS);
-       p_ptr->redraw |= (PR_MAP);
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       creature_ptr->update |= (PU_MONSTERS);
+       creature_ptr->redraw |= (PR_MAP);
+       creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
 
@@ -1195,7 +1196,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                case 'p':
                                {
                                        /* Recenter the map around the player */
-                                       verify_panel();
+                                       verify_panel(creature_ptr);
                                        creature_ptr->update |= (PU_MONSTERS);
                                        creature_ptr->redraw |= (PR_MAP);
                                        creature_ptr->window |= (PW_OVERHEAD);
@@ -1391,7 +1392,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                case 'p':
                                {
                                        /* Recenter the map around the player */
-                                       verify_panel();
+                                       verify_panel(creature_ptr);
                                        creature_ptr->update |= (PU_MONSTERS);
                                        creature_ptr->redraw |= (PR_MAP);
                                        creature_ptr->window |= (PW_OVERHEAD);
@@ -1510,7 +1511,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
        prt("", 0, 0);
 
        /* Recenter the map around the player */
-       verify_panel();
+       verify_panel(creature_ptr);
        creature_ptr->update |= (PU_MONSTERS);
        creature_ptr->redraw |= (PR_MAP);
        creature_ptr->window |= (PW_OVERHEAD);
@@ -2076,7 +2077,7 @@ bool tgt_pt(player_type *creature_ptr, POSITION *x_ptr, POSITION *y_ptr)
                                        n = 0;
                                        y = creature_ptr->y;
                                        x = creature_ptr->x;
-                                       verify_panel(); /* Move cursor to player */
+                                       verify_panel(creature_ptr);     /* Move cursor to player */
 
                                        creature_ptr->update |= (PU_MONSTERS);
 
@@ -2161,7 +2162,7 @@ bool tgt_pt(player_type *creature_ptr, POSITION *x_ptr, POSITION *y_ptr)
        prt("", 0, 0);
 
        /* Recenter the map around the player */
-       verify_panel();
+       verify_panel(creature_ptr);
 
        creature_ptr->update |= (PU_MONSTERS);
 
index 2bf7b5d..1bd08d5 100644 (file)
@@ -6,7 +6,7 @@ extern POSITION target_row;
 
 /* xtra2.c */
 extern void panel_bounds_center(void);
-extern void verify_panel(void);
+extern void verify_panel(player_type *creature_ptr);
 extern bool target_able(player_type *creature_ptr, MONSTER_IDX m_idx);
 extern bool target_okay(player_type *creature_ptr);
 
index 6fc8cb1..a8d0063 100644 (file)
@@ -2348,7 +2348,7 @@ void window_stuff(player_type *player_ptr)
  * Map resizing whenever the main term changes size
  * @return なし
  */
-void resize_map(void)
+void resize_map()
 {
        /* Only if the dungeon exists */
        if (!current_world_ptr->character_dungeon) return;
@@ -2361,7 +2361,7 @@ void resize_map(void)
        panel_row_min = p_ptr->current_floor_ptr->height;
        panel_col_min = p_ptr->current_floor_ptr->width;
 
-       verify_panel();
+       verify_panel(p_ptr);
 
        p_ptr->update |= (PU_TORCH | PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);