From d3209409fbc68b048a0f4f068fadaab15b38a72f Mon Sep 17 00:00:00 2001 From: cyjullien1 Date: Tue, 7 Jan 2025 19:48:06 +0100 Subject: [PATCH] free les music --- script/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/main.c b/script/main.c index b399c06..7367d16 100644 --- a/script/main.c +++ b/script/main.c @@ -71,7 +71,7 @@ void playAudio(int sfx) int main () { seed = (unsigned int)time(NULL); - + dis display_user; display_user.size_menu = SIZE_MENU; display_user.size_box = SIZE_PLAY; @@ -116,6 +116,7 @@ int main () Mix_Volume(-1,MIX_MAX_VOLUME); // Définit le volume maximal pour tous les canaux Mix_VolumeMusic(MIX_MAX_VOLUME / 2); // Loop pour le jeu entier menu et les jeux. + Mix_PlayMusic(music_menu, -1); while(output != 0) { @@ -197,7 +198,10 @@ int main () if (tab2d != NULL)free2D (tab2d, SIZE_PLAY); if (playerPos != NULL)free (playerPos); if (targets != NULL)free (targets); - + Mix_FreeMusic(music_editor); + Mix_FreeMusic(music_game); + Mix_FreeMusic(music_menu); + Mix_CloseAudio(); SDL_Quit ();