hedgewars/uSound.pas
branchhedgeroid
changeset 6224 42b256eca362
parent 5932 5164d17b6374
parent 6072 e3dc802965d6
child 6415 af2047bb4f70
equal deleted inserted replaced
6055:88cfcd9161d3 6224:42b256eca362
   155 {$ENDIF}
   155 {$ENDIF}
   156 
   156 
   157     if isSoundEnabled then
   157     if isSoundEnabled then
   158         isSoundEnabled:= Mix_OpenAudio(44100, $8010, channels, 1024) = 0;
   158         isSoundEnabled:= Mix_OpenAudio(44100, $8010, channels, 1024) = 0;
   159 
   159 
   160 {$IFDEF SDL_MIXER_NEWER}
       
   161     WriteToConsole('Init SDL_mixer... ');
   160     WriteToConsole('Init SDL_mixer... ');
   162     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
   161     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
   163     WriteLnToConsole(msgOK);
   162     WriteLnToConsole(msgOK);
   164 {$ENDIF}
       
   165 
   163 
   166     if isSoundEnabled then
   164     if isSoundEnabled then
   167         WriteLnToConsole(msgOK)
   165         WriteLnToConsole(msgOK)
   168     else
   166     else
   169         WriteLnToConsole(msgFailed);
   167         WriteLnToConsole(msgFailed);
   189                     Mix_FreeChunk(voicepacks[t].chunks[i]);
   187                     Mix_FreeChunk(voicepacks[t].chunks[i]);
   190 
   188 
   191     if Mus <> nil then
   189     if Mus <> nil then
   192         Mix_FreeMusic(Mus);
   190         Mix_FreeMusic(Mus);
   193 
   191 
   194 {$IFDEF SDL_MIXER_NEWER}
       
   195     // make sure all instances of sdl_mixer are unloaded before continuing
   192     // make sure all instances of sdl_mixer are unloaded before continuing
   196     while Mix_Init(0) <> 0 do
   193     while Mix_Init(0) <> 0 do
   197         Mix_Quit();
   194         Mix_Quit();
   198 {$ENDIF}
       
   199 
   195 
   200     Mix_CloseAudio();
   196     Mix_CloseAudio();
   201 end;
   197 end;
   202 
   198 
   203 procedure SoundLoad;
   199 procedure SoundLoad;