OSDN Git Service

[Refactor] #38997 is_floor_bold() に floor_type * 引数を追加. / Add floor_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 21 Sep 2019 03:21:46 +0000 (12:21 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 21 Sep 2019 03:21:46 +0000 (12:21 +0900)
src/floor-generate.c
src/grid.c
src/grid.h
src/rooms-normal.c
src/rooms-vault.c
src/rooms.c

index ee37df3..c27fbc9 100644 (file)
@@ -1770,7 +1770,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
                else return FALSE;
        }
 
-       if (is_floor_bold(*y, *x))
+       if (is_floor_bold(p_ptr->current_floor_ptr, *y, *x))
        {
                /* Don't do anything */
                return TRUE;
index 2a4fd36..3159996 100644 (file)
@@ -502,7 +502,7 @@ void add_door(POSITION x, POSITION y)
        *  .=floor, #=wall
        */
 
-       if (is_floor_bold(y - 1, x) && is_floor_bold(y + 1, x) &&
+       if (is_floor_bold(p_ptr->current_floor_ptr, y - 1, x) && is_floor_bold(p_ptr->current_floor_ptr, y + 1, x) &&
                (is_outer_bold(y, x - 1) && is_outer_bold(y, x + 1)))
        {
                /* secret door */
@@ -523,7 +523,7 @@ void add_door(POSITION x, POSITION y)
        *  .=floor, #=wall
        */
        if (is_outer_bold(y - 1, x) && is_outer_bold(y + 1, x) &&
-               is_floor_bold(y, x - 1) && is_floor_bold(y, x + 1))
+               is_floor_bold(p_ptr->current_floor_ptr, y, x - 1) && is_floor_bold(p_ptr->current_floor_ptr, y, x + 1))
        {
                /* secret door */
                place_secret_door(y, x, DOOR_DEFAULT);
@@ -867,7 +867,7 @@ bool get_is_floor(POSITION x, POSITION y)
        }
 
        /* Do the real check */
-       if (is_floor_bold(y, x)) return (TRUE);
+       if (is_floor_bold(p_ptr->current_floor_ptr, y, x)) return (TRUE);
 
        return (FALSE);
 }
index 5fa1bd6..bfecd6a 100644 (file)
@@ -41,8 +41,7 @@
   * Note the special fields for the "MONSTER_FLOW" code.
   */
 
-typedef struct player_type player_type;
-
+typedef struct player_type player_type; // TODO: Delete Finally.
 
 typedef struct grid_type grid_type;
 
@@ -100,7 +99,7 @@ typedef struct
  * @param X 指定X座標
  * @return FLOOR属性を持っているならばTRUE
  */
-#define is_floor_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_FLOOR)
+#define is_floor_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_FLOOR)
 #define is_extra_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_EXTRA)
 
 #define is_inner_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_INNER)
index d749f9c..9d74463 100644 (file)
@@ -1021,7 +1021,7 @@ bool build_type12(floor_type *floor_ptr)
        {
                for (y = y0 - 2; y <= y0 + 2; y++)
                {
-                       if (!is_floor_bold(y, x))
+                       if (!is_floor_bold(floor_ptr, y, x))
                        {
                                /* Wall in the way */
                                emptyflag = FALSE;
index ff0cc73..d71ae91 100644 (file)
@@ -1111,7 +1111,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
                {
                        total = x - x1 + y - y1;
                        /* If total is odd- and is a floor then make a wall */
-                       if ((total % 2 == 1) && is_floor_bold(y, x))
+                       if ((total % 2 == 1) && is_floor_bold(p_ptr->current_floor_ptr, y, x))
                        {
                                place_inner_bold(y, x);
                        }
index df56108..d2accd1 100644 (file)
@@ -1086,7 +1086,7 @@ bool generate_fracave(POSITION y0, POSITION x0, POSITION xsize, POSITION ysize,
        {
                for (y = 1; y < ysize; ++y)
                {
-                       if (is_floor_bold(y0 + y - yhsize, x0 + x - xhsize) &&
+                       if (is_floor_bold(p_ptr->current_floor_ptr, y0 + y - yhsize, x0 + x - xhsize) &&
                            (p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
                        {
                                /* Clear the icky flag in the filled region */
@@ -1403,7 +1403,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                        if ((randint1(100) - difficulty * 3) > 50) value = 20;
 
                         /* if floor, shallow water and lava */
-                       if (is_floor_bold(y, x) ||
+                       if (is_floor_bold(p_ptr->current_floor_ptr, y, x) ||
                            (cave_have_flag_bold(y, x, FF_PLACE) && cave_have_flag_bold(y, x, FF_DROP)))
                        {
                                /* The smaller 'value' is, the better the stuff */
@@ -1982,7 +1982,7 @@ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1,
 
        f_ptr = &f_info[g_ptr->feat];
 
-       if (is_floor_bold(y, x))
+       if (is_floor_bold(p_ptr->current_floor_ptr, y, x))
        {
                for (i = -1; i <= 1; i++)
                {