hedgewars/uSound.pas
branchphysfslayer
changeset 8046 4d3415927d2c
parent 8025 07862ab415c8
child 8096 453917e94e55
child 8145 6408c0ba4ba1
equal deleted inserted replaced
8043:da083f8d95e6 8046:4d3415927d2c
   414 var s: shortstring;
   414 var s: shortstring;
   415 begin
   415 begin
   416     if (not isSoundEnabled) or (MusicFN = '') or (not isMusicEnabled) then
   416     if (not isSoundEnabled) or (MusicFN = '') or (not isMusicEnabled) then
   417         exit;
   417         exit;
   418 
   418 
   419     s:= UserPathPrefix + '/Data/Music/' + MusicFN;
   419     s:= '/Music/' + MusicFN;
   420     if not FileExists(s) then
       
   421         s:= PathPrefix + '/Music/' + MusicFN;
       
   422     WriteToConsole(msgLoading + s + ' ');
   420     WriteToConsole(msgLoading + s + ' ');
   423 
   421 
   424     Mus:= Mix_LoadMUS(Str2PChar(s));
   422     Mus:= Mix_LoadMUS_RW(rwopsOpenRead(s));
   425     SDLTry(Mus <> nil, false);
   423     SDLTry(Mus <> nil, false);
   426     WriteLnToConsole(msgOK);
   424     WriteLnToConsole(msgOK);
   427 
   425 
   428     SDLTry(Mix_FadeInMusic(Mus, -1, 3000) <> -1, false)
   426     SDLTry(Mix_FadeInMusic(Mus, -1, 3000) <> -1, false)
   429 end;
   427 end;