From e509dfb6b2c187792bfb6db06296862df03e1fa9 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 11 Oct 2023 21:34:56 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20=C3=89tonnez-vous,=20d=C3=A9j=C3=A0,=20d?= =?UTF-8?q?u=20nombre=20de=20fois=20o=C3=B9=20=C3=A7a=20marche...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 8 ++++---- src/graphics/grid.c | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index e0ddb96..bf4c04e 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -872,10 +872,10 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) int rand(void); void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); - int arbitrary = 4; - int space_X = 3, // 1 + rand() % arbitrary, - space_Y = 3, // 1 + rand() % arbitrary, - space_Z = 3; // 1 + rand() % arbitrary; + int arbitrary = 40; + int space_X = 1 + rand() % arbitrary, + space_Y = 1 + rand() % arbitrary, + space_Z = 1 + rand() % arbitrary; int density_max = space_X * space_Y * space_Z; int arrows_nb = 0;//rand() % density_max; int pref_show_grids = 1; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc diff --git a/src/graphics/grid.c b/src/graphics/grid.c index db7f47d..3f0c498 100644 --- a/src/graphics/grid.c +++ b/src/graphics/grid.c @@ -91,23 +91,33 @@ void write_marks_along_space_ridges (long x, long y, long z) /* graphics_write_line (vertex_offset + 6, vertex_offset + 22); */ /* graphics_write_line (vertex_offset + 7, vertex_offset + 23); */ + + // for (int i = 0; i <= y; i += 2) graphics_write_line (vertex_offset + 2 + i, vertex_offset + 2 + i + 1); + /* graphics_write_line (vertex_offset + 2, vertex_offset + 3); */ + /* graphics_write_line (vertex_offset + 4, vertex_offset + 5); */ + + int ar = 4; + for (int i = 0; i < y * x; i += 2) graphics_write_line (vertex_offset + ar + i, vertex_offset + ar + i + 1); + /* graphics_write_line (vertex_offset + 8, vertex_offset + 9); */ + /* graphics_write_line (vertex_offset + 10, vertex_offset + 11); */ + /* graphics_write_line (vertex_offset + 12, vertex_offset + 13); */ + /* graphics_write_line (vertex_offset + 14, vertex_offset + 15); */ + + /* graphics_write_line (vertex_offset + 18, vertex_offset + 19); */ + /* graphics_write_line (vertex_offset + 20, vertex_offset + 21); */ + + /* graphics_write_line (vertex_offset + 0, vertex_offset + 6); */ /* graphics_write_line (vertex_offset + 1, vertex_offset + 7); */ + /* graphics_write_line (vertex_offset + 8, vertex_offset + 10); */ /* graphics_write_line (vertex_offset + 9, vertex_offset + 11); */ + /* graphics_write_line (vertex_offset + 12, vertex_offset + 14); */ /* graphics_write_line (vertex_offset + 13, vertex_offset + 15); */ + /* graphics_write_line (vertex_offset + 16, vertex_offset + 22); */ /* graphics_write_line (vertex_offset + 17, vertex_offset + 23); */ - - graphics_write_line (vertex_offset + 2, vertex_offset + 3); - graphics_write_line (vertex_offset + 4, vertex_offset + 5); - graphics_write_line (vertex_offset + 8, vertex_offset + 9); - graphics_write_line (vertex_offset + 10, vertex_offset + 11); - graphics_write_line (vertex_offset + 12, vertex_offset + 13); - graphics_write_line (vertex_offset + 14, vertex_offset + 15); - graphics_write_line (vertex_offset + 18, vertex_offset + 19); - graphics_write_line (vertex_offset + 20, vertex_offset + 21); }