OSDN Git Service

[Refactor] #37353 コメント整理。 update_mon()をupdate_monster()に改名。 / Refactor comments and...
[hengband/hengband.git] / src / wild.c
index 057e71b..4cb5d6e 100644 (file)
@@ -43,7 +43,7 @@ static void set_floor_and_wall_aux(s16b feat_type[100], feat_prob prob[DUNGEON_F
  */
 void set_floor_and_wall(DUNGEON_IDX type)
 {
-       static byte cur_type = 255;
+       DUNGEON_IDX cur_type = 255;
        dungeon_info_type *d_ptr;
 
        /* Already filled */
@@ -74,8 +74,7 @@ void set_floor_and_wall(DUNGEON_IDX type)
  * @param depth_max 深みの最大値
  * @return なし
  */
-static void perturb_point_mid(int x1, int x2, int x3, int x4,
-                         int xmid, int ymid, int rough, int depth_max)
+static void perturb_point_mid(POSITION x1, POSITION x2, POSITION x3, POSITION x4, POSITION xmid, POSITION ymid, POSITION rough, POSITION depth_max)
 {
        /*
         * Average the four corners & perturb it a bit.
@@ -154,12 +153,11 @@ static void perturb_point_end(int x1, int x2, int x3,
  * need to be converted to features.
  * </pre>
  */
-static void plasma_recursive(int x1, int y1, int x2, int y2,
-                            int depth_max, int rough)
+static void plasma_recursive(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION depth_max, POSITION rough)
 {
        /* Find middle */
-       int xmid = (x2 - x1) / 2 + x1;
-       int ymid = (y2 - y1) / 2 + y1;
+       POSITION xmid = (x2 - x1) / 2 + x1;
+       POSITION ymid = (y2 - y1) / 2 + y1;
 
        /* Are we done? */
        if (x1 + 1 == x2) return;
@@ -205,7 +203,7 @@ static s16b terrain_table[MAX_WILDERNESS][MAX_FEAT_IN_TERRAIN];
  */
 static void generate_wilderness_area(int terrain, u32b seed, bool border, bool corner)
 {
-       int x1, y1;
+       POSITION x1, y1;
        int table_size = sizeof(terrain_table[0]) / sizeof(s16b);
        int roughness = 1; /* The roughness of the level. */
        u32b state_backup[4];
@@ -315,9 +313,9 @@ static void generate_wilderness_area(int terrain, u32b seed, bool border, bool c
  * If corner is set then only the corners of the area are needed.
  * </pre>
  */
-static void generate_area(int y, int x, bool border, bool corner)
+static void generate_area(POSITION y, POSITION x, bool border, bool corner)
 {
-       int x1, y1;
+       POSITION x1, y1;
 
        /* Number of the town (if any) */
        p_ptr->town_num = (s16b)wilderness[y][x].town;
@@ -657,12 +655,12 @@ void wilderness_gen(void)
        player_place(p_ptr->oldpy, p_ptr->oldpx);
        /* p_ptr->leaving_dungeon = FALSE;*/
 
-       lim = (generate_encounter==TRUE)?40:MIN_M_ALLOC_TN;
+       lim = (generate_encounter == TRUE) ? 40 : MIN_M_ALLOC_TN;
 
        /* Make some residents */
        for (i = 0; i < lim; i++)
        {
-               u32b mode = 0;
+               BIT_FLAGS mode = 0;
 
                if (!(generate_encounter || (one_in_(2) && (!p_ptr->town_num))))
                        mode |= PM_ALLOW_SLEEP;
@@ -678,7 +676,7 @@ void wilderness_gen(void)
        set_floor_and_wall(0);
 
        /* Set rewarded quests to finished */
-       for (i = 0; i < max_quests; i++)
+       for (i = 0; i < max_q_idx; i++)
        {
                if (quest[i].status == QUEST_STATUS_REWARDED)
                        quest[i].status = QUEST_STATUS_FINISHED;
@@ -916,7 +914,7 @@ errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, in
  */
 void seed_wilderness(void)
 {
-       int x, y;
+       POSITION x, y;
 
        /* Init wilderness seeds */
        for (x = 0; x < max_wild_x; x++)
@@ -972,7 +970,7 @@ static void init_terrain_table(int terrain, s16b feat_global, cptr fmt, ...)
        cptr    p;
        int     cur = 0;
        char    check = 'a';
-       s16b    feat;
+       FEAT_IDX feat;
        int     num;
 
        /* Begin the varargs stuff */
@@ -1175,8 +1173,8 @@ bool change_wild_mode(void)
        p_ptr->energy_use = 1000;
 
        /* Remember the position */
-       p_ptr->oldpx = (s16b)p_ptr->x;
-       p_ptr->oldpy = (s16b)p_ptr->y;
+       p_ptr->oldpx = p_ptr->x;
+       p_ptr->oldpy = p_ptr->y;
 
        /* Cancel hex spelling */
        if (hex_spelling_any()) stop_hex_spell_all();