From ca95e9feead55e38c1078a09c3525549681ca0eb Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 16 Aug 2025 02:25:48 -0600 Subject: Nearly nothing lmao --- src/world.c | 13 +++---------- 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; }; -- cgit v1.2.3