aboutsummaryrefslogtreecommitdiffstats
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/game.c b/src/game.c
index 35b4c9a..7a5be42 100644
--- a/src/game.c
+++ b/src/game.c
@@ -20,15 +20,8 @@ void initGame(Game* game)
game->player = createPlayer();
game->player.position = (Vector3){50.0, 30.0, 50.0};
- // Heightmap.
- Mesh heightmapMesh = GenMeshHeightmap(game->assets.images[HEIGHT_MAP_IMAGE],
- (Vector3){1000.0, 30.0, 1000.0});
- game->heightmap = LoadModelFromMesh(heightmapMesh);
- game->heightmap.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture =
- game->assets.textures[HEIGHT_MAP_TEXTURE];
-
- game->heightmapColors = LoadImageColors(
- game->assets.images[HEIGHT_MAP_IMAGE]);
+ // World.
+ game->world = createWorld(&game->assets);
DisableCursor();
}
@@ -46,7 +39,7 @@ void updateGameScene(Game* game)
updatePlayer(&game->player, game);
- DrawModel(game->heightmap, Vector3Zero(), 1.0, WHITE);
+ updateWorld(&game->world, game);
EndMode3D();
}
@@ -75,7 +68,6 @@ void updateGame(Game* game)
void closeGame(Game* game)
{
closeAssets(&game->assets);
- UnloadModel(game->heightmap);
- UnloadImageColors(game->heightmapColors);
+ freeWorld(game->world);
CloseWindow();
}