From 2126f3cddb7b273e2a91b1e643db750d37c006a9 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 20 Aug 2024 17:27:54 +0300 Subject: [PATCH] cast ints to floats in terrain gen --- apps/testgame/scenes/ingame.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/testgame/scenes/ingame.c b/apps/testgame/scenes/ingame.c index 45761e7..f03b615 100644 --- a/apps/testgame/scenes/ingame.c +++ b/apps/testgame/scenes/ingame.c @@ -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; unfurl_triangle("/assets/grass.gif", - (t_fvec3){ x, d0, y }, - (t_fvec3){ x + 1, d1, y }, - (t_fvec3){ x, d3, y - 1 }, + (t_fvec3){ (float)x, d0, (float)y }, + (t_fvec3){ (float)x + 1, d1, (float)y }, + (t_fvec3){ (float)x, d3, (float)y - 1 }, (t_shvec2){ 0, 768 }, (t_shvec2){ 1024, 768 }, (t_shvec2){ 1024, 0 }); unfurl_triangle("/assets/grass.gif", - (t_fvec3){ x + 1, d1, y }, - (t_fvec3){ x + 1, d2, y - 1 }, - (t_fvec3){ x, d3, y - 1 }, + (t_fvec3){ (float)x + 1, d1, (float)y }, + (t_fvec3){ (float)x + 1, d2, (float)y - 1 }, + (t_fvec3){ (float)x, d3, (float)y - 1 }, (t_shvec2){ 1024, 0 }, (t_shvec2){ 0, 0 }, (t_shvec2){ 0, 768 });