# HG changeset patch # User unc0rr # Date 1353175637 -14400 # Node ID 4d3415927d2cb8cfabc9f05fd14fe67ea19c7c9c # Parent da083f8d95e661b40110025a7a8db5fc479f185b Use (undocumented) Mix_LoadMUS_RW to load music diff -r da083f8d95e6 -r 4d3415927d2c hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Sat Nov 17 00:41:30 2012 +0400 +++ b/hedgewars/SDLh.pas Sat Nov 17 22:07:17 2012 +0400 @@ -1024,7 +1024,7 @@ procedure Mix_FreeMusic(music: PMixMusic); cdecl; external SDL_MixerLibName; function Mix_LoadWAV_RW(src: PSDL_RWops; freesrc: LongInt): PMixChunk; cdecl; external SDL_MixerLibName; -function Mix_LoadMUS(const filename: PChar): PMixMusic; cdecl; external SDL_MixerLibName; +function Mix_LoadMUS_RW(src: PSDL_RWops): PMixMusic; cdecl; external SDL_MixerLibName; function Mix_Playing(channel: LongInt): LongInt; cdecl; external SDL_MixerLibName; function Mix_PlayingMusic: LongInt; cdecl; external SDL_MixerLibName; diff -r da083f8d95e6 -r 4d3415927d2c hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Sat Nov 17 00:41:30 2012 +0400 +++ b/hedgewars/uPhysFSLayer.pas Sat Nov 17 22:07:17 2012 +0400 @@ -102,7 +102,7 @@ i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, true); AddFileLog('[PhysFS] mount ' + PathPrefix + ': ' + inttostr(i)); i:= PHYSFS_mount(Str2PChar(UserPathPrefix + '/Data'), nil, true); - AddFileLog('[PhysFS] mount ' + UserPathPrefix + ': ' + inttostr(i)); + AddFileLog('[PhysFS] mount ' + UserPathPrefix + '/Data: ' + inttostr(i)); end; procedure freeModule; diff -r da083f8d95e6 -r 4d3415927d2c hedgewars/uSound.pas --- a/hedgewars/uSound.pas Sat Nov 17 00:41:30 2012 +0400 +++ b/hedgewars/uSound.pas Sat Nov 17 22:07:17 2012 +0400 @@ -416,12 +416,10 @@ if (not isSoundEnabled) or (MusicFN = '') or (not isMusicEnabled) then exit; - s:= UserPathPrefix + '/Data/Music/' + MusicFN; - if not FileExists(s) then - s:= PathPrefix + '/Music/' + MusicFN; + s:= '/Music/' + MusicFN; WriteToConsole(msgLoading + s + ' '); - Mus:= Mix_LoadMUS(Str2PChar(s)); + Mus:= Mix_LoadMUS_RW(rwopsOpenRead(s)); SDLTry(Mus <> nil, false); WriteLnToConsole(msgOK);