From 9a1023b0b2f3032a337958520b2ee9b9083a2777 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 22 Oct 2023 20:00:34 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20offset=5Fvertex=20=C3=A9tait=20bien=20un?= =?UTF-8?q?=20doublon=20de=20buffer=5Fvertex=5Fsize=20:=20premi=C3=A8res?= =?UTF-8?q?=20images=20(ridges)=20OK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 14bbb65..3a2f3c6 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -134,7 +134,8 @@ void graphics_write_vertex (GLfloat x, GLfloat y, GLfloat z) buffer_vertex_origin[buffer_vertex_size + 1] = y; buffer_vertex_origin[buffer_vertex_size + 2] = z; - if (0) printf("buffer_vertex_size = %d (%6.3f,%6.3f,%6.3f)\n", buffer_vertex_size, x, y, z); + if (1) printf("In graphics_write_vertex() buffer_vertex_size = %d > %d (%6.3f,%6.3f,%6.3f)\n",\ + buffer_vertex_size, buffer_vertex_size + 3, x, y, z); buffer_vertex_size += 3; } @@ -680,8 +681,8 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); int arbitrary = 3; - int space_X = 1,// + rand() % arbitrary, - space_Y = 1,// + rand() % arbitrary, + int space_X = 3,// + rand() % arbitrary, + space_Y = 2,// + rand() % arbitrary, space_Z = 1;// + rand() % arbitrary; int density_max = space_X * space_Y * space_Z; int max = fmax(space_X, space_Y); max = fmax(max, space_Z); @@ -731,17 +732,16 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) /* S P A C E */ -// float max = fmax(x, y); max = fmax(max, z); buffer_vertex_size += write_space_ridges_vertex (buffer_vertex_size, space_X, space_Y, space_Z); buffer_colors_size = buffer_vertex_size; - if (0) printf("buffer_vertex_size after writing_space_ridges_vertex : %d (x 3 = %d)\n\n", buffer_vertex_size, buffer_vertex_size * 3); + if (1) printf("buffer_vertex_size after writing_space_ridges_vertex : %d (x 3 = %d)\n\n", buffer_vertex_size, buffer_vertex_size * 3); buffer_vertex_size += write_grids_on_space_faces_vertex (space_X, space_Y, space_Z); buffer_colors_size = buffer_vertex_size; - if (0) printf("buffer_vertex_size after writing_space_faces_vertex = %4d - 8 = %3d (x 3 = %4d)\n", buffer_vertex_size, buffer_vertex_size - 8, (buffer_vertex_size - 8) * 3); - if (0) printf("(space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4 = %3d (x 3 = %4d)\n\n",\ + if (1) printf("buffer_vertex_size after writing_space_faces_vertex = %4d - 8 = %3d (x 3 = %4d)\n", buffer_vertex_size, buffer_vertex_size - 8, (buffer_vertex_size - 8) * 3); + if (1) printf("(space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4 = %3d (x 3 = %4d)\n\n",\ (space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4, ((space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4) * 3); @@ -760,14 +760,14 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) buffer_colors_size = buffer_vertex_size; } - if (0) printf("buffer_vertex_size after writing_arrows_vertex : %d (x 3 = %d) (arrows_nb = %d)\n", buffer_vertex_size, buffer_vertex_size * 3, arrows_nb); + if (1) printf("buffer_vertex_size after writing_arrows_vertex : %d (x 3 = %d) (arrows_nb = %d)\n", buffer_vertex_size, buffer_vertex_size * 3, arrows_nb); /*---------------------------------------------------------------*/ /* L I N E S S E C O N D */ - buffer_vertex_size = 0; buffer_colors_size = 0; buffer_lines_size = 0; + // buffer_vertex_size = 0; buffer_colors_size = 0; buffer_lines_size = 0; /* S P A C E */