diff options
Diffstat (limited to 'Game/Code/Classes/UAudioPlayback_SDL.pas')
-rw-r--r-- | Game/Code/Classes/UAudioPlayback_SDL.pas | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Game/Code/Classes/UAudioPlayback_SDL.pas b/Game/Code/Classes/UAudioPlayback_SDL.pas index ed5a208b..39ecc72f 100644 --- a/Game/Code/Classes/UAudioPlayback_SDL.pas +++ b/Game/Code/Classes/UAudioPlayback_SDL.pas @@ -34,7 +34,7 @@ type function FinalizeAudioPlaybackEngine(): boolean; override;
public
function GetName: String; override;
- procedure MixBuffers(dst, src: PChar; size: Cardinal; volume: Integer); override;
+ procedure MixBuffers(dst, src: PChar; size: Cardinal; volume: Single); override;
end;
var
@@ -134,11 +134,9 @@ begin Result := true;
end;
-procedure TAudioPlayback_SDL.MixBuffers(dst, src: PChar; size: Cardinal; volume: Integer);
+procedure TAudioPlayback_SDL.MixBuffers(dst, src: PChar; size: Cardinal; volume: Single);
begin
- // Note: (volume * SDL_MIX_MAXVOLUME) may exceed High(Integer)
- // if SDL_MIX_MAXVOLUME (=128 at the moment) changes
- SDL_MixAudio(PUInt8(dst), PUInt8(src), size, volume * SDL_MIX_MAXVOLUME div 100);
+ SDL_MixAudio(PUInt8(dst), PUInt8(src), size, Round(volume * SDL_MIX_MAXVOLUME));
end;
|