aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--design.org3
-rw-r--r--src/player.c28
-rw-r--r--src/world.c4
-rw-r--r--src/world.h3
4 files changed, 23 insertions, 15 deletions
diff --git a/design.org b/design.org
index 3cd3462..293018e 100644
--- a/design.org
+++ b/design.org
@@ -94,8 +94,9 @@ creates is possible to beat. A little wack is fine as long as its
beatable. Since most of the world will just be a height map a image will be
generated first than rest of the world will be based around it.
-* TODO World generation check list [1/6]
+* TODO World generation check list [2/7]
+ [X] Basic terrain
++ [X] Ground texture
+ [ ] Trees/plants
+ [ ] Pond
+ [ ] Power lines
diff --git a/src/player.c b/src/player.c
index 136a006..fbf404d 100644
--- a/src/player.c
+++ b/src/player.c
@@ -83,22 +83,22 @@ void updatePlayer(Player* player, Game* game)
camera->position = player->position;
camera->target = Vector3Add(player->position, player->direction);
-#ifdef FT_DEBUG_MODE
- Ray ray = (Ray){
- .position = player->position,
- .direction = player->direction
- };
+/* #ifdef FT_DEBUG_MODE */
+/* Ray ray = (Ray){ */
+/* .position = player->position, */
+/* .direction = player->direction */
+/* }; */
- DrawRay(ray, YELLOW);
+/* DrawRay(ray, YELLOW); */
- int tests;
- WorldUID uid = castRayAtWorld(&game->world, ray, &tests);
+/* int tests; */
+/* WorldUID uid = castRayAtWorld(&game->world, ray, &tests); */
- printf("%d\n", tests);
+/* printf("%d\n", tests); */
- if (uid != -1)
- {
- DrawBoundingBox(game->world.entities[uid].box, RED);
- }
-#endif
+/* if (uid != -1) */
+/* { */
+/* DrawBoundingBox(game->world.entities[uid].box, RED); */
+/* } */
+/* #endif */
}
diff --git a/src/world.c b/src/world.c
index 17269ec..9e4e936 100644
--- a/src/world.c
+++ b/src/world.c
@@ -381,6 +381,10 @@ World createWorld(Seed seed)
// Heightmap.
Mesh mesh = GenMeshHeightmap(image, world.size);
world.heightmap = LoadModelFromMesh(mesh);
+
+ // Texture.
+ ImageColorTint(&image, WORLD_GROUND_COLOR);
+ ImageBlurGaussian(&image, WORLD_GROUND_BLUR);
world.texture = LoadTextureFromImage(image);
world.heightmap.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture =
world.texture;
diff --git a/src/world.h b/src/world.h
index c255e17..0a90ec4 100644
--- a/src/world.h
+++ b/src/world.h
@@ -16,6 +16,9 @@
#define WORLD_IMAGE_SCALE 5.0
#define WORLD_TREE_COUNT 500
+#define WORLD_GROUND_COLOR GREEN
+#define WORLD_GROUND_BLUR 4
+
// UID for anything in the world.
typedef int16_t WorldUID;
typedef int Seed;