5 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
6 * This software may be copied and distributed for educational, research, and\n
7 * not for profit purposes provided that this copyright and statement are\n
8 * included in all such copies.\n
9 * 2014 Deskull rearranged comment for Doxygen.
12 #include "io/screen-util.h"
13 #include "core/player-processor.h"
14 #include "core/stuff-handler.h"
15 #include "dungeon/quest.h"
16 #include "effect/effect-characteristics.h"
17 #include "effect/spells-effect-util.h"
18 #include "floor/floor-town.h"
19 #include "game-option/map-screen-options.h"
20 #include "game-option/special-options.h"
21 #include "grid/feature.h"
22 #include "grid/grid.h"
23 #include "io/cursor.h"
24 #include "io/input-key-acceptor.h"
25 #include "monster/monster-update.h"
26 #include "player-info/mimic-info-table.h"
27 #include "system/dungeon-info.h"
28 #include "system/floor-type-definition.h"
29 #include "system/player-type-definition.h"
30 #include "system/redrawing-flags-updater.h"
31 #include "target/target-checker.h"
32 #include "term/screen-processor.h"
33 #include "term/term-color-types.h"
34 #include "util/bit-flags-calculator.h"
35 #include "view/display-map.h"
36 #include "window/main-window-row-column.h"
37 #include "window/main-window-util.h"
38 #include "world/world.h"
41 * @brief コンソールのリサイズに合わせてマップを再描画する /
42 * Map resizing whenever the main term changes size
43 * @todo ここにPlayerType を追加するとz-termに影響が行くので保留
47 if (!w_ptr->character_dungeon) {
53 panel_row_min = p_ptr->current_floor_ptr->height;
54 panel_col_min = p_ptr->current_floor_ptr->width;
57 auto &rfu = RedrawingFlagsUpdater::get_instance();
58 static constexpr auto flags_srf = {
59 StatusRecalculatingFlag::TORCH,
60 StatusRecalculatingFlag::BONUS,
61 StatusRecalculatingFlag::HP,
62 StatusRecalculatingFlag::MP,
63 StatusRecalculatingFlag::SPELLS,
64 StatusRecalculatingFlag::UN_VIEW,
65 StatusRecalculatingFlag::UN_LITE,
66 StatusRecalculatingFlag::VIEW,
67 StatusRecalculatingFlag::LITE,
68 StatusRecalculatingFlag::MONSTER_LITE,
69 StatusRecalculatingFlag::MONSTER_STATUSES,
71 rfu.set_flags(flags_srf);
72 static constexpr auto flags_mwrf = {
73 MainWindowRedrawingFlag::WIPE,
74 MainWindowRedrawingFlag::BASIC,
75 MainWindowRedrawingFlag::EXTRA,
76 MainWindowRedrawingFlag::MAP,
77 MainWindowRedrawingFlag::EQUIPPY,
79 rfu.set_flags(flags_mwrf);
84 move_cursor_relative(p_ptr->y, p_ptr->x);
91 * @brief 現在のコンソール表示の縦横を返す
93 std::pair<int, int> get_screen_size()
95 auto [width, height] = term_get_size();
96 height -= ROW_MAP + 2;
102 return { width, height };
106 * Determines if a map location is currently "on screen" -RAK-
107 * Note that "panel_contains(Y,X)" always implies "in_bounds2(Y,X)".
109 bool panel_contains(int y, int x)
111 return (y >= panel_row_min) && (y <= panel_row_max) && (x >= panel_col_min) && (x <= panel_col_max);