From 9bd385281beb782e3ffcda5ee8ea0ec24c29c279 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 27 Oct 2023 11:14:54 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20Oups...=20N'aurais-je=20pas=20retir?= =?UTF-8?q?=C3=A9=20qq.=20vertex=20de=20trop=20=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index f7eabfc..44231ca 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -903,7 +903,8 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) 0,//rand() % space_Y, // y 0);//rand() % space_Z); // z - int address = 0; + int address = 3; + 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 + 0] = buffer_lines_origin[(long) buffer_lines_size - 2]; buffer_lines_origin [(long) buffer_lines_0_arrow + address * 2 + 1] = buffer_lines_origin[(long) buffer_lines_size - 1]; @@ -915,6 +916,22 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) else perror("In experience, can't re_allocate for arrow lines buffer.\n"); if (1) printf(">>> buffer_lines_size = %d\n", buffer_lines_size); + if (1) printf("buffer_vertex_0_arrow = %d address = %d buffer_vertex_size = %d >>>", buffer_vertex_0_arrow, address, buffer_vertex_size); + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 0] = buffer_vertex_origin[(long) buffer_vertex_size - 6]; + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 1] = buffer_vertex_origin[(long) buffer_vertex_size - 5]; + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 2] = buffer_vertex_origin[(long) buffer_vertex_size - 4]; + + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 3] = buffer_vertex_origin[(long) buffer_vertex_size - 3]; + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 4] = buffer_vertex_origin[(long) buffer_vertex_size - 2]; + buffer_vertex_origin [(long) buffer_vertex_0_arrow + address * 6 + 5] = buffer_vertex_origin[(long) buffer_vertex_size - 1]; + + buffer_vertex_size -= 6; + + void *new_arrows_vertex_ptr = g_realloc(buffer_vertex_origin, buffer_vertex_size * sizeof(GLfloat)); + if (new_arrows_vertex_ptr) buffer_vertex_origin = new_arrows_vertex_ptr; + else perror("In experience, can't re_allocate for arrow vertex buffer.\n"); + if (1) printf(">>> buffer_vertex_size = %d\n", buffer_vertex_size); + /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z, */