cast ints to floats in terrain gen

This commit is contained in:
veclav talica 2024-08-20 17:27:54 +03:00
parent e21ce4113b
commit 2126f3cddb

View File

@ -96,17 +96,17 @@ static void ingame_tick(struct state *state) {
float d3 = stb_perlin_noise3((float)x * TERRAIN_FREQUENCY, (float)(y - 1) * TERRAIN_FREQUENCY, 0, 0, 0, 0) * 10 - 6; float d3 = stb_perlin_noise3((float)x * TERRAIN_FREQUENCY, (float)(y - 1) * TERRAIN_FREQUENCY, 0, 0, 0, 0) * 10 - 6;
unfurl_triangle("/assets/grass.gif", unfurl_triangle("/assets/grass.gif",
(t_fvec3){ x, d0, y }, (t_fvec3){ (float)x, d0, (float)y },
(t_fvec3){ x + 1, d1, y }, (t_fvec3){ (float)x + 1, d1, (float)y },
(t_fvec3){ x, d3, y - 1 }, (t_fvec3){ (float)x, d3, (float)y - 1 },
(t_shvec2){ 0, 768 }, (t_shvec2){ 0, 768 },
(t_shvec2){ 1024, 768 }, (t_shvec2){ 1024, 768 },
(t_shvec2){ 1024, 0 }); (t_shvec2){ 1024, 0 });
unfurl_triangle("/assets/grass.gif", unfurl_triangle("/assets/grass.gif",
(t_fvec3){ x + 1, d1, y }, (t_fvec3){ (float)x + 1, d1, (float)y },
(t_fvec3){ x + 1, d2, y - 1 }, (t_fvec3){ (float)x + 1, d2, (float)y - 1 },
(t_fvec3){ x, d3, y - 1 }, (t_fvec3){ (float)x, d3, (float)y - 1 },
(t_shvec2){ 1024, 0 }, (t_shvec2){ 1024, 0 },
(t_shvec2){ 0, 0 }, (t_shvec2){ 0, 0 },
(t_shvec2){ 0, 768 }); (t_shvec2){ 0, 768 });