fuite de memoire et print retirer
This commit is contained in:
@@ -354,13 +354,11 @@ int inGameLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
||||
size_menu, 50);
|
||||
if (isWin (tab2d, targets, nbr_targets))
|
||||
{
|
||||
puts ("Win!");
|
||||
return 1;
|
||||
finish = true;
|
||||
}
|
||||
if (islose (tab2d, dim_tab->x))
|
||||
{
|
||||
puts ("lose!");
|
||||
return 0;
|
||||
finish = true;
|
||||
}
|
||||
@@ -589,24 +587,19 @@ bool blockBox (char **tab2d, vect box_coor)
|
||||
while (!wall)
|
||||
{
|
||||
char val = tab2d[current.x][current.y];
|
||||
printf("val : %d ", val);
|
||||
vect cur_nor = plusVect (current, normal);
|
||||
char val_nor = tab2d[cur_nor.x][cur_nor.y];
|
||||
printf("val_nor : %d\n", val_nor);
|
||||
if (val == WALL)
|
||||
wall = true;
|
||||
else if (val == TARGET)
|
||||
return false;
|
||||
if (val_nor != WALL)
|
||||
{
|
||||
printf("coor (%d, %d), val_nor : %d\n", box_coor.x, box_coor.y, val_nor);
|
||||
return false;
|
||||
}
|
||||
current = plusVect(current, dir_test[i]);
|
||||
}
|
||||
}
|
||||
|
||||
printf("coor (%d, %d)\n", box_coor.x, box_coor.y);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -645,8 +638,6 @@ void nullScore(score *player_score)
|
||||
*/
|
||||
void winOrLoseLoop(dis *display_user, bool win)
|
||||
{
|
||||
puts("dedans");
|
||||
printf("%b \n", win);
|
||||
SDL_Surface *img;
|
||||
SDL_Texture *texture;
|
||||
|
||||
@@ -654,7 +645,6 @@ void winOrLoseLoop(dis *display_user, bool win)
|
||||
else img = IMG_Load("image/lose.png");
|
||||
|
||||
texture = SDL_CreateTextureFromSurface (display_user->renderer, img);
|
||||
printf("text : %p", texture);
|
||||
|
||||
vect pos = {0, 0};
|
||||
displayImage(display_user->renderer, texture, pos, display_user->size_window);
|
||||
@@ -669,7 +659,8 @@ void winOrLoseLoop(dis *display_user, bool win)
|
||||
if(event.type == SDL_KEYDOWN && event.key.keysym.scancode == SDL_SCANCODE_RETURN) finish = true;
|
||||
SDL_Delay(16);
|
||||
}
|
||||
puts("fini");
|
||||
|
||||
SDL_FreeSurface (img);
|
||||
SDL_DestroyTexture (texture);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user