From 93ed66773df9bb53365a16e3c6f75c2e52e094b7 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 18 Dec 2018 22:14:57 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=82=B3=E3=83=A1?= =?utf8?q?=E3=83=B3=E3=83=88=E6=95=B4=E7=90=86=20/=20Refactor=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 6 ++---- src/cmd4.c | 22 +++++++--------------- src/dungeon.c | 3 +-- src/externs.h | 1 + src/files.c | 3 +-- src/monster1.c | 3 +-- src/store.c | 9 +-------- src/util.c | 9 +++++++-- src/wizard1.c | 3 +-- 9 files changed, 22 insertions(+), 37 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 772801606..d2f92d138 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -4110,9 +4110,8 @@ static void bldg_process_command(building_type *bldg, int i) bool paid = FALSE; int amt; - /* Flush messages */ msg_flag = FALSE; - msg_print(NULL); + msg_erase(); if (is_owner(bldg)) bcost = bldg->member_costs[i]; @@ -4498,9 +4497,8 @@ void do_cmd_bldg(void) select_floor_music(); - /* Flush messages */ msg_flag = FALSE; - msg_print(NULL); + msg_erase(); /* Reinit wilderness to activate quests ... */ if (reinit_wilderness) diff --git a/src/cmd4.c b/src/cmd4.c index d88c93490..763e95140 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -942,8 +942,7 @@ void do_cmd_nikki(void) bell(); } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } /* Restore the screen */ @@ -1100,14 +1099,12 @@ void do_cmd_change_name(void) { mode++; } - else { bell(); } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } /* Restore the screen */ @@ -2301,8 +2298,7 @@ void do_cmd_options(void) } } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } @@ -2960,8 +2956,7 @@ void do_cmd_macros(void) bell(); } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } screen_load(); } @@ -3612,8 +3607,7 @@ void do_cmd_visuals(void) break; } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } /* Restore the screen */ @@ -3831,8 +3825,7 @@ void do_cmd_colors(void) bell(); } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } @@ -8573,8 +8566,7 @@ void do_cmd_knowledge(void) bell(); } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } /* Restore the screen */ diff --git a/src/dungeon.c b/src/dungeon.c index 2f77d8b36..3aaa061e7 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -5256,8 +5256,7 @@ static void dungeon(bool load_game) /* Verify the panel */ verify_panel(); - /* Flush messages */ - msg_print(NULL); + msg_erase(); /* Enter "xtra" mode */ diff --git a/src/externs.h b/src/externs.h index 008a98886..82c44aa04 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1116,6 +1116,7 @@ extern u16b quark_add(cptr str); extern s32b message_num(void); extern cptr message_str(int age); extern void message_add(cptr msg); +extern void msg_erase(void); extern void msg_print(cptr msg); extern void msg_print_wizard(int cheat_type, cptr msg); #ifndef SWIG diff --git a/src/files.c b/src/files.c index 26937c786..54c0bf5dc 100644 --- a/src/files.c +++ b/src/files.c @@ -6587,8 +6587,7 @@ static void show_info(void) /* Flush all input keys */ flush(); - /* Flush messages */ - msg_print(NULL); + msg_erase(); /* Describe options */ diff --git a/src/monster1.c b/src/monster1.c index 1c84f78dc..bee3385ec 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -2058,8 +2058,7 @@ void roff_top(MONRACE_IDX r_idx) */ void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode) { - /* Flush messages */ - msg_print(NULL); + msg_erase(); /* Begin recall */ Term_erase(0, 1, 255); diff --git a/src/store.c b/src/store.c index f99a6d0b5..a44e63c25 100644 --- a/src/store.c +++ b/src/store.c @@ -5071,23 +5071,16 @@ void do_cmd_store(void) /* Allow expanding macros */ get_com_no_macros = FALSE; - /* Flush messages */ - msg_print(NULL); - - - /* Clear the screen */ + msg_erase(); Term_clear(); - /* Update everything */ p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE); p_ptr->update |= (PU_MONSTERS); /* Redraw entire screen */ p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY); - p_ptr->redraw |= (PR_MAP); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); } diff --git a/src/util.c b/src/util.c index 0ae9d37b8..f39da9faf 100644 --- a/src/util.c +++ b/src/util.c @@ -2745,6 +2745,12 @@ static void msg_flush(int x) } +void msg_erase(void) +{ + msg_print(NULL); +} + + /* * Output a message to the top line of the screen. * @@ -4380,8 +4386,7 @@ void request_command(int shopping) /* Hack -- auto-commands */ if (command_new) { - /* Flush messages */ - msg_print(NULL); + msg_erase(); /* Use auto-command */ cmd = command_new; diff --git a/src/wizard1.c b/src/wizard1.c index 977d50f85..9eb7b83aa 100644 --- a/src/wizard1.c +++ b/src/wizard1.c @@ -2508,8 +2508,7 @@ void do_cmd_spoilers(void) break; } - /* Flush messages */ - msg_print(NULL); + msg_erase(); } } -- 2.11.0