]> git.mcshandy.xyz Git - barrow_crawler/commitdiff
I was doing some orbs thing I guess, stuff this away for now orbs
authorRandy McShandy <randy@mcshandy.xyz>
Thu, 26 Sep 2024 01:07:05 +0000 (20:07 -0500)
committerRandy McShandy <randy@mcshandy.xyz>
Thu, 26 Sep 2024 01:07:05 +0000 (20:07 -0500)
bin/posix_BC
src/main.c
src/render_raylib.c
src/structs.c
src/utils.c

index 378bd79aa3cffd11bfb0063ed5d6b311bd7b8008..8d018ec8edf47899e5ddebc1033104c578b61056 100755 (executable)
Binary files a/bin/posix_BC and b/bin/posix_BC differ
index bf43b6455a4b0d372f70a07537dcc4628c819d8c..187ec7ad71e8fab41d52d393d5d20f31a23a7c03 100755 (executable)
@@ -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};
index 51210ce730b3fd6e7b1cab431aa05b3f3128033f..9c29b21efb5e2384d9fdabaaee9b350d8b6e7635 100644 (file)
@@ -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;
index 91b6bdab07a5ff9e1fcf534e65b79260824efb19..88bfac727710410ae3edbc4c1f08657c1b677f36 100644 (file)
@@ -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;
 
index 2f65636bf720d18771c024e9f3f7b310e20c48bc..7897b745cbe1f9c2e0c5fe9afc7eac8e5611bc3a 100644 (file)
@@ -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;