From 45afae7f9173c722ce70af48bfb9f93c1732d02c Mon Sep 17 00:00:00 2001 From: Hourier Date: Fri, 26 Jun 2020 18:58:42 +0900 Subject: [PATCH] [Refactor] #40483 Separated main-window-util.c/h from display-main-window.c --- Hengband/Hengband/Hengband.vcxproj | 2 ++ Hengband/Hengband/Hengband.vcxproj.filters | 6 ++++++ src/Makefile.am | 1 + src/player/player-class.c | 1 + src/view/display-main-window.c | 15 +-------------- src/view/main-window-util.c | 17 +++++++++++++++++ src/view/main-window-util.h | 5 +++++ 7 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 src/view/main-window-util.c create mode 100644 src/view/main-window-util.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index fdcd54395..83962421d 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -207,6 +207,7 @@ + @@ -1012,6 +1013,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 9dbe70a63..a56f85c1f 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -1406,6 +1406,9 @@ view + + view + @@ -3100,6 +3103,9 @@ view + + view + diff --git a/src/Makefile.am b/src/Makefile.am index 4939e107c..b4447111f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -588,6 +588,7 @@ hengband_SOURCES = \ view/display-player.c view/display-player.h \ view/display-util.c view/display-util.h \ view/main-window-row-column.h \ + view/main-window-util.c view/main-window-util.h \ view/object-describer.c view/object-describer.h \ view/status-first-page.c view/status-first-page.h \ view/status-bars-table.c view/status-bars-table.h \ diff --git a/src/player/player-class.c b/src/player/player-class.c index b10c8a0d1..ed447d35a 100644 --- a/src/player/player-class.c +++ b/src/player/player-class.c @@ -5,6 +5,7 @@ */ #include "player/player-class.h" +#include "player/player-race.h" #include "system/object-type-definition.h" /* diff --git a/src/view/display-main-window.c b/src/view/display-main-window.c index ae61cbcf4..73fd12c0e 100644 --- a/src/view/display-main-window.c +++ b/src/view/display-main-window.c @@ -68,6 +68,7 @@ #include "view/display-messages.h" #include "view/display-player.h" #include "view/main-window-row-column.h" +#include "view/main-window-util.h" #include "view/object-describer.h" #include "view/status-bars-table.h" #include "world/world.h" @@ -94,20 +95,6 @@ void display_map(player_type *player_ptr, int *cy, int *cx); void set_term_color(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp); /*! - * @brief 画面左の能力値表示を行うために指定位置から13キャラ分を空白消去後指定のメッセージを明るい青で描画する / - * Print character info at given row, column in a 13 char field - * @param info 表示文字列 - * @param row 描画列 - * @param col 描画行 - * @return なし - */ -static void print_field(concptr info, TERM_LEN row, TERM_LEN col) -{ - c_put_str(TERM_WHITE, " ", row, col); - c_put_str(TERM_L_BLUE, info, row, col); -} - -/*! * @brief ゲーム時刻を表示する / * Print time * @return なし diff --git a/src/view/main-window-util.c b/src/view/main-window-util.c new file mode 100644 index 000000000..52853b7bd --- /dev/null +++ b/src/view/main-window-util.c @@ -0,0 +1,17 @@ +#include "view/main-window-util.h" +#include "term/screen-processor.h" +#include "term/term-color-types.h" + +/*! + * @brief 画面左の能力値表示を行うために指定位置から13キャラ分を空白消去後指定のメッセージを明るい青で描画する / + * Print character info at given row, column in a 13 char field + * @param info 表示文字列 + * @param row 描画列 + * @param col 描画行 + * @return なし + */ +void print_field(concptr info, TERM_LEN row, TERM_LEN col) +{ + c_put_str(TERM_WHITE, " ", row, col); + c_put_str(TERM_L_BLUE, info, row, col); +} diff --git a/src/view/main-window-util.h b/src/view/main-window-util.h new file mode 100644 index 000000000..f4cf47293 --- /dev/null +++ b/src/view/main-window-util.h @@ -0,0 +1,5 @@ +#pragma once + +#include "system/angband.h" + +void print_field(concptr info, TERM_LEN row, TERM_LEN col); -- 2.11.0