From 776aac08553cea7726ba06390b1d3d77bd483faa Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 6 Nov 2023 16:41:15 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20Effacement=20des=20fl=C3=A8ches=20dans?= =?UTF-8?q?=20l'angle-origine=20OK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 746f294..be07b1f 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -825,14 +825,16 @@ void main_test_graphics (void) /* else for (int i = 0; i < 6; i++) */ /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, i, 0, 0, 0, 0); */ - int angle = 9; - if (space_X > angle && space_Y > angle && space_Z > angle) for (int i = 0; i < angle; i++) - for (int u = 0; u < angle; u++) for (int v = 0; v < angle; v++) for (int w = 0; w < angle; w++) - if (u + v + w < angle * 3) - arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, i, u, v, w, 0); + int mxy = MIN(space_X, space_Y); int mxyz = MIN(mxy, space_Z); + int min_x = MIN(mxyz, space_X), min_y = MIN(mxyz, space_Y), min_z = MIN(mxyz, space_Z); + for (int i = 0; i < 6; i++) + for (int u = 0; u < min_x; u++) + for (int v = 0; v < min_y; v++) + for (int w = 0; w < min_z; w++) + if (u + v + w < mxyz) + arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, i, u, v, w, 0); - if (space_X > angle && space_Y > angle && space_Z > angle) - printf("+ effacement des flèches dans l'angle-origine\ + printf("\n+ effacement des flèches dans l'angle-origine\ <=> contrôle graphique de la fonction erase_arrow()\n"); if (1) print_user_choices(arrows_ptr, max_arrows_nb, arrows_nb, space_X, space_Y, space_Z, 0, 0);