リビジョン | 1442993f308db1aab55dda4ce8a87d65e77cfe6f (tree) |
---|---|
日時 | 2019-10-16 20:07:56 |
作者 | deskull <deskull@user...> |
コミッター | deskull |
[Refactor] #38997 store_height() に floor_type * 引数を追加. / Add floor_type * argument to store_height().
@@ -526,9 +526,9 @@ struct fill_data_type | ||
526 | 526 | static fill_data_type fill_data; |
527 | 527 | |
528 | 528 | |
529 | -/* Store routine for the fractal p_ptr->current_floor_ptr->grid_array generator */ | |
529 | +/* Store routine for the fractal floor generator */ | |
530 | 530 | /* this routine probably should be an inline function or a macro. */ |
531 | -static void store_height(POSITION x, POSITION y, FEAT_IDX val) | |
531 | +static void store_height(floor_type *floor_ptr, POSITION x, POSITION y, FEAT_IDX val) | |
532 | 532 | { |
533 | 533 | /* if on boundary set val > cutoff so walls are not as square */ |
534 | 534 | if (((x == fill_data.xmin) || (y == fill_data.ymin) || |
@@ -536,7 +536,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val) | ||
536 | 536 | (val <= fill_data.c1)) val = fill_data.c1 + 1; |
537 | 537 | |
538 | 538 | /* store the value in height-map format */ |
539 | - p_ptr->current_floor_ptr->grid_array[y][x].feat = val; | |
539 | + floor_ptr->grid_array[y][x].feat = val; | |
540 | 540 | |
541 | 541 | return; |
542 | 542 | } |
@@ -709,12 +709,12 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi | ||
709 | 709 | if (xhstep2 > grd) |
710 | 710 | { |
711 | 711 | /* If greater than 'grid' level then is random */ |
712 | - store_height(ii, jj, randint1(maxsize)); | |
712 | + store_height(floor_ptr, ii, jj, randint1(maxsize)); | |
713 | 713 | } |
714 | 714 | else |
715 | 715 | { |
716 | 716 | /* Average of left and right points +random bit */ |
717 | - store_height(ii, jj, | |
717 | + store_height(floor_ptr, ii, jj, | |
718 | 718 | (floor_ptr->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat |
719 | 719 | + floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2 |
720 | 720 | + (randint1(xstep2) - xhstep2) * roug / 16); |
@@ -739,12 +739,12 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi | ||
739 | 739 | if (xhstep2 > grd) |
740 | 740 | { |
741 | 741 | /* If greater than 'grid' level then is random */ |
742 | - store_height(ii, jj, randint1(maxsize)); | |
742 | + store_height(floor_ptr, ii, jj, randint1(maxsize)); | |
743 | 743 | } |
744 | 744 | else |
745 | 745 | { |
746 | 746 | /* Average of up and down points +random bit */ |
747 | - store_height(ii, jj, | |
747 | + store_height(floor_ptr, ii, jj, | |
748 | 748 | (floor_ptr->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat |
749 | 749 | + floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2 |
750 | 750 | + (randint1(ystep2) - yhstep2) * roug / 16); |
@@ -768,7 +768,7 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi | ||
768 | 768 | if (xhstep2 > grd) |
769 | 769 | { |
770 | 770 | /* If greater than 'grid' level then is random */ |
771 | - store_height(ii, jj, randint1(maxsize)); | |
771 | + store_height(floor_ptr, ii, jj, randint1(maxsize)); | |
772 | 772 | } |
773 | 773 | else |
774 | 774 | { |
@@ -782,7 +782,7 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi | ||
782 | 782 | * Average over all four corners + scale by diagsize to |
783 | 783 | * reduce the effect of the square grid on the shape of the fractal |
784 | 784 | */ |
785 | - store_height(ii, jj, | |
785 | + store_height(floor_ptr, ii, jj, | |
786 | 786 | (floor_ptr->grid_array[ym][xm].feat + floor_ptr->grid_array[yp][xm].feat |
787 | 787 | + floor_ptr->grid_array[ym][xp].feat + floor_ptr->grid_array[yp][xp].feat) / 4 |
788 | 788 | + (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug); |