From 6ec1b2f3e7ab0d7669721697bdac651936a03600 Mon Sep 17 00:00:00 2001 From: Hourier Date: Sun, 12 Jan 2020 18:57:15 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20display=5Fplayer=5Fequippy?= =?utf8?q?()=20=E3=81=ABplayer=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=20/=20Added=20player=5Ftype=20*=20argument=20?= =?utf8?q?to=20display=5Fplayer=5Fequippy()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/files.c | 16 ++++++++-------- src/files.h | 3 +-- src/view-mainwindow.c | 10 +++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/files.c b/src/files.c index ea6608a53..66d79a28e 100644 --- a/src/files.c +++ b/src/files.c @@ -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); diff --git a/src/files.h b/src/files.h index 3191568a3..ec711beee 100644 --- a/src/files.h +++ b/src/files.h @@ -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); diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index bab82e8d0..497bb0f08 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -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); } /*! -- 2.11.0