diff --git a/script/function.c b/script/function.c index 58c1657..45cbd36 100644 --- a/script/function.c +++ b/script/function.c @@ -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; } diff --git a/script/main.c b/script/main.c index 1f18ac0..dc8179d 100644 --- a/script/main.c +++ b/script/main.c @@ -39,7 +39,6 @@ int main () vect null = {0, 0}; - printf("output : %d\n", output); output = inGameLoop (menu, &dim_menu, &pos, &null , 1, &display_user, &score_user, true); nullScore(&score_user); diff --git a/script/read.c b/script/read.c index 328f2cb..6589e99 100644 --- a/script/read.c +++ b/script/read.c @@ -80,7 +80,6 @@ int countCustomMaps(char *name_directory) { nbr++; sprintf(name_map, "%s/custom_%d.txt",name_directory ,nbr); - printf("%p, %d, %s\n", file, nbr, name_map); file = fopen(name_map, "r"); }