diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 8d6fc96..1aad131 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -182,7 +182,7 @@ void graphics_write_line (GLuint a, GLuint b, int print) buffer_lines_origin[buffer_lines_size + 0] = a; buffer_lines_origin[buffer_lines_size + 1] = b; - if (print) printf("In graphics_write_line() buffer_lines_size => [%2d] [%2d > %2d] (%3u > %3u ) (= buffer_vertex_size / 3 - 2 > -1)\n",\ + if (print) printf("In graphics_write_line() buffer_lines_size => [%2d] [%2d > %2d] (%3u > %3u )\n\n",\ buffer_lines_size / 2, buffer_lines_size + 0, buffer_lines_size + 1, a, b); buffer_lines_size += 2; @@ -562,7 +562,7 @@ static int rewrite_arrow (int arrows_nb, int address, int load, int site, int x, { arrows_ptr[address].load = load; - print_arrows_array (arrows_ptr, arrows_nb, 2); + if (0) print_arrows_array (arrows_ptr, arrows_nb, 2); return arrows_nb; } @@ -597,7 +597,7 @@ static inline int create_arrow (int arrows_nb, arrows_nb ++; - if (1) print_arrows_array (arrows_ptr, arrows_nb, 1); + if (0) print_arrows_array (arrows_ptr, arrows_nb, 1); return arrows_nb; } @@ -646,7 +646,7 @@ static inline int erase_arrow (int arrows_nb, int address, int site, int x, int } printf(" >> bf_vrtx = %d bf_ln = %d\n", (buffer_vertex_size - 6) / 3, (buffer_lines_size - 4) / 2); - print_arrows_array (arrows_ptr, arrows_nb,0); + if (0) print_arrows_array (arrows_ptr, arrows_nb, 0); return arrows_nb; } @@ -903,19 +903,20 @@ 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]; */ + 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]; - /* 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); + 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]; @@ -1017,4 +1018,3 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) arrows_ptr = NULL; arrows_nb = 0; } -