OSDN Git Service

[Refactor] #38997 delayed_visual_update() にplayer_type * 引数を追加 / Added player_type...
authordeskull <deskull@users.sourceforge.jp>
Wed, 8 Jan 2020 15:41:37 +0000 (00:41 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 8 Jan 2020 15:41:37 +0000 (00:41 +0900)
src/grid.c
src/grid.h
src/player-status.c
src/view-mainwindow.c
src/view-mainwindow.h

index f455e24..02426c8 100644 (file)
@@ -842,43 +842,6 @@ void lite_spot(POSITION y, POSITION x)
  */
 
 /*
- * Mega-Hack -- Delayed visual update
- * Only used if update_view(), update_lite() or update_mon_lite() was called
- */
-void delayed_visual_update(void)
-{
-       int i;
-       POSITION y, x;
-       grid_type *g_ptr;
-
-       /* Update needed grids */
-       for (i = 0; i < p_ptr->current_floor_ptr->redraw_n; i++)
-       {
-               y = p_ptr->current_floor_ptr->redraw_y[i];
-               x = p_ptr->current_floor_ptr->redraw_x[i];
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
-
-               /* Update only needed grids (prevent multiple updating) */
-               if (!(g_ptr->info & CAVE_REDRAW)) continue;
-
-               /* If required, note */
-               if (g_ptr->info & CAVE_NOTE) note_spot(y, x);
-
-               lite_spot(y, x);
-
-               /* Hack -- Visual update of monster on this grid */
-               if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
-
-               /* No longer in the array */
-               g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
-       }
-
-       /* None left */
-       p_ptr->current_floor_ptr->redraw_n = 0;
-}
-
-
-/*
  * Hack - speed up the update_flow algorithm by only doing
  * it everytime the player moves out of LOS of the last
  * "way-point".
@@ -886,8 +849,6 @@ void delayed_visual_update(void)
 static POSITION flow_x = 0;
 static POSITION flow_y = 0;
 
-
-
 /*
  * Hack -- fill in the "cost" field of every grid that the player
  * can "reach" with the number of steps needed to reach that grid.
index c70b888..e98244e 100644 (file)
@@ -390,7 +390,6 @@ extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TE
 extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
 extern void note_spot(POSITION y, POSITION x);
 extern void lite_spot(POSITION y, POSITION x);
-extern void delayed_visual_update(void);
 extern void update_flow(player_type *subject_ptr);
 extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
 extern void cave_alter_feat(POSITION y, POSITION x, int action);
index 03efec4..a073e55 100644 (file)
@@ -5096,7 +5096,7 @@ void update_creature(player_type *creature_ptr)
        if (creature_ptr->update & (PU_DELAY_VIS))
        {
                creature_ptr->update &= ~(PU_DELAY_VIS);
-               delayed_visual_update();
+               delayed_visual_update(creature_ptr->current_floor_ptr);
        }
 
        if (creature_ptr->update & (PU_MONSTERS))
index c045841..20a69dc 100644 (file)
@@ -3879,3 +3879,39 @@ void update_playtime(void)
        }
 }
 
+/*
+ * Mega-Hack -- Delayed visual update
+ * Only used if update_view(), update_lite() or update_mon_lite() was called
+ */
+void delayed_visual_update(floor_type *floor_ptr)
+{
+       int i;
+       POSITION y, x;
+       grid_type *g_ptr;
+
+       /* Update needed grids */
+       for (i = 0; i < floor_ptr->redraw_n; i++)
+       {
+               y = floor_ptr->redraw_y[i];
+               x = floor_ptr->redraw_x[i];
+               g_ptr = &floor_ptr->grid_array[y][x];
+
+               /* Update only needed grids (prevent multiple updating) */
+               if (!(g_ptr->info & CAVE_REDRAW)) continue;
+
+               /* If required, note */
+               if (g_ptr->info & CAVE_NOTE) note_spot(y, x);
+
+               lite_spot(y, x);
+
+               /* Hack -- Visual update of monster on this grid */
+               if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
+
+               /* No longer in the array */
+               g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
+       }
+
+       /* None left */
+       floor_ptr->redraw_n = 0;
+}
+
index a0b92b7..1acacbe 100644 (file)
@@ -45,3 +45,4 @@ extern POSITION panel_col_prt, panel_row_prt;
   (((Y) >= panel_row_min) && ((Y) <= panel_row_max) && \
    ((X) >= panel_col_min) && ((X) <= panel_col_max))
 
+extern void delayed_visual_update(floor_type *floor_ptr);