aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-09-20 23:17:18 +0000
committernathan <nathansmith@disroot.org>2025-09-20 23:17:18 +0000
commitae9fea1a684d86ecfa7c8101f22a73b8099d0b78 (patch)
treed22bffdfc81397bbf4e01736d2fbf4e87794ea2e /src/world.c
parent07a21742993aaaf850c5211aaec0f922be5026b8 (diff)
downloadFindThings-ae9fea1a684d86ecfa7c8101f22a73b8099d0b78.tar.gz
FindThings-ae9fea1a684d86ecfa7c8101f22a73b8099d0b78.tar.bz2
FindThings-ae9fea1a684d86ecfa7c8101f22a73b8099d0b78.zip
Samantha has a cursed floor now
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/world.c b/src/world.c
index ee465b2..b6fb9dc 100644
--- a/src/world.c
+++ b/src/world.c
@@ -485,8 +485,8 @@ Seed generatePond(World* world, Color* heightmap, WorldUID id, Seed seed)
return seed;
}
-void generateWorldSamanthasPlace(World* world, Color* heightmap,
- WorldUID* placeId)
+void generateWorldSamanthasPlace(World* world, const Assets* assets,
+ Color* heightmap, WorldUID* placeId)
{
// Make area flat.
float width = SAMANTHAS_SPOT_SIZE * (WORLD_IMAGE_WIDTH / world->size.x)
@@ -544,6 +544,14 @@ void generateWorldSamanthasPlace(World* world, Color* heightmap,
trashPosition.x += (float)(SAMANTHAS_SPOT_SIZE * 2.0)
/ SAMANTHAS_SPOT_TRASH_COUNT;
}
+
+ // Floor.
+ Mesh floor = GenMeshPlane(SAMANTHAS_SPOT_SIZE * 2.0,
+ SAMANTHAS_SPOT_SIZE * 2.0,
+ 2, 2);
+ world->samanthasSpotFloor = LoadModelFromMesh(floor);
+ world->samanthasSpotFloor.materials[0].maps[MATERIAL_MAP_DIFFUSE]
+ .texture = assets->textures[SAMANTHA_FLOOR_TEXTURE];
}
Seed generateWorldPlants(World* world, Seed seed, int start, int end)
@@ -734,7 +742,7 @@ World createWorld(Seed seed, const Assets* assets)
world.places[0] = placeId;
++placeId;
- generateWorldSamanthasPlace(&world, colors, &placeId);
+ generateWorldSamanthasPlace(&world, assets, colors, &placeId);
// Heightmap model.
image = (Image){
@@ -856,6 +864,7 @@ void freeWorld(World world)
UnloadTexture(
world.heightmap.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture);
UnloadModel(world.heightmap);
+ UnloadModel(world.samanthasSpotFloor);
freeWorldBVH(world.bvh);
}