From: Randy McShandy Date: Fri, 10 May 2024 01:34:05 +0000 (-0500) Subject: Transition small room generation to circlish X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=89bf17ccdbfa3247c41b61756d7503ddd5947d75;p=barrow_crawler Transition small room generation to circlish --- diff --git a/src/utils.c b/src/utils.c index 6fe514a..8e75c34 100644 --- a/src/utils.c +++ b/src/utils.c @@ -125,6 +125,7 @@ int initialize(int worker_count, RD_Opts active_opt) const int seed_count = 9;//sqrt(grid_size.x) * 2; const int width = 12 * (grid_size.x/128); const int height = width * 1; + const float small_room_radius = 16.0f; float phase = ((rand() % 360)/(float)360) * (M_PI*2); for (int n = 0; n < seed_count; n++) @@ -142,10 +143,9 @@ int initialize(int worker_count, RD_Opts active_opt) { for (int y = seed_y-(height/2); y < seed_y+(height/2); y++) { - if (y >= grid_size.y || x >= grid_size.x || y < 0 || x < 0) - continue; - // Third parameter for permanent presence of B chemicals (black) - grid[x][y].c = 1.0f; + if ((sqrtf(((x-seed_x)*(x-seed_x))+((y-seed_y)*(y-seed_y))) < small_room_radius)) + // Third parameter for permanent presence of B chemicals (black) + grid[x][y].c = 1.0f; } } }