From: deskull Date: Sun, 21 Apr 2019 12:57:55 +0000 (+0900) Subject: [Refactor] #37353 display_dungeon() を view-mainwindow.c へ移動。 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=89bb7273d6184da8ee899fb153f34166a0da53d9;p=hengband%2Fhengband.git [Refactor] #37353 display_dungeon() を view-mainwindow.c へ移動。 --- diff --git a/src/externs.h b/src/externs.h index e21693239..86d84b393 100644 --- a/src/externs.h +++ b/src/externs.h @@ -363,7 +363,6 @@ extern bool cave_valid_bold(POSITION y, POSITION x); extern bool no_lite(void); extern void move_cursor_relative(int row, int col); extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x); -extern void display_dungeon(void); extern void prt_path(POSITION y, POSITION x); extern void delayed_visual_update(void); extern void forget_flow(void); diff --git a/src/grid.c b/src/grid.c index 44cf74106..8d6545e73 100644 --- a/src/grid.c +++ b/src/grid.c @@ -1242,56 +1242,6 @@ void note_spot(POSITION y, POSITION x) g_ptr->info |= (CAVE_KNOWN); } - -void display_dungeon(void) -{ - TERM_LEN x, y; - TERM_COLOR a; - SYMBOL_CODE c; - - TERM_COLOR ta = 0; - SYMBOL_CODE tc = '\0'; - - for (x = p_ptr->x - Term->wid / 2 + 1; x <= p_ptr->x + Term->wid / 2; x++) - { - for (y = p_ptr->y - Term->hgt / 2 + 1; y <= p_ptr->y + Term->hgt / 2; y++) - { - if (in_bounds2(y, x)) - { - map_info(y, x, &a, &c, &ta, &tc); - - /* Hack -- fake monochrome */ - if (!use_graphics) - { - if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN() || p_ptr->timewalk) a = TERM_WHITE; - else if (p_ptr->wraith_form) a = TERM_L_DARK; - } - - /* Hack -- Queue it */ - Term_queue_char(x - p_ptr->x + Term->wid / 2 - 1, y - p_ptr->y + Term->hgt / 2 - 1, a, c, ta, tc); - } - else - { - /* Clear out-of-bound tiles */ - - /* Access darkness */ - feature_type *f_ptr = &f_info[feat_none]; - - /* Normal attr */ - a = f_ptr->x_attr[F_LIT_STANDARD]; - - /* Normal char */ - c = f_ptr->x_char[F_LIT_STANDARD]; - - /* Hack -- Queue it */ - Term_queue_char(x - p_ptr->x + Term->wid / 2 - 1, y - p_ptr->y + Term->hgt / 2 - 1, a, c, ta, tc); - } - } - } -} - - /* * Redraw (on the screen) a given MAP location * diff --git a/src/grid.h b/src/grid.h index 351efc96f..4d3b135be 100644 --- a/src/grid.h +++ b/src/grid.h @@ -338,7 +338,6 @@ extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TE extern void move_cursor_relative(int row, int col); extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x); extern void note_spot(POSITION y, POSITION x); -extern void display_dungeon(void); extern void lite_spot(POSITION y, POSITION x); extern void prt_map(void); extern void prt_path(POSITION y, POSITION x); diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index ae95ebaaf..76047233d 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -1891,6 +1891,53 @@ static void fix_overhead(void) } } +static void display_dungeon(void) +{ + TERM_LEN x, y; + TERM_COLOR a; + SYMBOL_CODE c; + + TERM_COLOR ta = 0; + SYMBOL_CODE tc = '\0'; + + for (x = p_ptr->x - Term->wid / 2 + 1; x <= p_ptr->x + Term->wid / 2; x++) + { + for (y = p_ptr->y - Term->hgt / 2 + 1; y <= p_ptr->y + Term->hgt / 2; y++) + { + if (in_bounds2(y, x)) + { + map_info(y, x, &a, &c, &ta, &tc); + + /* Hack -- fake monochrome */ + if (!use_graphics) + { + if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; + else if (IS_INVULN() || p_ptr->timewalk) a = TERM_WHITE; + else if (p_ptr->wraith_form) a = TERM_L_DARK; + } + + /* Hack -- Queue it */ + Term_queue_char(x - p_ptr->x + Term->wid / 2 - 1, y - p_ptr->y + Term->hgt / 2 - 1, a, c, ta, tc); + } + else + { + /* Clear out-of-bound tiles */ + + /* Access darkness */ + feature_type *f_ptr = &f_info[feat_none]; + + /* Normal attr */ + a = f_ptr->x_attr[F_LIT_STANDARD]; + + /* Normal char */ + c = f_ptr->x_char[F_LIT_STANDARD]; + + /* Hack -- Queue it */ + Term_queue_char(x - p_ptr->x + Term->wid / 2 - 1, y - p_ptr->y + Term->hgt / 2 - 1, a, c, ta, tc); + } + } + } +} /*! * @brief ダンジョンの地形をサブウィンドウに表示する /