WIP: erreur de dessin systématique dans erase_arrow() (suite)
This commit is contained in:
parent
4ed884f87d
commit
74fea2b3be
|
@ -41,15 +41,15 @@ GLfloat *buffer_colors_origin = NULL;
|
|||
GLuint *buffer_lines_origin = NULL;
|
||||
GLuint *buffer_plans_origin = NULL;
|
||||
|
||||
volatile int buffer_vertex_size = 0;
|
||||
volatile int buffer_lines_size = 0;
|
||||
volatile int buffer_colors_size = 0;
|
||||
volatile int buffer_plans_size = 0;
|
||||
volatile long buffer_vertex_size = 0;
|
||||
volatile long buffer_lines_size = 0;
|
||||
volatile long buffer_colors_size = 0;
|
||||
volatile long buffer_plans_size = 0;
|
||||
|
||||
volatile int buffer_vertex_0_arrow = 0;
|
||||
volatile int buffer_lines_0_arrow = 0;
|
||||
volatile int buffer_colors_0_arrow = 0;
|
||||
volatile int buffer_plans_0_arrow = 0;
|
||||
volatile long buffer_vertex_0_arrow = 0;
|
||||
volatile long buffer_lines_0_arrow = 0;
|
||||
volatile long buffer_colors_0_arrow = 0;
|
||||
volatile long buffer_plans_0_arrow = 0;
|
||||
|
||||
#define TEST 0
|
||||
|
||||
|
@ -673,8 +673,8 @@ static inline int erase_arrow (int arrows_nb, int address,
|
|||
int site, int x, int y, int z,
|
||||
int console)
|
||||
{
|
||||
arrows_nb --;
|
||||
assert (arrows_nb);
|
||||
arrows_nb --;
|
||||
|
||||
int mem = arrows_ptr[address].site;
|
||||
|
||||
|
@ -689,15 +689,13 @@ static inline int erase_arrow (int arrows_nb, int address,
|
|||
: arrows_ptr[%d].site = %d >> %d (%d is last arrow.site)\n",\
|
||||
arrows_nb + 1, arrows_nb, address, address, site, mem, arrows_ptr[address].site, arrows_ptr[arrows_nb].site);
|
||||
|
||||
// Attention : lors de la création des vertex des flèches, tous les vertex centraux sont redondants (au maximum 6)
|
||||
for (long i = 0 + address * 6; i < 6 + address * 6; i++)
|
||||
buffer_vertex_origin [buffer_vertex_0_arrow + i]
|
||||
= buffer_vertex_origin [buffer_vertex_size - 6 + i];
|
||||
|
||||
for (int i = 0 + address * 6; i < 6 + address * 6; i++)
|
||||
buffer_vertex_origin [(long) buffer_vertex_0_arrow + i]
|
||||
= buffer_vertex_origin [(long) buffer_vertex_size - 6 + i];
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
buffer_colors_origin [(long) buffer_colors_0_arrow + (address + 4) * 6 + i]
|
||||
= buffer_colors_origin [(long) buffer_colors_size - 6 + i];
|
||||
for (long i = 0; i < 6; i++)
|
||||
buffer_colors_origin [buffer_colors_0_arrow + (address + 4) * 6 + i]
|
||||
= buffer_colors_origin [buffer_colors_size - 6 + i];
|
||||
|
||||
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;
|
||||
|
@ -708,9 +706,9 @@ static inline int erase_arrow (int arrows_nb, int address,
|
|||
else perror("In graphics.erase_arrow(), can't re_allocate for arrows colors buffer.\n");
|
||||
|
||||
|
||||
/* buffer_vertex_size -= 6; <<< ceci est fait dans : graphics_write_vertex() */
|
||||
/* buffer_colors_size -= 6; <<< ceci est fait dans : graphics_write_colors() */
|
||||
/* buffer_lines_size -= 2; <<< ceci est fait dans : graphics_write_line() */
|
||||
/* buffer_vertex_size -= 6; // <<< ceci est fait dans : graphics_write_vertex() */
|
||||
/* buffer_colors_size -= 6; // <<< ceci est fait dans : graphics_write_colors() */
|
||||
/* buffer_lines_size -= 2; // <<< ceci est fait dans : graphics_write_line() */
|
||||
|
||||
/* Il ne faut pas réécrire ce qui suit: ces lignes dessinent maintenant à partir d'autres vertex */
|
||||
/* void *new_arrows_lines_ptr = g_realloc(buffer_lines_origin, buffer_lines_size * sizeof(GLfloat)); */
|
||||
|
|
Loading…
Reference in New Issue