From: DeaDDooMER Date: Thu, 30 Apr 2020 16:37:01 +0000 (+0300) Subject: al: fix build with sdl 1.2 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=f2b9872b69cf016222f45b3a6261116d9f23f4ff;p=d2df-sdl.git al: fix build with sdl 1.2 --- diff --git a/src/engine/e_soundfile_wav.pas b/src/engine/e_soundfile_wav.pas index 84ea42d..153cad4 100644 --- a/src/engine/e_soundfile_wav.pas +++ b/src/engine/e_soundfile_wav.pas @@ -48,7 +48,7 @@ implementation uses {$IFDEF USE_SDL} - SDL, + SDL, cmem, {$ELSE} SDL2, {$ENDIF} @@ -89,8 +89,10 @@ begin AUDIO_U8, AUDIO_S8 : tformat := AUDIO_U8; (* yes, unsigned *) AUDIO_U16LSB, AUDIO_U16MSB: tformat := AUDIO_S16SYS; (* and yes, signed *) AUDIO_S16LSB, AUDIO_S16MSB: tformat := AUDIO_S16SYS; + {$IFDEF USE_SDL2} AUDIO_S32LSB, AUDIO_S32MSB: tformat := AUDIO_S16SYS; (* 32bit not supported in al core *) AUDIO_F32LSB, AUDIO_F32MSB: tformat := AUDIO_S16SYS; (* float not supported in al core *) + {$ENDIF} else result := false (* unsupported format *) end; if (result = true) and (format <> tformat) then @@ -98,7 +100,11 @@ begin Result := False; if SDL_BuildAudioCVT(@cvt, format, chan, rate, tformat, chan, rate) <> -1 then begin - buf := SDL_realloc(buf, len * cvt.len_mult); + {$IFDEF USE_SDL2} + buf := SDL_realloc(buf, len * cvt.len_mult); + {$ELSE} + buf := realloc(buf, len * cvt.len_mult); + {$ENDIF} cvt.len := len; cvt.buf := buf; result := SDL_ConvertAudio(@cvt) = 0;