From: DeaDDooMER Date: Sun, 1 Sep 2019 09:33:16 +0000 (+0300) Subject: fix random sound volume with OpenAL X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=3544016d36916d0750daf30aa9cb9beddae123f9;p=d2df-sdl.git fix random sound volume with OpenAL --- diff --git a/src/engine/e_sound_al.inc b/src/engine/e_sound_al.inc index 312b701..f6ec993 100644 --- a/src/engine/e_sound_al.inc +++ b/src/engine/e_sound_al.inc @@ -91,7 +91,7 @@ procedure e_SoundUpdate(); var e_SoundFormat: TSoundFormat; // desired sound format e_SoundsArray: array of TSoundRec = nil; - e_ZeroPosition: array [0..2] of ALfloat; + e_ZeroPosition: array [0..2] of ALfloat = (0, 0, 0); e_ALError: ALenum = 0; implementation @@ -496,6 +496,8 @@ begin if Result >= 0 then begin Pos[0] := Pan; + Pos[1] := 0; + Pos[2] := 0; AssignSound(ID, alSources[Result]); alSourcef(alSources[Result], AL_GAIN, 1); alSourcefv(alSources[Result], AL_POSITION, Pos); @@ -523,6 +525,8 @@ begin if Result >= 0 then begin Pos[0] := Pan; + Pos[1] := 0; + Pos[2] := 0; AssignSound(ID, alSources[Result]); alSourcefv(alSources[Result], AL_POSITION, Pos); alSourcef(alSources[Result], AL_GAIN, Volume); @@ -814,6 +818,8 @@ begin if InvalidSource() then Exit; Pos[0] := Pan; + Pos[1] := 0; + Pos[2] := 0; alSourcefv(alSources[FSource], AL_POSITION, Pos); end;