use MIX_DEFAULT_FORMAT for sound
authorsheepluva
Tue, 12 Jan 2016 21:21:44 +0100
changeset 11500 3a4026fe7c18
parent 11499 9c5d9993b14b
child 11501 2d72489cc5b6
use MIX_DEFAULT_FORMAT for sound
hedgewars/SDLh.pas
hedgewars/uSound.pas
--- a/hedgewars/SDLh.pas	Tue Jan 12 20:40:12 2016 +0100
+++ b/hedgewars/SDLh.pas	Tue Jan 12 21:21:44 2016 +0100
@@ -88,8 +88,13 @@
     SDL_ALLEVENTS        = $FFFFFFFF;    // dummy event type to prevent stack corruption
     SDL_APPINPUTFOCUS    = $02;
 
-    // audio formats
+    // (some) audio formats from SDL_audio.h
     AUDIO_S16LSB         = $8010; // Signed 16-bit samples, in little-endian byte order
+    AUDIO_S16MSB         = $9010; // Signed 16-bit samples, in big-endian byte order
+    AUDIO_S16SYS         = {$IFDEF ENDIAN_LITTLE}AUDIO_S16LSB{$ELSE}AUDIO_S16MSB{$ENDIF};
+
+    // default audio format from SDL_mixer.h
+    MIX_DEFAULT_FORMAT   = AUDIO_S16SYS;
 
     SDL_BUTTON_LEFT      = 1;
     SDL_BUTTON_MIDDLE    = 2;
--- a/hedgewars/uSound.pas	Tue Jan 12 20:40:12 2016 +0100
+++ b/hedgewars/uSound.pas	Tue Jan 12 21:21:44 2016 +0100
@@ -310,7 +310,7 @@
     success:= SDL_InitSubSystem(SDL_INIT_AUDIO) >= 0;
 
     if success then
-        success:= Mix_OpenAudio(44100, AUDIO_S16LSB, channels, 1024) = 0;
+        success:= Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, channels, 1024) = 0;
 
     if success then
         WriteLnToConsole(msgOK)