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);