diff options
author | nathan <nathansmith@disroot.org> | 2025-08-16 08:25:48 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-08-16 08:25:48 +0000 |
commit | ca95e9feead55e38c1078a09c3525549681ca0eb (patch) | |
tree | 721ed3ae6444ff1e383a5dd52614ba2c79c1ed82 | |
parent | cdb76a1829f17b0f4f0ec117b1cfc2c39c664052 (diff) | |
download | FindThings-ca95e9feead55e38c1078a09c3525549681ca0eb.tar.gz FindThings-ca95e9feead55e38c1078a09c3525549681ca0eb.tar.bz2 FindThings-ca95e9feead55e38c1078a09c3525549681ca0eb.zip |
Nearly nothing lmao
-rw-r--r-- | src/world.c | 13 | ||||
-rw-r--r-- | src/world.h | 2 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/world.c b/src/world.c index bd1c3c4..2130468 100644 --- a/src/world.c +++ b/src/world.c @@ -476,19 +476,13 @@ Seed generateWorldPlants(World* world, Seed seed, int start, int end) Seed generateWorldUtilityPoles(World* world, const Assets* assets, Seed seed, int start, int end) { - world->utilityPoleTransforms = (Matrix*)FT_CALLOC(WORLD_UTILITY_POLE_COUNT, - sizeof(Matrix)); - - if (world->utilityPoleTransforms == NULL) - { - ALLOCATION_ERROR; - return seed; - } - assets->models[UTILITY_POLE_MODEL].materials[0].shader = assets->shaders[INSTANCING_SHADER]; assets->models[UTILITY_POLE_MODEL].materials[0] .maps[MATERIAL_MAP_DIFFUSE].color = BROWN; + + float centerZ = world->size.z / 2.0; + float spacing = (float)world->size.x / WORLD_UTILITY_POLE_COUNT; for (int index = start; index < end; ++index) { @@ -670,7 +664,6 @@ void freeWorld(World world) UnloadTexture( world.heightmap.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture); UnloadModel(world.heightmap); - FT_FREE(world.utilityPoleTransforms); freeWorldBVH(world.bvh); } diff --git a/src/world.h b/src/world.h index 21e4c4c..8cfa91f 100644 --- a/src/world.h +++ b/src/world.h @@ -58,7 +58,7 @@ struct World { BVHNode bvh; // Transforms for mesh instancing. - Matrix* utilityPoleTransforms; + Matrix utilityPoleTransforms[WORLD_UTILITY_POLE_COUNT]; int bvhDebugSelect; }; |