From 89bf17ccdbfa3247c41b61756d7503ddd5947d75 Mon Sep 17 00:00:00 2001 From: Randy McShandy Date: Thu, 9 May 2024 20:34:05 -0500 Subject: [PATCH] Transition small room generation to circlish --- src/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } } } -- 2.49.0