OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / cave.c
index 026dbd8..815f960 100644 (file)
@@ -1236,7 +1236,6 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
                        /* Hack -- hallucination */
                        if (p_ptr->image) image_object(ap, cp);
 
-                       /* Done */
                        break;
                }
        }
@@ -1664,7 +1663,6 @@ void prt_map(void)
 
        int wid, hgt;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Remove map offset */
@@ -1930,7 +1928,6 @@ void display_map(int *cy, int *cx)
        int **match_autopick_yx;
        object_type ***object_autopick_yx;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
        hgt -= 2;
        wid -= 14;
@@ -2003,7 +2000,6 @@ void display_map(int *cy, int *cx)
        {
                for (j = 0; j < cur_hgt; ++j)
                {
-                       /* Location */
                        x = i / xrat + 1;
                        y = j / yrat + 1;
 
@@ -2037,7 +2033,6 @@ void display_map(int *cy, int *cx)
        {
                for (i = 0; i < cur_wid; ++i)
                {
-                       /* Location */
                        x = i / xrat + 1;
                        y = j / yrat + 1;
 
@@ -2190,7 +2185,7 @@ void display_map(int *cy, int *cx)
 /*
  * Display a "small-scale" map of the dungeon for the player
  *
- * Currently, the "player" is displayed on the map.  XXX XXX XXX
+ * Currently, the "player" is displayed on the map.  
  */
 void do_cmd_view_map(void)
 {
@@ -2544,8 +2539,6 @@ void forget_lite(void)
 
 
 /*
- * XXX XXX XXX
- *
  * This macro allows us to efficiently add a grid to the "lite" array,
  * note that we are never called for illegal grids, or for grids which
  * have already been placed into the "lite" array, and we are never
@@ -3337,8 +3330,6 @@ void forget_view(void)
        {
                POSITION y = view_y[i];
                POSITION x = view_x[i];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* Forget that the grid is viewable */
@@ -3419,8 +3410,6 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO
        /* Totally blocked by "unviewable neighbors" */
        if (!v1 && !v2) return (TRUE);
 
-
-       /* Access the grid */
        c_ptr = &cave[y][x];
 
 
@@ -3620,8 +3609,6 @@ void update_view(void)
        {
                y = view_y[n];
                x = view_x[n];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* Mark the grid as not in "view" */
@@ -3644,8 +3631,6 @@ void update_view(void)
        /* Now start on the player */
        y = p_ptr->y;
        x = p_ptr->x;
-
-       /* Access the grid */
        c_ptr = &cave[y][x];
 
        /* Assume the player grid is easily viewable */
@@ -3993,8 +3978,6 @@ void update_view(void)
        {
                y = view_y[n];
                x = view_x[n];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* Clear the "CAVE_XTRA" flag */
@@ -4012,8 +3995,6 @@ void update_view(void)
        {
                y = temp_y[n];
                x = temp_x[n];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* No longer in the array */
@@ -4048,8 +4029,6 @@ void delayed_visual_update(void)
        {
                y = redraw_y[i];
                x = redraw_x[i];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* Update only needed grids (prevent multiple updating) */
@@ -4229,8 +4208,8 @@ static int scent_when = 0;
  */
 void update_smell(void)
 {
-       int i, j;
-       int y, x;
+       POSITION i, j;
+       POSITION y, x;
 
        /* Create a table that controls the spread of scent */
        const int scent_adjust[5][5] = 
@@ -4297,10 +4276,11 @@ void update_smell(void)
  */
 void map_area(POSITION range)
 {
-       int             i, x, y;
-       cave_type       *c_ptr;
-       s16b            feat;
-       feature_type    *f_ptr;
+       int i;
+       POSITION x, y;
+       cave_type *c_ptr;
+       FEAT_IDX feat;
+       feature_type *f_ptr;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
@@ -4353,7 +4333,6 @@ void map_area(POSITION range)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
@@ -4377,7 +4356,8 @@ void map_area(POSITION range)
  */
 void wiz_lite(bool ninja)
 {
-       int i, y, x;
+       OBJECT_IDX i;
+       POSITION y, x;
        FEAT_IDX feat;
        feature_type *f_ptr;
 
@@ -4460,7 +4440,6 @@ void wiz_lite(bool ninja)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
@@ -4475,8 +4454,8 @@ void wiz_lite(bool ninja)
  */
 void wiz_dark(void)
 {
-       int i, y, x;
-
+       OBJECT_IDX i;
+       POSITION y, x;
 
        /* Forget every grid */
        for (y = 1; y < cur_hgt - 1; y++)
@@ -4535,18 +4514,13 @@ void wiz_dark(void)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
-
-
-
-
 /*
  * Change the "feat" flag for a grid, and notice/redraw the grid
  */
-void cave_set_feat(POSITION y, POSITION x, IDX feat)
+void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
 {
        cave_type *c_ptr = &cave[y][x];
        feature_type *f_ptr = &f_info[feat];
@@ -4563,7 +4537,8 @@ void cave_set_feat(POSITION y, POSITION x, IDX feat)
                /* Hack -- glow the GLOW terrain */
                if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS))
                {
-                       int i, yy, xx;
+                       DIRECTION i;
+                       POSITION yy, xx;
 
                        for (i = 0; i < 9; i++)
                        {
@@ -4603,7 +4578,6 @@ void cave_set_feat(POSITION y, POSITION x, IDX feat)
        /* Update the monster */
        if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
 
-       /* Notice */
        note_spot(y, x);
 
        /* Redraw */
@@ -4626,7 +4600,8 @@ void cave_set_feat(POSITION y, POSITION x, IDX feat)
        /* Hack -- glow the GLOW terrain */
        if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS))
        {
-               int i, yy, xx;
+               DIRECTION i;
+               POSITION yy, xx;
                cave_type *cc_ptr;
 
                for (i = 0; i < 9; i++)
@@ -4642,7 +4617,6 @@ void cave_set_feat(POSITION y, POSITION x, IDX feat)
                                /* Update the monster */
                                if (cc_ptr->m_idx) update_mon(cc_ptr->m_idx, FALSE);
 
-                               /* Notice */
                                note_spot(yy, xx);
 
                                /* Redraw */
@@ -4660,7 +4634,7 @@ void cave_set_feat(POSITION y, POSITION x, IDX feat)
 }
 
 
-IDX conv_dungeon_feat(IDX newfeat)
+FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat)
 {
        feature_type *f_ptr = &f_info[newfeat];
 
@@ -4694,7 +4668,7 @@ IDX conv_dungeon_feat(IDX newfeat)
  * Take a feature, determine what that feature becomes
  * through applying the given action.
  */
-IDX feat_state(IDX feat, int action)
+FEAT_IDX feat_state(FEAT_IDX feat, int action)
 {
        feature_type *f_ptr = &f_info[feat];
        int i;
@@ -4789,7 +4763,6 @@ void remove_mirror(POSITION y, POSITION x)
                update_local_illumination(y, x);
        }
 
-       /* Notice */
        note_spot(y, x);
 
        /* Redraw */
@@ -4992,7 +4965,6 @@ void monster_race_track(MONRACE_IDX r_idx)
        /* Save this monster ID */
        p_ptr->monster_race_idx = r_idx;
 
-       /* Window stuff */
        p_ptr->window |= (PW_MONSTER);
 }
 
@@ -5001,12 +4973,11 @@ void monster_race_track(MONRACE_IDX r_idx)
 /*
  * Hack -- track the given object kind
  */
-void object_kind_track(IDX k_idx)
+void object_kind_track(KIND_OBJECT_IDX k_idx)
 {
        /* Save this monster ID */
        p_ptr->object_kind_idx = k_idx;
 
-       /* Window stuff */
        p_ptr->window |= (PW_OBJECT);
 }
 
@@ -5021,7 +4992,7 @@ void object_kind_track(IDX k_idx)
  *
  * All disturbance cancels repeated commands, resting, and running.
  */
-void disturb(int stop_search, int stop_travel)
+void disturb(bool stop_search, bool stop_travel)
 {
 #ifndef TRAVEL
        /* Unused */
@@ -5088,7 +5059,8 @@ void disturb(int stop_search, int stop_travel)
  */
 void glow_deep_lava_and_bldg(void)
 {
-       int y, x, i, yy, xx;
+       POSITION y, x, yy, xx;
+       DIRECTION i;
        cave_type *c_ptr;
 
        /* Not in the darkness dungeon */