OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / floor-generate.c
index 399d070..77b11d3 100644 (file)
@@ -145,7 +145,6 @@ static int next_to_walls(POSITION y, POSITION x)
  */
 static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
 {
-       /* Access the grid */
        cave_type *c_ptr = &cave[y][x];
 
        /* Require "naked" floor grid */
@@ -259,8 +258,6 @@ static bool alloc_stairs(IDX feat, int num, int walls)
 
                                if (!pick) break;
                        }
-
-                       /* Access the grid */
                        c_ptr = &cave[y][x];
 
                        /* Clear possible garbage of hidden trap */
@@ -792,12 +789,8 @@ static bool cave_gen(void)
                        {
                                cave_type *c_ptr;
                                feature_type *f_ptr;
-
-                               /* Access the grid */
                                y = dun->tunn[j].y;
                                x = dun->tunn[j].x;
-
-                               /* Access the grid */
                                c_ptr = &cave[y][x];
                                f_ptr = &f_info[c_ptr->feat];
 
@@ -815,12 +808,8 @@ static bool cave_gen(void)
                        for (j = 0; j < dun->wall_n; j++)
                        {
                                cave_type *c_ptr;
-
-                               /* Access the grid */
                                y = dun->wall[j].y;
                                x = dun->wall[j].x;
-
-                               /* Access the grid */
                                c_ptr = &cave[y][x];
 
                                /* Clear mimic type */
@@ -981,7 +970,7 @@ static bool cave_gen(void)
  */
 static void build_arena(void)
 {
-       int yval, y_height, y_depth, xval, x_left, x_right;
+       POSITION yval, y_height, y_depth, xval, x_left, x_right;
        register int i, j;
 
        yval = SCREEN_HGT / 2;
@@ -1086,7 +1075,7 @@ static void arena_gen(void)
  */
 static void build_battle(void)
 {
-       int yval, y_height, y_depth, xval, x_left, x_right;
+       POSITION yval, y_height, y_depth, xval, x_left, x_right;
        register int i, j;
 
        yval = SCREEN_HGT / 2;
@@ -1181,8 +1170,7 @@ static void battle_gen(void)
 
        for(i = 0; i < 4; i++)
        {
-               place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i],
-                                 (PM_NO_KAGE | PM_NO_PET));
+               place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
                set_friendly(&m_list[cave[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
        }
        for(i = 1; i < m_max; i++)
@@ -1193,9 +1181,7 @@ static void battle_gen(void)
 
                /* Hack -- Detect monster */
                m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-               /* Update the monster */
-               update_mon(i, FALSE);
+               update_monster(i, FALSE);
        }
 }
 
@@ -1207,7 +1193,6 @@ static void quest_gen(void)
 {
        POSITION x, y;
 
-
        /* Start with perm walls */
        for (y = 0; y < cur_hgt; y++)
        {
@@ -1264,8 +1249,7 @@ static bool level_gen(cptr *why)
                                level_height = randint1(MAX_HGT/SCREEN_HGT);
                                level_width = randint1(MAX_WID/SCREEN_WID);
                        }
-                       while ((level_height == MAX_HGT/SCREEN_HGT) &&
-                                  (level_width == MAX_WID/SCREEN_WID));
+                       while ((level_height == MAX_HGT/SCREEN_HGT) && (level_width == MAX_WID/SCREEN_WID));
                }
 
                cur_hgt = level_height * SCREEN_HGT;
@@ -1293,12 +1277,7 @@ static bool level_gen(cptr *why)
        /* Make a dungeon */
        if (!cave_gen())
        {
-#ifdef JP
-*why = "ダンジョン生成に失敗";
-#else
-               *why = "could not place player";
-#endif
-
+               *why = _("ダンジョン生成に失敗", "could not place player");
                return FALSE;
        }
        else return TRUE;
@@ -1366,26 +1345,12 @@ void clear_cave(void)
                for (x = 0; x < MAX_WID; x++)
                {
                        cave_type *c_ptr = &cave[y][x];
-
-                       /* No flags */
                        c_ptr->info = 0;
-
-                       /* No features */
                        c_ptr->feat = 0;
-
-                       /* No objects */
                        c_ptr->o_idx = 0;
-
-                       /* No monsters */
                        c_ptr->m_idx = 0;
-
-                       /* No special */
                        c_ptr->special = 0;
-
-                       /* No mimic */
                        c_ptr->mimic = 0;
-
-                       /* No flow */
                        c_ptr->cost = 0;
                        c_ptr->dist = 0;
                        c_ptr->when = 0;
@@ -1465,42 +1430,22 @@ void generate_cave(void)
                /* Prevent object over-flow */
                if (o_max >= max_o_idx)
                {
-#ifdef JP
-why = "アイテムが多すぎる";
-#else
-                       why = "too many objects";
-#endif
-
-
+                       why = _("アイテムが多すぎる", "too many objects");
                        okay = FALSE;
                }
                /* Prevent monster over-flow */
                else if (m_max >= max_m_idx)
                {
-#ifdef JP
-why = "モンスターが多すぎる";
-#else
-                       why = "too many monsters";
-#endif
-
-
+                       why = _("モンスターが多すぎる", "too many monsters");
                        okay = FALSE;
                }
 
                /* Accept */
                if (okay) break;
 
-#ifdef JP
-if (why) msg_format("生成やり直し(%s)", why);
-#else
-               if (why) msg_format("Generation restarted (%s)", why);
-#endif
+               if (why) msg_format(_("生成やり直し(%s)", "Generation restarted (%s)"), why);
 
-
-               /* Wipe the objects */
                wipe_o_list();
-
-               /* Wipe the monsters */
                wipe_m_list();
        }
 
@@ -1552,7 +1497,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
 {
        POSITION y, x;
        POSITION tmp_row, tmp_col;
-       DIRECTION row_dir, col_dir;
+       POSITION row_dir, col_dir;
        POSITION start_row, start_col;
        int main_loop_count = 0;