aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UAudioPlayback_SDL.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UAudioPlayback_SDL.pas7
1 files changed, 7 insertions, 0 deletions
diff --git a/Game/Code/Classes/UAudioPlayback_SDL.pas b/Game/Code/Classes/UAudioPlayback_SDL.pas
index 1ea0c5b7..4c9200b2 100644
--- a/Game/Code/Classes/UAudioPlayback_SDL.pas
+++ b/Game/Code/Classes/UAudioPlayback_SDL.pas
@@ -31,6 +31,7 @@ type
procedure StopAudioPlaybackEngine(); override;
public
function GetName: String; override;
+ procedure MixBuffers(dst, src: PChar; size: Cardinal; volume: Integer); override;
end;
var
@@ -100,6 +101,12 @@ begin
SDL_CloseAudio();
end;
+procedure TAudioPlayback_SDL.MixBuffers(dst, src: PChar; size: Cardinal; volume: Integer);
+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);
+end;
initialization