X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fengine%2Fe_sound_fmod.inc;h=f28994f1b3afa88aa9e011bb140d2b7bd2f4d9ba;hb=493befdc432063207dc653ff49da645a567567ba;hp=ab3f4fe1c14a0e5dd00dc909c79e48e91406ac0b;hpb=56ec1dee6d63a32353f94eac7e87d6a42b801a25;p=d2df-sdl.git diff --git a/src/engine/e_sound_fmod.inc b/src/engine/e_sound_fmod.inc index ab3f4fe..f28994f 100644 --- a/src/engine/e_sound_fmod.inc +++ b/src/engine/e_sound_fmod.inc @@ -1,9 +1,8 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -68,8 +67,8 @@ const function e_InitSoundSystem(NoOutput: Boolean = False): Boolean; -function e_LoadSound(FileName: string; var ID: DWORD; bLoop: Boolean): Boolean; -function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; bLoop: Boolean): Boolean; +function e_LoadSound(FileName: string; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean; +function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean; function e_PlaySound(ID: DWORD): Integer; function e_PlaySoundPan(ID: DWORD; Pan: Single): Integer; @@ -213,6 +212,11 @@ begin if res <> FMOD_OK then res := TryInitWithOutput(FMOD_OUTPUTTYPE_OSS, 'OUTPUTTYPE_OSS'); {$ENDIF} + {$IFDEF DARWIN} + res := TryInitWithOutput(FMOD_OUTPUTTYPE_COREAUDIO, 'OUTPUTTYPE_COREAUDIO'); + if res <> FMOD_OK then + res := TryInitWithOutput(FMOD_OUTPUTTYPE_SOUNDMANAGER, 'OUTPUTTYPE_SOUNDMANAGER'); + {$ENDIF} if (res <> FMOD_OK) and (forceNoSound <> 1) then Exit; if res <> FMOD_OK then res := TryInitWithOutput(FMOD_OUTPUTTYPE_NOSOUND, 'OUTPUTTYPE_NOSOUND'); @@ -238,6 +242,8 @@ begin FMOD_OUTPUTTYPE_ASIO: e_WriteLog('FMOD Output Method: ASIO', TMsgType.Notify); FMOD_OUTPUTTYPE_OSS: e_WriteLog('FMOD Output Method: OSS', TMsgType.Notify); FMOD_OUTPUTTYPE_ALSA: e_Writelog('FMOD Output Method: ALSA', TMsgType.Notify); + FMOD_OUTPUTTYPE_SOUNDMANAGER: e_Writelog('FMOD Output Method: SOUNDMANAGER', TMsgType.Notify); + FMOD_OUTPUTTYPE_COREAUDIO: e_Writelog('FMOD Output Method: COREAUDIO', TMsgType.Notify); else e_WriteLog('FMOD Output Method: Unknown', TMsgType.Notify); end; @@ -286,7 +292,7 @@ begin end; end; -function e_LoadSound(FileName: String; var ID: DWORD; bLoop: Boolean): Boolean; +function e_LoadSound(FileName: String; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean; var find_id: DWORD; res: FMOD_RESULT; @@ -300,12 +306,12 @@ begin find_id := FindESound(); - if bLoop then + if isMusic and not ForceNoLoop then bt := FMOD_LOOP_NORMAL else bt := FMOD_LOOP_OFF; - if not bLoop then + if not isMusic then res := FMOD_System_CreateSound(F_System, PAnsiChar(FileName), bt + FMOD_2D + FMOD_HARDWARE, nil, e_SoundsArray[find_id].Sound) @@ -329,7 +335,7 @@ begin end; e_SoundsArray[find_id].Data := nil; - e_SoundsArray[find_id].isMusic := bLoop; + e_SoundsArray[find_id].isMusic := isMusic; e_SoundsArray[find_id].nRefs := 0; ID := find_id; @@ -337,7 +343,7 @@ begin Result := True; end; -function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; bLoop: Boolean): Boolean; +function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean; var find_id: DWORD; res: FMOD_RESULT; @@ -356,12 +362,12 @@ begin soundExInfo.cbsize := sz; soundExInfo.length := Length; - if bLoop then + if isMusic and not ForceNoLoop then bt := FMOD_LOOP_NORMAL else bt := FMOD_LOOP_OFF; - if not bLoop then + if not isMusic then res := FMOD_System_CreateSound(F_System, pData, bt + FMOD_2D + FMOD_HARDWARE + FMOD_OPENMEMORY, @soundExInfo, e_SoundsArray[find_id].Sound) @@ -385,7 +391,7 @@ begin end; e_SoundsArray[find_id].Data := pData; - e_SoundsArray[find_id].isMusic := bLoop; + e_SoundsArray[find_id].isMusic := isMusic; e_SoundsArray[find_id].nRefs := 0; ID := find_id;