aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
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);
}