From 18d32611091c8570c3f70d2ba6d0a7ad2609ad82 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 27 Oct 2023 09:28:54 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20pas=20encore=20ce=20que=20je=20veux=20ma?= =?UTF-8?q?is=20coh=C3=A9rent.=20WIP,=20donc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 0546687..de00fdd 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -888,8 +888,8 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) /* if (1) print_user_choices(arrows_ptr, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, 0); */ arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z, - 0,//rand() % arbitrary + 1, // load / weight - 0,//rand() % 6, // site, + 1,//rand() % arbitrary + 1, // load / weight + 2,//rand() % 6, // site, 0,//rand() % space_X, // x 0,//rand() % space_Y, // y 0);//rand() % space_Z); // z @@ -897,18 +897,32 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) /* print_user_choices(arrows_ptr, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, 0); */ arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z, - rand() % arbitrary + 1, // load / weight - 2,//rand() % 6, // site, + 1,//rand() % arbitrary + 1, // load / weight + 3,//rand() % 6, // site, 0,//rand() % space_X, // x 0,//rand() % space_Y, // y 0);//rand() % space_Z); // z - arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z, - 0,//rand() % arbitrary + 1, // load / weight - 1,//rand() % 6, // site, - 0,//rand() % space_X, // x - 0,//rand() % space_Y, // y - 0);//rand() % space_Z); // z + int address = 0; + if (1) printf("buffer_lines_0_arrow = %d address = %d buffer_lines_size = %d >>>", buffer_lines_0_arrow, address, buffer_lines_size); + buffer_lines_origin [(long) buffer_lines_0_arrow + address * 2 + 1] = buffer_lines_origin[(long) buffer_lines_size - 3]; + buffer_lines_origin [(long) buffer_lines_0_arrow + address * 2 + 2] = buffer_lines_origin[(long) buffer_lines_size - 2]; + + buffer_lines_size -= 2; + + void *new_arrows_lines_ptr = g_realloc(buffer_lines_origin, buffer_lines_size * sizeof(GLfloat)); + if (new_arrows_lines_ptr) buffer_lines_origin = new_arrows_lines_ptr; + else perror("In experience, can't re_allocate for arrow lines buffer.\n"); + if (1) printf(">>> buffer_lines_size = %d\n", buffer_lines_size); + + + + /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z, */ + /* 0,//rand() % arbitrary + 1, // load / weight */ + /* 0,//rand() % 6, // site, */ + /* 0,//rand() % space_X, // x */ + /* 0,//rand() % space_Y, // y */ + /* 0);//rand() % space_Z); // z */ /* print_user_choices(arrows_ptr, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, 0); */