OSDN Git Service

[Refactor] #38997 display_player_equippy() にplayer_type * 引数を追加 / Added player_type...
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 09:57:15 +0000 (18:57 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 16:06:59 +0000 (01:06 +0900)
src/files.c
src/files.h
src/view-mainwindow.c

index ea6608a..66d79a2 100644 (file)
@@ -2844,7 +2844,7 @@ static void tim_player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_S
  * @param mode オプション
  * @return なし
  */
-void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
+void display_player_equippy(player_type *creature_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
 {
        int i, max_i;
 
@@ -2861,7 +2861,7 @@ void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
        for (i = INVEN_RARM; i < max_i; i++)
        {
                /* Object */
-               o_ptr = &p_ptr->inventory_list[i];
+               o_ptr = &creature_ptr->inventory_list[i];
 
                a = object_attr(o_ptr);
                c = object_char(o_ptr);
@@ -3173,7 +3173,7 @@ static void display_player_flag_info(player_type *creature_ptr)
        row = 12;
        col = 1;
 
-       display_player_equippy(row-2, col+8, 0);
+       display_player_equippy(creature_ptr, row-2, col+8, 0);
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
 
 #ifdef JP
@@ -3214,7 +3214,7 @@ static void display_player_flag_info(player_type *creature_ptr)
        row = 12;
        col = 26;
 
-       display_player_equippy(row-2, col+8, 0);
+       display_player_equippy(creature_ptr, row-2, col+8, 0);
 
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
 
@@ -3248,7 +3248,7 @@ static void display_player_flag_info(player_type *creature_ptr)
        row = 12;
        col = 51;
 
-       display_player_equippy(row-2, col+12, 0);
+       display_player_equippy(creature_ptr, row-2, col+12, 0);
 
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+12);
 
@@ -3304,7 +3304,7 @@ static void display_player_other_flag_info(player_type *creature_ptr)
        row = 3;
        col = 1;
 
-       display_player_equippy(row-2, col+12, DP_WP);
+       display_player_equippy(creature_ptr, row-2, col+12, DP_WP);
 
        c_put_str(TERM_WHITE, "ab@", row-1, col+12);
 
@@ -3374,7 +3374,7 @@ static void display_player_other_flag_info(player_type *creature_ptr)
        row = 3;
        col = col + 12 + 7;
 
-       display_player_equippy(row-2, col+13, 0);
+       display_player_equippy(creature_ptr, row-2, col+13, 0);
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+13);
 
 #ifdef JP
@@ -3425,7 +3425,7 @@ static void display_player_other_flag_info(player_type *creature_ptr)
        row = 3;
        col = col + 12 + 17;
 
-       display_player_equippy(row-2, col+14, 0);
+       display_player_equippy(creature_ptr, row-2, col+14, 0);
 
        c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+14);
 
index 3191568..ec711be 100644 (file)
@@ -33,8 +33,7 @@ extern concptr process_pref_file_expr(player_type *creature_ptr, char **sp, char
 extern errr process_pref_file(player_type *creature_ptr, concptr name);
 extern errr process_autopick_file(player_type *creature_ptr, concptr name);
 extern errr process_histpref_file(player_type *creature_ptr, concptr name);
-extern void print_equippy(void);
-extern void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode);
+extern void display_player_equippy(player_type *player_ptr, TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode);
 extern errr check_time_init(void);
 extern errr check_load_init(void);
 extern errr check_time(void);
index bab82e8..497bb0f 100644 (file)
@@ -49,7 +49,6 @@
   */
 #define IS_ASCII_GRAPHICS(A) (!((A) & 0x80))
 
-
 static int feat_priority; /*!< マップ縮小表示時に表示すべき地形の優先度を保管する */
 static byte display_autopick; /*!< 自動拾い状態の設定フラグ */
 static int match_autopick;
@@ -144,7 +143,7 @@ POSITION panel_col_prt, panel_row_prt;
 #define COL_STATBAR              0
 #define MAX_COL_STATBAR         (-26)
 
-
+void print_equippy(player_type *creature_ptr);
 
 /*!
  * @brief 画面左の能力値表示を行うために指定位置から13キャラ分を空白消去後指定のメッセージを明るい青で描画する /
@@ -2114,7 +2113,7 @@ void redraw_stuff(player_type *creature_ptr)
        if (creature_ptr->redraw & (PR_EQUIPPY))
        {
                creature_ptr->redraw &= ~(PR_EQUIPPY);
-               print_equippy(); /* To draw / delete equippy chars */
+               print_equippy(creature_ptr); /* To draw / delete equippy chars */
        }
 
        if (creature_ptr->redraw & (PR_MISC))
@@ -2460,11 +2459,12 @@ bool change_panel(POSITION dy, POSITION dx)
 
 /*!
  * @brief プレイヤーの装備一覧シンボルを固定位置に表示する
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
-void print_equippy(void)
+void print_equippy(player_type *creature_ptr)
 {
-       display_player_equippy(ROW_EQUIPPY, COL_EQUIPPY, 0);
+       display_player_equippy(creature_ptr, ROW_EQUIPPY, COL_EQUIPPY, 0);
 }
 
 /*!