WIP: micro-commit : l'affichage est OK; prêt pour le debug du graphisme (erreur simple et reproductible)
This commit is contained in:
parent
be944a2305
commit
c98346545c
|
@ -71,11 +71,11 @@ int write_one_arrow_vertex (int space_X_int, int space_Y_int, int space_Z_int,
|
||||||
graphics_write_color(0.6f, 0.1f, 0.7f);
|
graphics_write_color(0.6f, 0.1f, 0.7f);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
graphics_write_vertex (vx, vy, vz + (site % 2 - 1) * (1 / max) - (site % 2 - 1) * arrow_tip_padding, print);
|
graphics_write_vertex (vx, vy, vz - (site % 2 - 1) * (1 / max) + (site % 2 - 1) * arrow_tip_padding, print);
|
||||||
graphics_write_color(0.05f, 0.4f, 1.0f);
|
graphics_write_color(0.05f, 0.4f, 1.0f);
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
graphics_write_vertex (vx, vy, vz + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding, print);
|
graphics_write_vertex (vx, vy, vz - (site % 2) * (1 / max) + (site % 2) * arrow_tip_padding, print);
|
||||||
graphics_write_color(1.0f, 1.0f, 0.0f);
|
graphics_write_color(1.0f, 1.0f, 0.0f);
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
|
|
|
@ -135,6 +135,7 @@ void print_arrows_array (struct arrow_t *arrows, int arrows_nb, int invoked_by)
|
||||||
case 4: printf("address == -1 && requested_weight == 0)"); break;
|
case 4: printf("address == -1 && requested_weight == 0)"); break;
|
||||||
case 5: printf("print_user_choices)"); break;
|
case 5: printf("print_user_choices)"); break;
|
||||||
case 6: printf("print_evolution)"); break;
|
case 6: printf("print_evolution)"); break;
|
||||||
|
case 7: printf("before deletion)"); break;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < arrows_nb; i++)
|
for (int i = 0; i < arrows_nb; i++)
|
||||||
printf("\n [%4d] = %2d | %2d, %2d, %2d, %2d", i, arrows[i].load,\
|
printf("\n [%4d] = %2d | %2d, %2d, %2d, %2d", i, arrows[i].load,\
|
||||||
|
@ -154,7 +155,7 @@ void print_user_choices(struct arrow_t *arrows, int max_arrows_nb, int arrows_nb
|
||||||
int space_size_x, int space_size_y, int space_size_z,
|
int space_size_x, int space_size_y, int space_size_z,
|
||||||
int show_array, int show_space_design)
|
int show_array, int show_space_design)
|
||||||
{
|
{
|
||||||
printf("model + user constraints :\tspace size x,y,z (%d,%d,%d)\t\tarrows nb : %d > %d\t",\
|
printf("model + user constraints :\tspace size x,y,z (%d,%d,%d)\tinitial (max) arrows nb : %d >> %d\t",\
|
||||||
space_size_x, space_size_y, space_size_z, max_arrows_nb, arrows_nb);
|
space_size_x, space_size_y, space_size_z, max_arrows_nb, arrows_nb);
|
||||||
|
|
||||||
if (show_space_design) printf(" (grilles alternées)");
|
if (show_space_design) printf(" (grilles alternées)");
|
||||||
|
|
|
@ -679,7 +679,7 @@ static inline int erase_arrow (int arrows_nb, int arrow_address_in_list,
|
||||||
if (arrows_nb == 0) assert (buffer_lines_size == buffer_lines_0_arrow); // ?
|
if (arrows_nb == 0) assert (buffer_lines_size == buffer_lines_0_arrow); // ?
|
||||||
if (arrows_nb == 0) {buffer_lines_size = buffer_lines_0_arrow; return 0;}
|
if (arrows_nb == 0) {buffer_lines_size = buffer_lines_0_arrow; return 0;}
|
||||||
|
|
||||||
if (1) print_arrows_array (arrows_ptr, arrows_nb, 0);
|
if (1) print_arrows_array (arrows_ptr, arrows_nb, 7);
|
||||||
|
|
||||||
assert (arrows_nb);
|
assert (arrows_nb);
|
||||||
arrows_nb --;
|
arrows_nb --;
|
||||||
|
@ -724,7 +724,7 @@ static inline int erase_arrow (int arrows_nb, int arrow_address_in_list,
|
||||||
buffer_colors_origin [buffer_colors_0_arrow + i] = buffer_colors_origin [buffer_colors_size - 6 + i];
|
buffer_colors_origin [buffer_colors_0_arrow + i] = buffer_colors_origin [buffer_colors_size - 6 + i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (console) print_arrows_array (arrows_ptr, arrows_nb, 0);
|
if (1) print_arrows_array (arrows_ptr, arrows_nb, 0);
|
||||||
|
|
||||||
return arrows_nb;
|
return arrows_nb;
|
||||||
}
|
}
|
||||||
|
@ -797,9 +797,11 @@ void main_test_graphics (void)
|
||||||
rand() % space_Z, // z
|
rand() % space_Z, // z
|
||||||
console);
|
console);
|
||||||
else for (int i = 0; i < 6; i++)
|
else for (int i = 0; i < 6; i++)
|
||||||
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 1, i, 0, 0, 0, 1);
|
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 1, i, 0, 0, 0, 0);
|
||||||
int max_arrows_nb = arrows_nb;
|
int max_arrows_nb = arrows_nb;
|
||||||
|
|
||||||
|
if (randomize); print_user_choices(arrows_ptr, max_arrows_nb, arrows_nb, space_X, space_Y, space_Z, 0, 0);
|
||||||
|
|
||||||
if (randomize) for (int i = 0; i < specified_arrows_nb * 6; i++)
|
if (randomize) for (int i = 0; i < specified_arrows_nb * 6; i++)
|
||||||
arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z,
|
arrows_nb = set_arrow (arrows_ptr, arrows_nb, space_X, space_Y, space_Z,
|
||||||
0, // load
|
0, // load
|
||||||
|
@ -808,10 +810,10 @@ void main_test_graphics (void)
|
||||||
rand() % space_Y, // y
|
rand() % space_Y, // y
|
||||||
rand() % space_Z, // z
|
rand() % space_Z, // z
|
||||||
console);
|
console);
|
||||||
else for (int i = 0; i < 6; i++)
|
else for (int i = 0; i < 1; i++)
|
||||||
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, i, 0, 0, 0, 1);
|
arrows_nb = set_arrow (arrows_ptr, arrows_nb, 1, 1, 1, 0, i, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (randomize || 1) print_user_choices(arrows_ptr, max_arrows_nb, arrows_nb, space_X, space_Y, space_Z, 1, 0);
|
if (randomize) print_user_choices(arrows_ptr, max_arrows_nb, arrows_nb, space_X, space_Y, space_Z, 1, 0);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue