OSDN Git Service

[Refactor] #40483 Moved *_track() from display-main-window.c/h to stuff-handler.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 05:41:37 +0000 (14:41 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 05:41:37 +0000 (14:41 +0900)
13 files changed:
src/cmd-action/cmd-attack.c
src/cmd-io/cmd-lore.c
src/core/stuff-handler.c
src/core/stuff-handler.h
src/knowledge/knowledge-monsters.c
src/market/building-monster.c
src/monster-floor/monster-remover.c
src/monster/monster-compaction.c
src/player/player-move.c
src/player/player-status.c
src/spell/spells3.c
src/view/display-main-window.c
src/view/display-main-window.h

index 5991437..4d9a8f2 100644 (file)
@@ -9,6 +9,7 @@
 #include "combat/attack-accuracy.h"
 #include "combat/attack-criticality.h"
 #include "core/asking-player.h"
+#include "core/stuff-handler.h"
 #include "dungeon/dungeon.h"
 #include "effect/effect-characteristics.h"
 #include "game-option/cheat-types.h"
@@ -30,7 +31,6 @@
 #include "player/player-skill.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
-#include "view/display-main-window.h"
 #include "view/display-messages.h"
 
 /*!
index 8090544..50b2135 100644 (file)
@@ -13,7 +13,6 @@
 #include "term/term-color-types.h"
 #include "util/int-char-converter.h"
 #include "util/string-processor.h"
-#include "view/display-main-window.h"
 #include "view/display-lore.h"
 
 /*!
index 523af3a..8f5bacf 100644 (file)
@@ -15,3 +15,36 @@ void handle_stuff(player_type* player_ptr)
     if (player_ptr->window)
         window_stuff(player_ptr);
 }
+
+/*
+ * Track the given monster race
+ */
+void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx)
+{
+    player_ptr->monster_race_idx = r_idx;
+    player_ptr->window |= (PW_MONSTER);
+}
+
+/*
+ * Track the given object kind
+ */
+void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx)
+{
+    player_ptr->object_kind_idx = k_idx;
+    player_ptr->window |= (PW_OBJECT);
+}
+
+/*
+ * Track a new monster
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param m_idx トラッキング対象のモンスターID。0の時キャンセル
+ * @param なし
+ */
+void health_track(player_type *player_ptr, MONSTER_IDX m_idx)
+{
+    if (m_idx && m_idx == player_ptr->riding)
+        return;
+
+    player_ptr->health_who = m_idx;
+    player_ptr->redraw |= (PR_HEALTH);
+}
index af59169..ba27a93 100644 (file)
@@ -3,3 +3,6 @@
 #include "system/angband.h"
 
 void handle_stuff(player_type* player_ptr);
+void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx);
+void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx);
+void health_track(player_type *player_ptr, MONSTER_IDX m_idx);
index aa401f0..ff6add5 100644 (file)
@@ -30,7 +30,6 @@
 #include "util/angband-files.h"
 #include "util/int-char-converter.h"
 #include "util/string-processor.h"
-#include "view/display-main-window.h" // 暫定、後で消す.
 #include "view/display-lore.h"
 #include "view/display-monster-status.h"
 #include "world/world.h"
index cec0517..2216b92 100644 (file)
@@ -12,7 +12,6 @@
 #include "term/term-color-types.h"
 #include "util/int-char-converter.h"
 #include "util/string-processor.h"
