OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / rooms.c
index fbc08ef..4e4bbd1 100644 (file)
@@ -125,9 +125,9 @@ static byte room_build_order[ROOM_T_MAX] = {
  * Note - this should be used only on allocated regions
  * within another room.
  */
-void build_small_room(int x0, int y0)
+void build_small_room(POSITION x0, POSITION y0)
 {
-       int x, y;
+       POSITION x, y;
 
        for (y = y0 - 1; y <= y0 + 1; y++)
        {
@@ -167,9 +167,10 @@ void build_small_room(int x0, int y0)
  * @param y2 範囲の下端
  * @return なし
  */
-static void check_room_boundary(int x1, int y1, int x2, int y2)
+static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION y2)
 {
-       int count, x, y;
+       int count;
+       POSITION x, y;
        bool old_is_floor, new_is_floor;
 
 
@@ -470,10 +471,10 @@ typedef struct fill_data_type fill_data_type;
 struct fill_data_type
 {
        /* area size */
-       int xmin;
-       int ymin;
-       int xmax;
-       int ymax;
+       POSITION xmin;
+       POSITION ymin;
+       POSITION xmax;
+       POSITION ymax;
 
        /* cutoffs */
        int c1;
@@ -481,9 +482,9 @@ struct fill_data_type
        int c3;
 
        /* features to fill with */
-       int feat1;
-       int feat2;
-       int feat3;
+       FEAT_IDX feat1;
+       FEAT_IDX feat2;
+       FEAT_IDX feat3;
 
        int info1;
        int info2;
@@ -498,7 +499,7 @@ static fill_data_type fill_data;
 
 /* Store routine for the fractal cave generator */
 /* this routine probably should be an inline function or a macro. */
-static void store_height(int x, int y, int val)
+static void store_height(POSITION x, POSITION y, int val)
 {
        /* if on boundary set val > cutoff so walls are not as square */
        if (((x == fill_data.xmin) || (y == fill_data.ymin) ||
@@ -764,7 +765,7 @@ void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int g
 }
 
 
-static bool hack_isnt_wall(int y, int x, int c1, int c2, int c3, int feat1, int feat2, int feat3, int info1, int info2, int info3)
+static bool hack_isnt_wall(POSITION y, POSITION x, int c1, int c2, int c3, int feat1, int feat2, int feat3, int info1, int info2, int info3)
 {
        /*
         * function used to convert from height-map back to the
@@ -1148,10 +1149,11 @@ void build_cavern(void)
        }
 }
 
-bool generate_lake(int y0, int x0, int xsize, int ysize, int c1, int c2, int c3, int type)
+bool generate_lake(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type)
 {
-       int x, y, i, xhsize, yhsize;
-       int feat1, feat2, feat3;
+       POSITION x, y, xhsize, yhsize;
+       int i;
+       FEAT_IDX feat1, feat2, feat3;
 
        /* offsets to middle from corner */
        xhsize = xsize / 2;
@@ -1350,9 +1352,9 @@ void build_lake(int type)
 /*
  * Routine that fills the empty areas of a room with treasure and monsters.
  */
-void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
+void fill_treasure(POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty)
 {
-       int x, y, cx, cy, size;
+       POSITION x, y, cx, cy, size;
        s32b value;
 
        /* center of room:*/
@@ -1489,9 +1491,10 @@ void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
  * The area inside the walls is not touched:
  * only granite is removed- normal walls stay
  */
-void build_room(int x1, int x2, int y1, int y2)
+void build_room(POSITION x1, POSITION x2, POSITION y1, POSITION y2)
 {
-       int x, y, i, xsize, ysize, temp;
+       POSITION x, y, xsize, ysize;
+       int i, temp;
 
        /* Check if rectangle has no width */
        if ((x1 == x2) || (y1 == y2)) return;
@@ -1576,7 +1579,7 @@ void build_room(int x1, int x2, int y1, int y2)
  * is the randint0(3) below; it governs the relative density of
  * twists and turns in the labyrinth: smaller number, more twists.
  */
-void r_visit(int y1, int x1, int y2, int x2, int node, int dir, int *visited)
+void r_visit(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int node, DIRECTION dir, int *visited)
 {
        int i, j, m, n, temp, x, y, adj[4];
 
@@ -1660,10 +1663,10 @@ void r_visit(int y1, int x1, int y2, int x2, int node, int dir, int *visited)
 }
 
 
-void build_maze_vault(int x0, int y0, int xsize, int ysize, bool is_vault)
+void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault)
 {
-       int y, x, dy, dx;
-       int y1, x1, y2, x2;
+       POSITION y, x, dy, dx;
+       POSITION y1, x1, y2, x2;
        int m, n, num_vertices, *visited;
        bool light;
        cave_type *c_ptr;
@@ -1731,10 +1734,10 @@ void build_maze_vault(int x0, int y0, int xsize, int ysize, bool is_vault)
  * The power variable is a measure of how well defended a region is.
  * This alters the possible choices.
  */
-void build_recursive_room(int x1, int y1, int x2, int y2, int power)
+void build_recursive_room(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power)
 {
-       int xsize, ysize;
-       int x, y;
+       POSITION xsize, ysize;
+       POSITION x, y;
        int choice;
 
        /* Temp variables */
@@ -1935,7 +1938,7 @@ void build_recursive_room(int x1, int y1, int x2, int y2, int power)
  * Note: no range checking is done so must be inside dungeon
  * This routine also stomps on doors
  */
-void add_outer_wall(int x, int y, int light, int x1, int y1, int x2, int y2)
+void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
 {
        cave_type *c_ptr;
        feature_type *f_ptr;
@@ -1987,9 +1990,9 @@ void add_outer_wall(int x, int y, int light, int x1, int y1, int x2, int y2)
  * Hacked distance formula - gives the 'wrong' answer.
  * Used to build crypts
  */
-int dist2(int x1, int y1, int x2, int y2, int h1, int h2, int h3, int h4)
+POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4)
 {
-       int dx, dy;
+       POSITION dx, dy;
        dx = abs(x2 - x1);
        dy = abs(y2 - y1);
 
@@ -2012,9 +2015,9 @@ int dist2(int x1, int y1, int x2, int y2, int h1, int h2, int h3, int h4)
 
 
 /* Create a new floor room with optional light */
-void generate_room_floor(int y1, int x1, int y2, int x2, int light)
+void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light)
 {
-       int y, x;
+       POSITION y, x;
        
        cave_type *c_ptr;
 
@@ -2031,9 +2034,9 @@ void generate_room_floor(int y1, int x1, int y2, int x2, int light)
        }
 }
 
-void generate_fill_perm_bold(int y1, int x1, int y2, int x2)
+void generate_fill_perm_bold(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
-       int y, x;
+       POSITION y, x;
 
        for (y = y1; y <= y2; y++)
        {
@@ -2052,7 +2055,7 @@ void generate_fill_perm_bold(int y1, int x1, int y2, int x2)
  * @note that we restrict the number of "crowded" rooms to reduce the chance of overflowing the monster list during level creation.
  * @return 部屋の精製に成功した場合 TRUE を返す。
  */
-static bool room_build(int typ)
+static bool room_build(EFFECT_ID typ)
 {
        /* Build a room */
        switch (typ)