world border

This commit is contained in:
Masashi 2025-12-19 11:20:00 +05:30
commit 2d98574830
4 changed files with 76 additions and 21 deletions

View file

@ -179,6 +179,8 @@ float get_terrain_height(float x, float z) {
#define TERRAIN_SIZE 256
#define TERRAIN_SCALE 1.0f
#define TERRAIN_MIN (-TERRAIN_SIZE * TERRAIN_SCALE / 2.0f)
#define TERRAIN_MAX (TERRAIN_SIZE * TERRAIN_SCALE / 2.0f)
static Mesh generate_terrain_mesh(void) {
int size = TERRAIN_SIZE;
@ -1005,6 +1007,10 @@ int main(void) {
(Color){80, 140, 70, 255};
DrawModel(terrainModel, (Vector3){0, 0, 0}, 1.0f, WHITE);
// Draw border
float borderSize = TERRAIN_MAX - TERRAIN_MIN;
DrawCube((Vector3){0, 0, 0}, borderSize, 1000, borderSize, (Color){255, 0, 0, 100});
// Items with basic lighting (no shader for now to keep it simple)
for (int i = 0; i < MAX_ITEMS; i++) {
if (!wi[i].present)