Pas d'erreur décelée mais tests partiels
This commit is contained in:
parent
386b3ebd42
commit
ad9829aa40
|
@ -617,8 +617,6 @@ static int erase_arrow (GLuint *arrows, int arrows_nb, int address, int site, in
|
|||
|
||||
static int set_arrow (GLuint *arrows, int arrows_nb, int requested_weight, int site, int x, int y, int z)
|
||||
{
|
||||
// assert : no more than one arrow per address pas de doublons de flèches
|
||||
// assert : arrows localization within space and sites
|
||||
int address = -1, current_weight = -1;
|
||||
|
||||
for (int i = 0; i < arrows_nb; i++) {
|
||||
|
@ -641,7 +639,7 @@ static int set_arrow (GLuint *arrows, int arrows_nb, int requested_weight, int s
|
|||
|
||||
if (address >= 0 && requested_weight == 0) {printf("arrow (%d,%d,%d,%d) found at address %d; current_weight = %d;\n\
|
||||
requested weight == %d => ERASE",\
|
||||
arrows[address + 1],arrows[address + 2],arrows[address + 3],arrows[address + 4], address/5, current_weight, requested_weight);
|
||||
arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5, current_weight, requested_weight);
|
||||
return erase_arrow (arrows, arrows_nb, address, site, x, y, z);}
|
||||
|
||||
if (address >= 0 && current_weight != requested_weight) {printf("arrow (%d,%d,%d,%d) found at address %d; current_weight = %d;\n\
|
||||
|
@ -651,7 +649,7 @@ static int set_arrow (GLuint *arrows, int arrows_nb, int requested_weight, int s
|
|||
|
||||
if (address >= 0 && current_weight == requested_weight) {
|
||||
printf("arrow (%d,%d,%d,%d) found at address %d; current_weight == requested_weight => END",\
|
||||
arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address); return arrows_nb;}
|
||||
arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5); return arrows_nb;}
|
||||
|
||||
if (address == -1 && requested_weight == 0) {printf("no such arrow found && requested weight == 0 => END"); return arrows_nb;}
|
||||
|
||||
|
|
Loading…
Reference in New Issue