WIP Bon. Il reste juste cette inversion Nord/Sud dans le dessin, semble-t-il.

This commit is contained in:
Jean Sirmai 2023-11-03 15:58:42 +01:00
parent 988b2a41f2
commit bbfd2fdd6c
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 11 additions and 10 deletions

View File

@ -90,5 +90,3 @@ int write_one_arrow_line(int offset_vertex, int print)
graphics_write_line (offset_vertex + 0, offset_vertex + 1, print); graphics_write_line (offset_vertex + 0, offset_vertex + 1, print);
return 2; return 2;
} }

View File

@ -596,6 +596,7 @@ bool graphics_shutdown(const void *gl_area)
static int rewrite_arrow (int arrows_nb, int address, int load, int site, int x, int y, int z, int console) static int rewrite_arrow (int arrows_nb, int address, int load, int site, int x, int y, int z, int console)
{ {
printf("WARNING in rewrite_arrow() <> address or address / 5 ? (et pourquoi ?)\n");
arrows_ptr[address].load = load; arrows_ptr[address].load = load;
if (console) print_arrows_array (arrows_ptr, arrows_nb, 2); if (console) print_arrows_array (arrows_ptr, arrows_nb, 2);
@ -665,11 +666,13 @@ static inline int erase_arrow (int arrows_nb, int arrow_address_in_list,
arrows_nb + 1, arrows_nb, arrow_address_in_list, arrow_address_in_list, mem, arrows_nb, arrows_ptr[arrows_nb].site); arrows_nb + 1, arrows_nb, arrow_address_in_list, arrow_address_in_list, mem, arrows_nb, arrows_ptr[arrows_nb].site);
} }
for (long i = 0 + arrow_address_in_list * 6; i < 6 + arrow_address_in_list * 6; i++) for (long i = 0; i < 6; i++)
buffer_vertex_origin [buffer_vertex_0_arrow + i] = buffer_vertex_origin [buffer_vertex_size - 6 + i]; buffer_vertex_origin [buffer_vertex_0_arrow + arrow_address_in_list * 6 + i]
= buffer_vertex_origin [buffer_vertex_size - 6 + i];
for (long i = 0 + arrow_address_in_list * 6; i < 6 + arrow_address_in_list * 6; i++) for (long i = 0; i < 6; i++)
buffer_colors_origin [buffer_colors_0_arrow + i] = buffer_colors_origin [buffer_colors_size - 6 + i]; buffer_colors_origin [buffer_colors_0_arrow + arrow_address_in_list * 6 + i]
= buffer_colors_origin [buffer_colors_size - 6 + i];
buffer_vertex_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_write_vertex() buffer_vertex_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_write_vertex()
buffer_colors_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_write_colors() buffer_colors_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_write_colors()
@ -725,7 +728,7 @@ static inline int set_arrow (struct arrow_t *arrows_ptr, int arrows_nb, int spac
if (address >= 0 && requested_weight == 0) // address >= 0 if and only if arrows_nb > 0 if (address >= 0 && requested_weight == 0) // address >= 0 if and only if arrows_nb > 0
return erase_arrow (arrows_nb, address, site, arrow_x, arrow_y, arrow_z, console); return erase_arrow (arrows_nb, address, site, arrow_x, arrow_y, arrow_z, console);
if (address >= 0 && current_weight != requested_weight) if (address >= 0 && current_weight != requested_weight)
return rewrite_arrow (arrows_nb, address/5, requested_weight, site, arrow_x, arrow_y, arrow_z, console); return rewrite_arrow (arrows_nb, address, requested_weight, site, arrow_x, arrow_y, arrow_z, console);
if (address >= 0 && current_weight == requested_weight && console) print_arrows_array(arrows_ptr, arrows_nb, 3); if (address >= 0 && current_weight == requested_weight && console) print_arrows_array(arrows_ptr, arrows_nb, 3);
if (address == -1 && requested_weight == 0 && console) print_arrows_array(arrows_ptr, arrows_nb, 4); if (address == -1 && requested_weight == 0 && console) print_arrows_array(arrows_ptr, arrows_nb, 4);
@ -784,11 +787,11 @@ void main_test_graphics (void)
rand() % space_Z, // z rand() % space_Z, // z
console); console);
/* else for (int i = 0; i < 1; i++) ; */ /* else for (int i = 0; i < 1; i++) ; */
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 0, 0, 0, 0, 1); /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 0, 0, 0, 0, 1); */
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 1, 0, 0, 0, 1); /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 1, 0, 0, 0, 1); */
/* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 2, 0, 0, 0, 1); */ /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 2, 0, 0, 0, 1); */
/* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 3, 0, 0, 0, 1); */ /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 3, 0, 0, 0, 1); */
/* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 4, 0, 0, 0, 1); */ arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 4, 0, 0, 0, 1);
/* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 5, 0, 0, 0, 1); */ /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 5, 0, 0, 0, 1); */
/* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 6, 0, 0, 0, 1); */ /* arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, 6, 0, 0, 0, 1); */