• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: コミット

変愚蛮怒のメインリポジトリです


コミットメタ情報

リビジョン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().

変更サマリ

差分

--- a/src/rooms.c
+++ b/src/rooms.c
@@ -526,9 +526,9 @@ struct fill_data_type
526526 static fill_data_type fill_data;
527527
528528
529-/* Store routine for the fractal p_ptr->current_floor_ptr->grid_array generator */
529+/* Store routine for the fractal floor generator */
530530 /* 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)
532532 {
533533 /* if on boundary set val > cutoff so walls are not as square */
534534 if (((x == fill_data.xmin) || (y == fill_data.ymin) ||
@@ -536,7 +536,7 @@ static void store_height(POSITION x, POSITION y, FEAT_IDX val)
536536 (val <= fill_data.c1)) val = fill_data.c1 + 1;
537537
538538 /* 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;
540540
541541 return;
542542 }
@@ -709,12 +709,12 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
709709 if (xhstep2 > grd)
710710 {
711711 /* If greater than 'grid' level then is random */
712- store_height(ii, jj, randint1(maxsize));
712+ store_height(floor_ptr, ii, jj, randint1(maxsize));
713713 }
714714 else
715715 {
716716 /* Average of left and right points +random bit */
717- store_height(ii, jj,
717+ store_height(floor_ptr, ii, jj,
718718 (floor_ptr->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
719719 + floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
720720 + (randint1(xstep2) - xhstep2) * roug / 16);
@@ -739,12 +739,12 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
739739 if (xhstep2 > grd)
740740 {
741741 /* If greater than 'grid' level then is random */
742- store_height(ii, jj, randint1(maxsize));
742+ store_height(floor_ptr, ii, jj, randint1(maxsize));
743743 }
744744 else
745745 {
746746 /* Average of up and down points +random bit */
747- store_height(ii, jj,
747+ store_height(floor_ptr, ii, jj,
748748 (floor_ptr->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
749749 + floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
750750 + (randint1(ystep2) - yhstep2) * roug / 16);
@@ -768,7 +768,7 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
768768 if (xhstep2 > grd)
769769 {
770770 /* If greater than 'grid' level then is random */
771- store_height(ii, jj, randint1(maxsize));
771+ store_height(floor_ptr, ii, jj, randint1(maxsize));
772772 }
773773 else
774774 {
@@ -782,7 +782,7 @@ void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsi
782782 * Average over all four corners + scale by diagsize to
783783 * reduce the effect of the square grid on the shape of the fractal
784784 */
785- store_height(ii, jj,
785+ store_height(floor_ptr, ii, jj,
786786 (floor_ptr->grid_array[ym][xm].feat + floor_ptr->grid_array[yp][xm].feat
787787 + floor_ptr->grid_array[ym][xp].feat + floor_ptr->grid_array[yp][xp].feat) / 4
788788 + (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
旧リポジトリブラウザで表示