DEADSOFTWARE

al: fix 16bit wav sounds on big endian with sdl 1.2
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 13 Jul 2022 14:21:04 +0000 (17:21 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 13 Jul 2022 14:21:04 +0000 (17:21 +0300)
src/lib/sdl/sdl.pas

index 3425ea317679c952bc1db07dbeb937641b61c9c0..ebec9eeec95dff7fd9f27a3222827817e886fb8e 100644 (file)
@@ -457,28 +457,24 @@ const
   SDL_BIG_ENDIAN = 4321;
 {$EXTERNALSYM SDL_BIG_ENDIAN}
 
-{$IFDEF IA32}
-
+{$IFDEF FPC_LITTLE_ENDIAN}
   SDL_BYTEORDER = SDL_LIL_ENDIAN;
+{$ELSE}
+  SDL_BYTEORDER = SDL_BIG_ENDIAN;
+{$ENDIF}
 {$EXTERNALSYM SDL_BYTEORDER}
+
   // Native audio byte ordering
+{$IFDEF FPC_LITTLE_ENDIAN}
+  SDL_BYTEORDER = SDL_LIL_ENDIAN;
   AUDIO_U16SYS = AUDIO_U16LSB;
-{$EXTERNALSYM AUDIO_U16SYS}
   AUDIO_S16SYS = AUDIO_S16LSB;
-{$EXTERNALSYM AUDIO_S16SYS}
-
 {$ELSE}
-
-  SDL_BYTEORDER = SDL_BIG_ENDIAN;
-{$EXTERNALSYM SDL_BYTEORDER}
-  // Native audio byte ordering
   AUDIO_U16SYS = AUDIO_U16MSB;
-{$EXTERNALSYM AUDIO_U16SYS}
   AUDIO_S16SYS = AUDIO_S16MSB;
-{$EXTERNALSYM AUDIO_S16SYS}
-
 {$ENDIF}
-
+{$EXTERNALSYM AUDIO_U16SYS}
+{$EXTERNALSYM AUDIO_S16SYS}
 
   SDL_MIX_MAXVOLUME = 128;
 {$EXTERNALSYM SDL_MIX_MAXVOLUME}