-#include "view/display-main-window.h"
 #include "view/display-lore.h"
 
 /*!
index bbd1c5e..8073187 100644 (file)
@@ -1,4 +1,5 @@
 #include "monster-floor/monster-remover.h"
+#include "core/stuff-handler.h"
 #include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "grid/grid.h"
@@ -10,7 +11,6 @@
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "system/monster-type-definition.h"
-#include "view/display-main-window.h"
 
 /*!
  * @brief モンスター配列からモンスターを消去する / Delete a monster by index.
index ad709fa..16c7fd0 100644 (file)
@@ -1,4 +1,5 @@
 #include "monster/monster-compaction.h"
+#include "core/stuff-handler.h"
 #include "floor/floor.h"
 #include "game-option/play-record-options.h"
 #include "grid/grid.h"
@@ -12,7 +13,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster/monster-status.h"
 #include "system/monster-type-definition.h"
-#include "view/display-main-window.h"
 #include "view/display-messages.h"
 
 /*!
index 6d890b4..1870565 100644 (file)
 #include "spell/spells3.h"
 #include "term/screen-processor.h"
 #include "util/bit-flags-calculator.h"
-#include "view/display-main-window.h"
 #include "view/display-messages.h"
 #include "world/world.h"
 
index e51942d..a046991 100644 (file)
@@ -4015,6 +4015,34 @@ bool heavy_armor(player_type *creature_ptr)
        return (monk_arm_wgt > (100 + (creature_ptr->lev * 4)));
 }
 
+/*
+ * Delayed visual update
+ * Only used if update_view(), update_lite() or update_mon_lite() was called
+ */
+static void delayed_visual_update(player_type *player_ptr)
+{
+    floor_type *floor_ptr = player_ptr->current_floor_ptr;
+    for (int i = 0; i < floor_ptr->redraw_n; i++) {
+        POSITION y = floor_ptr->redraw_y[i];
+        POSITION x = floor_ptr->redraw_x[i];
+        grid_type *g_ptr;
+        g_ptr = &floor_ptr->grid_array[y][x];
+        if (!(g_ptr->info & CAVE_REDRAW))
+            continue;
+
+        if (g_ptr->info & CAVE_NOTE)
+            note_spot(player_ptr, y, x);
+
+        lite_spot(player_ptr, y, x);
+        if (g_ptr->m_idx)
+            update_monster(player_ptr, g_ptr->m_idx, FALSE);
+
+        g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
+    }
+
+    floor_ptr->redraw_n = 0;
+}
+
 
 /*!
  * @brief update のフラグに応じた更新をまとめて行う / Handle "update"
index 4e0f2b5..1410bac 100644 (file)
@@ -99,7 +99,6 @@
 #include "term/term-color-types.h"
 #include "util/bit-flags-calculator.h"
 #include "util/int-char-converter.h"
-#include "view/display-main-window.h"
 #include "view/display-messages.h"
 #include "world/world.h"
 
index de0a42b..06f52e4 100644 (file)
@@ -231,21 +231,6 @@ void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char)
 }
 
 /*
- * Track a new monster
- * @param player_ptr プレーヤーへの参照ポインタ
- * @param m_idx トラッキング対象のモンスターID。0の時キャンセル
- * @param なし
- */
-void health_track(player_type *player_ptr, MONSTER_IDX m_idx)
-{
-    if (m_idx && m_idx == player_ptr->riding)
-        return;
-
-    player_ptr->health_who = m_idx;
-    player_ptr->redraw |= (PR_HEALTH);
-}
-
-/*
  * Moves the cursor to a given MAP (y,x) location
  */
 void move_cursor_relative(int row, int col)
@@ -316,53 +301,7 @@ void print_path(player_type *player_ptr, POSITION y, POSITION x)
 }
 
 /*
- * Track the given monster race
- */
-void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx)
-{
-    player_ptr->monster_race_idx = r_idx;
-    player_ptr->window |= (PW_MONSTER);
-}
-
-/*
- * Track the given object kind
- */
-void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx)
-{
-    player_ptr->object_kind_idx = k_idx;
-    player_ptr->window |= (PW_OBJECT);
-}
-
-/*
  * Determines if a map location is currently "on screen" -RAK-
  * Note that "panel_contains(Y,X)" always implies "in_bounds2(Y,X)".
  */
 bool panel_contains(POSITION y, POSITION x) { return (y >= panel_row_min) && (y <= panel_row_max) && (x >= panel_col_min) && (x <= panel_col_max); }
-
-/*
- * Delayed visual update
- * Only used if update_view(), update_lite() or update_mon_lite() was called
- */
-void delayed_visual_update(player_type *player_ptr)
-{
-    floor_type *floor_ptr = player_ptr->current_floor_ptr;
-    for (int i = 0; i < floor_ptr->redraw_n; i++) {
-        POSITION y = floor_ptr->redraw_y[i];
-        POSITION x = floor_ptr->redraw_x[i];
-        grid_type *g_ptr;
-        g_ptr = &floor_ptr->grid_array[y][x];
-        if (!(g_ptr->info & CAVE_REDRAW))
-            continue;
-
-        if (g_ptr->info & CAVE_NOTE)
-            note_spot(player_ptr, y, x);
-
-        lite_spot(player_ptr, y, x);
-        if (g_ptr->m_idx)
-            update_monster(player_ptr, g_ptr->m_idx, FALSE);
-
-        g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
-    }
-
-    floor_ptr->redraw_n = 0;
-}
index 8e38280..093b50d 100644 (file)
@@ -4,13 +4,9 @@
 
 void get_screen_size(TERM_LEN *wid_p, TERM_LEN *hgt_p);
 void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char);
-void health_track(player_type *player_ptr, MONSTER_IDX m_idx);
 void print_time(player_type *player_ptr);
 void move_cursor_relative(int row, int col);
 void print_path(player_type *player_ptr, POSITION y, POSITION x);
-void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx);
-void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx);
 void resize_map(void);
 bool change_panel(player_type *player_ptr, POSITION dy, POSITION dx);
 bool panel_contains(POSITION y, POSITION x);
-void delayed_visual_update(player_type *player_ptr);