OSDN Git Service

[Refactor] #37353 prt_path() を view-mainwindow.c/h へ移動。
authordeskull <deskull@users.sourceforge.jp>
Sun, 21 Apr 2019 13:18:57 +0000 (22:18 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 21 Apr 2019 13:18:57 +0000 (22:18 +0900)
src/externs.h
src/grid.c
src/grid.h
src/view-mainwindow.c
src/view-mainwindow.h

index 1d518f6..4eea1a3 100644 (file)
@@ -362,7 +362,6 @@ extern bool player_can_see_bold(POSITION y, POSITION x);
 extern bool cave_valid_bold(POSITION y, POSITION x);
 extern bool no_lite(void);
 extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
-extern void prt_path(POSITION y, POSITION x);
 extern void delayed_visual_update(void);
 extern void forget_flow(void);
 extern void update_flow(void);
index 3b6d47a..e41d6d4 100644 (file)
@@ -1263,76 +1263,6 @@ void lite_spot(POSITION y, POSITION x)
        }
 }
 
-
-/*
- * print project path
- */
-void prt_path(POSITION y, POSITION x)
-{
-       int i;
-       int path_n;
-       u16b path_g[512];
-       byte_hack default_color = TERM_SLATE;
-
-       if (!display_path) return;
-       if (-1 == project_length)
-               return;
-
-       /* Get projection path */
-       path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), p_ptr->y, p_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
-
-       p_ptr->redraw |= (PR_MAP);
-       handle_stuff();
-
-       /* Draw path */
-       for (i = 0; i < path_n; i++)
-       {
-               POSITION ny = GRID_Y(path_g[i]);
-               POSITION nx = GRID_X(path_g[i]);
-               grid_type *g_ptr = &current_floor_ptr->grid_array[ny][nx];
-
-               if (panel_contains(ny, nx))
-               {
-                       TERM_COLOR a = default_color;
-                       char c;
-
-                       TERM_COLOR ta = default_color;
-                       char tc = '*';
-
-                       if (g_ptr->m_idx && current_floor_ptr->m_list[g_ptr->m_idx].ml)
-                       {
-                               /* Determine what is there */
-                               map_info(ny, nx, &a, &c, &ta, &tc);
-
-                               if (!is_ascii_graphics(a))
-                                       a = default_color;
-                               else if (c == '.' && (a == TERM_WHITE || a == TERM_L_WHITE))
-                                       a = default_color;
-                               else if (a == default_color)
-                                       a = TERM_WHITE;
-                       }
-
-                       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;
-                       }
-
-                       c = '*';
-
-                       /* Hack -- Queue it */
-                       Term_queue_bigchar(panel_col_of(nx), ny - panel_row_prt, a, c, ta, tc);
-               }
-
-               /* Known Wall */
-               if ((g_ptr->info & CAVE_MARK) && !cave_have_flag_grid(g_ptr, FF_PROJECT)) break;
-
-               /* Change color */
-               if (nx == x && ny == y) default_color = TERM_L_DARK;
-       }
-}
-
 /*
  * Some comments on the grid flags.  -BEN-
  *
index df6c007..cd04a15 100644 (file)
@@ -339,7 +339,6 @@ 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 lite_spot(POSITION y, POSITION x);
 extern void prt_map(void);
-extern void prt_path(POSITION y, POSITION x);
 extern void display_map(int *cy, int *cx);
 extern void delayed_visual_update(void);
 extern void forget_flow(void);
index ffa5faf..f41ed5e 100644 (file)
@@ -3785,3 +3785,72 @@ void move_cursor_relative(int row, int col)
        Term_gotoxy(panel_col_of(col), row);
 }
 
+
+/*
+ * print project path
+ */
+void prt_path(POSITION y, POSITION x)
+{
+       int i;
+       int path_n;
+       u16b path_g[512];
+       byte_hack default_color = TERM_SLATE;
+
+       if (!display_path) return;
+       if (-1 == project_length)
+               return;
+
+       /* Get projection path */
+       path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), p_ptr->y, p_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
+
+       p_ptr->redraw |= (PR_MAP);
+       handle_stuff();
+
+       /* Draw path */
+       for (i = 0; i < path_n; i++)
+       {
+               POSITION ny = GRID_Y(path_g[i]);
+               POSITION nx = GRID_X(path_g[i]);
+               grid_type *g_ptr = &current_floor_ptr->grid_array[ny][nx];
+
+               if (panel_contains(ny, nx))
+               {
+                       TERM_COLOR a = default_color;
+                       char c;
+
+                       TERM_COLOR ta = default_color;
+                       char tc = '*';
+
+                       if (g_ptr->m_idx && current_floor_ptr->m_list[g_ptr->m_idx].ml)
+                       {
+                               /* Determine what is there */
+                               map_info(ny, nx, &a, &c, &ta, &tc);
+
+                               if (!is_ascii_graphics(a))
+                                       a = default_color;
+                               else if (c == '.' && (a == TERM_WHITE || a == TERM_L_WHITE))
+                                       a = default_color;
+                               else if (a == default_color)
+                                       a = TERM_WHITE;
+                       }
+
+                       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;
+                       }
+
+                       c = '*';
+
+                       /* Hack -- Queue it */
+                       Term_queue_bigchar(panel_col_of(nx), ny - panel_row_prt, a, c, ta, tc);
+               }
+
+               /* Known Wall */
+               if ((g_ptr->info & CAVE_MARK) && !cave_have_flag_grid(g_ptr, FF_PROJECT)) break;
+
+               /* Change color */
+               if (nx == x && ny == y) default_color = TERM_L_DARK;
+       }
+}
index 86dba33..a9a17c2 100644 (file)
@@ -12,4 +12,5 @@ extern void health_track(MONSTER_IDX m_idx);
 extern void prt_time(void);
 extern concptr map_name(void);
 extern void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);
-extern void move_cursor_relative(int row, int col);
\ No newline at end of file
+extern void move_cursor_relative(int row, int col);
+extern void prt_path(POSITION y, POSITION x);