/* Close the mixer, halting all playing audio */ void Mix_CloseAudio(void) { int i; if ( audio_opened ) { if ( audio_opened == 1 ) { for (i = 0; i < num_channels; i++) { Mix_UnregisterAllEffects(i); } Mix_UnregisterAllEffects(MIX_CHANNEL_POST); close_music(); Mix_HaltChannel(-1); _Mix_DeinitEffects(); SDL_CloseAudio(); SDL_free(mix_channel); mix_channel = NULL; /* rcg06042009 report available decoders at runtime. */ SDL_free(chunk_decoders); chunk_decoders = NULL; num_decoders = 0; } --audio_opened; } }
/* Close the mixer, halting all playing audio */ void Mix_CloseAudio(void) { int i; if ( audio_opened ) { if ( audio_opened == 1 ) { for (i = 0; i < num_channels; i++) { Mix_UnregisterAllEffects(i); } Mix_UnregisterAllEffects(MIX_CHANNEL_POST); close_music(); Mix_HaltChannel(-1); SDL_CloseAudio(); free(mix_channel); mix_channel = NULL; } --audio_opened; } }
int main(int ac, char **av) { t_visu *visu; if (ac == 2 && my_strcmp(av[1], "--help") == 0) return (show_help()); if ((visu = bunny_malloc(sizeof(t_visu))) == NULL) return (-1); visu->start_rendu = 0; if (!(visu->win = bunny_start(WIDTH, HEIGHT, false, "LEMIN DISPLAYER")) || (!(visu->pix = bunny_new_pixelarray(WIDTH, HEIGHT))) || (check_args(visu) == -1) || (load_ant(visu, av[1]) == -1) || (load_screen(visu, av[1]) == -1) || (start_music(visu, av[1]) == -1) || (init_ant_struct(visu) == -1)) return (-1); visu->rooms = reverse_rooms(visu->rooms); bunny_set_key_response(events); bunny_set_loop_main_function(main_loop); bunny_loop(visu->win, 60, visu); close_music(visu); delete_all_clipables(visu); free_all(visu); return (0); }