From: Randy McShandy Date: Thu, 26 Sep 2024 01:07:05 +0000 (-0500) Subject: I was doing some orbs thing I guess, stuff this away for now X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Forbs;p=barrow_crawler I was doing some orbs thing I guess, stuff this away for now --- diff --git a/bin/posix_BC b/bin/posix_BC index 378bd79..8d018ec 100755 Binary files a/bin/posix_BC and b/bin/posix_BC differ diff --git a/src/main.c b/src/main.c index bf43b64..187ec7a 100755 --- a/src/main.c +++ b/src/main.c @@ -18,7 +18,7 @@ int main(int argc, char** argv) room_positions = (Vector3*)malloc(sizeof(Vector3)*(room_count + 1)); /* TODO: Clean this up and integrate into platform system. */ -#define ENABLE_BARROWGEN 0 +#define ENABLE_BARROWGEN 1 #if ENABLE_BARROWGEN barrow.max_iterations *= 1; IVec2 grid_size = {.x = GRID_X*2.0, .y = GRID_Y * 2.0}; diff --git a/src/render_raylib.c b/src/render_raylib.c index 51210ce..9c29b21 100644 --- a/src/render_raylib.c +++ b/src/render_raylib.c @@ -119,7 +119,10 @@ void drawing_game_mode() DrawModelEx(barrow_model, barrow_position, barrow_rotation_axis, barrow_rotation, barrow_scale, DARKGRAY); DrawModelEx(floor_model, floor_position, floor_rotation_axis, floor_rotation, floor_scale, DARKGRAY); - DrawSphere(room_positions[0], 0.25, RED); + for (int n = 0; n < room_count+1; n++) + { + DrawSphere(room_positions[n], 0.25, LIME); + } EndShaderMode(); EndMode3D(); @@ -147,9 +150,7 @@ void drawing_game_mode() void drawing_resource_ready_mode() { - static int status_phase = 0; const float font_size = 32.0f; - const char format_string[] = "%s\n\n%3.2f%%"; const char tribute_string[] = "This game is dedicated to the North American Muskrat, Ondatra Zibethicus"; ClearBackground(LIGHTGRAY); @@ -311,7 +312,15 @@ void wait_initialize_resources() barrow_model.materials[0].shader = shader; room_positions[0] = (Vector3){barrow_scale.x/2.0f, floor_position.y - 1.0f, -barrow_scale.z/2.0f}; + printf("bs %f %f %f\n", VEC3_UNROLL(barrow_scale)); printf("sphere %f %f %f\n", VEC3_UNROLL(room_positions[0])); + for (int n = 1; n < room_count+1; n++) + { + room_positions[n].z *= -1.0f; + room_positions[n].x += room_positions[0].x/2.0f; + room_positions[n].z += room_positions[0].z/2.0f; + printf("rp %f %f %f\n", VEC3_UNROLL(room_positions[n])); + } while(!IsModelReady(barrow_model)){} } @@ -364,7 +373,7 @@ void initialize_renderer() cam.position = barrow_position; cam.position.y -= 0.5f; cam.position.x = barrow_scale.x/2.0f; - cam.position.z = (-barrow_scale.z/2.0f); + cam.position.z = (-barrow_scale.z/2.0f) - 3.0f; cam.target = (Vector3){barrow_scale.x/2.0f, cam.position.y - 7.0f, cam.position.z/2.0f}; cam.up = (Vector3){0.0f, 1.0f, 0.0f}; cam.fovy = 90.0f; diff --git a/src/structs.c b/src/structs.c index 91b6bda..88bfac7 100644 --- a/src/structs.c +++ b/src/structs.c @@ -81,6 +81,8 @@ const IVec2 img_export_scale = {.x = 2, .y = 2}; float resource_generation_progress = 0.0f; int resource_state = 0; +// TODO: If barrow generation is turned off, these won't populate. +// Ideally find a better way to track positions. Probably something in the map. const int room_count = 7; Vector3* room_positions = NULL; diff --git a/src/utils.c b/src/utils.c index 2f65636..7897b74 100644 --- a/src/utils.c +++ b/src/utils.c @@ -149,7 +149,12 @@ int initialize(int worker_count, RD_Opts active_opt) int seed_y = ((sinf(angle) * (dist_offset + (grid_size.y/4.0f))) + (grid_size.y/2.0f)); // TODO: One of these will probably have to be mirrored. - room_positions[n+1] = (Vector3){.x = seed_x, .y = 0.0f, .z = seed_y}; + room_positions[n+1] = (Vector3) + { + .x = seed_x - center_x, + .y = -3.0f, + .z = seed_y - center_y + }; grid[seed_x][seed_y].b = 1.0f; grid[seed_x][seed_y].c = 0.0f;