From 5f3920fdba537eade51fa44c085a452b13eb9e42 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Wed, 26 Feb 2025 11:28:59 +0300 Subject: [PATCH] /apps/demos/scenery: use quads --- apps/demos/scenery/scenes/ingame.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/apps/demos/scenery/scenes/ingame.c b/apps/demos/scenery/scenes/ingame.c index de6dcfa..827a67e 100644 --- a/apps/demos/scenery/scenes/ingame.c +++ b/apps/demos/scenery/scenes/ingame.c @@ -153,26 +153,12 @@ static void draw_terrain(SceneIngame *scn) { float d2 = heightmap[lx + 1][ly - 1]; float d3 = heightmap[lx][ly - 1]; - draw_triangle("/assets/grass.png", + draw_quad("/assets/grass.png", (Vec3){ (float)x, d0, (float)y }, - (Vec3){ (float)x + 1, d1, (float)y }, - (Vec3){ (float)x, d3, (float)y - 1 }, - (Vec2){ 128, 128 }, - (Vec2){ 128, 0 }, - (Vec2){ 0, 128 }, - (Color){255, 255, 255, 255}, - (Color){255, 255, 255, 255}, - (Color){255, 255, 255, 255}); - - draw_triangle("/assets/grass.png", (Vec3){ (float)x + 1, d1, (float)y }, (Vec3){ (float)x + 1, d2, (float)y - 1 }, (Vec3){ (float)x, d3, (float)y - 1 }, - (Vec2){ 128, 0 }, - (Vec2){ 0, 0 }, - (Vec2){ 0, 128 }, - (Color){255, 255, 255, 255}, - (Color){255, 255, 255, 255}, + (Rect){ .w = 128, .h = 128 }, (Color){255, 255, 255, 255}); draw_billboard("/assets/grasses/10.png",