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, */