diff --git a/3rdparty/sdl2-2.0.4/Makefile.pandora b/3rdparty/sdl2-2.0.4/Makefile.pandora
deleted file mode 100644
index bb89d52a69..0000000000
--- a/3rdparty/sdl2-2.0.4/Makefile.pandora
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile to build the pandora SDL library
-
-AR = arm-none-linux-gnueabi-ar
-RANLIB = arm-none-linux-gnueabi-ranlib
-CC = arm-none-linux-gnueabi-gcc
-CXX = arm-none-linux-gnueabi-g++
-STRIP = arm-none-linux-gnueabi-strip
-
-CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
- -mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
- -I./include -I$(PNDSDK)/usr/include -DSDL_REVISION=0
-
-TARGET = libSDL.a
-
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
- ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
- ./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
- ./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
- ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
- ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
- ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
- ./src/atomic/linux/*.c ./src/filesystem/unix/*.c \
- ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c
-
-
-OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
-
-CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h && touch include/SDL_revision.h)
-
-all: $(TARGET)
-
-$(TARGET): $(CONFIG_H) $(OBJECTS)
- $(AR) crv $@ $^
- $(RANLIB) $@
-
-clean:
- rm -f $(TARGET) $(OBJECTS)
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj b/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj
deleted file mode 100644
index 3776d2433b..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj
+++ /dev/null
@@ -1,452 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- ARM
-
-
- Release
- Win32
-
-
- Release
- ARM
-
-
-
- {33048af1-031a-4ce6-b61e-fad2db832e9e}
- SDL
- en-US
- 11.0
- SDL2-WinPhone80
-
-
-
- DynamicLibrary
- true
- v110_wp80
- false
-
-
- DynamicLibrary
- true
- v110_wp80
- false
-
-
- DynamicLibrary
- false
- true
- v110_wp80
- false
-
-
- DynamicLibrary
- false
- true
- v110_wp80
- false
-
-
-
-
-
-
-
- false
-
-
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
-
- _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
- NotUsing
- pch.h
- false
- $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)
- ..\..\include
- false
-
-
- Console
- false
- false
- true
- DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)
-
-
-
-
- _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions)
- NotUsing
- pch.h
- false
- $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)
- ..\..\include
-
-
- Console
- false
- false
- true
- DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)
-
-
-
-
- _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
- NotUsing
- pch.h
- false
- $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)
- ..\..\include
- false
-
-
- Console
- false
- false
- true
- DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)
-
-
-
-
- _USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions)
- NotUsing
- pch.h
- false
- $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)
- ..\..\include
-
-
- Console
- false
- false
- true
- DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)
-
-
-
-
- true
-
-
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
-
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters b/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters
deleted file mode 100644
index 1f4df44e41..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters
+++ /dev/null
@@ -1,678 +0,0 @@
-
-
-
-
- {02b21b9a-45a7-41ee-a8a6-e45d14aa28da}
-
-
- {abc3a7e6-f955-4cb5-8340-fae0f653e9c1}
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln b/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln
deleted file mode 100644
index f2ef55f68f..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.sln
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL-WinRT", "SDL-WinRT80.vcxproj", "{AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|ARM = Release|ARM
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|ARM.ActiveCfg = Debug|ARM
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|ARM.Build.0 = Debug|ARM
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|Win32.ActiveCfg = Debug|Win32
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|Win32.Build.0 = Debug|Win32
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|x64.ActiveCfg = Debug|x64
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Debug|x64.Build.0 = Debug|x64
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|ARM.ActiveCfg = Release|ARM
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|ARM.Build.0 = Release|ARM
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|Win32.ActiveCfg = Release|Win32
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|Win32.Build.0 = Release|Win32
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|x64.ActiveCfg = Release|x64
- {AEAEA3A2-D4E6-45B1-8EC6-53D84287FC14}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj b/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj
deleted file mode 100644
index fbcd94b6b6..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj
+++ /dev/null
@@ -1,548 +0,0 @@
-
-
-
-
- Debug
- ARM
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- ARM
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
-
-
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {aeaea3a2-d4e6-45b1-8ec6-53d84287fc14}
- Win32Proj
- SDL2-WinRT80
- SDL_VS2012_WinRT
- en-US
- 11.0
- true
-
-
-
- DynamicLibrary
- true
- v110
-
-
- DynamicLibrary
- true
- v110
-
-
- DynamicLibrary
- true
- v110
-
-
- DynamicLibrary
- false
- true
- v110
-
-
- DynamicLibrary
- false
- true
- v110
-
-
- DynamicLibrary
- false
- true
- v110
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
- false
- false
- SDL2
- Objs\$(Platform)\$(Configuration)\$(MSBuildProjectName)\
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
- NotUsing
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- _WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)
-
-
- Console
- false
- false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
-
-
-
-
-
-
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters b/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters
deleted file mode 100644
index aa539d37e1..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters
+++ /dev/null
@@ -1,726 +0,0 @@
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Header Files
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- {20773b57-7034-4c24-af5a-334844585f1b}
-
-
- {ddf04d85-6a87-4c5a-bc52-869b38f45a61}
-
-
-
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL_VS2008.vcproj
deleted file mode 100644
index 3d3d39969a..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL_VS2008.vcproj
+++ /dev/null
@@ -1,1509 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDL_VS2008.sln b/3rdparty/sdl2-2.0.4/VisualC/SDL_VS2008.sln
deleted file mode 100644
index 047508a80b..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/SDL_VS2008.sln
+++ /dev/null
@@ -1,269 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2008.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2008.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2008.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2008.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2008.vcproj", "{66B32F7E-5716-48D0-B5B9-D832FD052DD5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_VS2008.vcproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2008.vcproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2008.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2008.vcproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2008.vcproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08304}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2008.vcproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2008.vcproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2008.vcproj", "{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrumble", "tests\testrumble\testrumble_VS2008.vcproj", "{BFF40245-E9A6-4297-A425-A554E5D767E8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2008.vcproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2008.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2008.vcproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2008.vcproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2_VS2008.vcproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap_VS2008.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
- {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
- {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
- {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
- {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
- {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
- {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64
- {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
- {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
- {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64
- {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.ActiveCfg = Debug|Win32
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.Build.0 = Debug|Win32
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|x64
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.Build.0 = Debug|x64
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.ActiveCfg = Release|Win32
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.Build.0 = Release|Win32
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|x64
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.Build.0 = Release|x64
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.ActiveCfg = Debug|Win32
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.Build.0 = Debug|Win32
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|x64
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.Build.0 = Debug|x64
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.ActiveCfg = Release|Win32
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|x64
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.Build.0 = Release|x64
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|x64
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.Build.0 = Debug|x64
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|x64
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.Build.0 = Release|x64
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.Build.0 = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.Build.0 = Release|x64
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|x64
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.Build.0 = Debug|x64
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.ActiveCfg = Release|x64
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|x64.Build.0 = Release|x64
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64
- {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.ActiveCfg = Debug|Win32
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.Build.0 = Debug|Win32
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|x64
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.Build.0 = Debug|x64
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.ActiveCfg = Release|Win32
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.Build.0 = Release|Win32
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|x64
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.Build.0 = Release|x64
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.ActiveCfg = Debug|Win32
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|Win32.Build.0 = Debug|Win32
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.ActiveCfg = Debug|x64
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Debug|x64.Build.0 = Debug|x64
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.ActiveCfg = Release|Win32
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|Win32.Build.0 = Release|Win32
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.ActiveCfg = Release|x64
- {BFF40245-E9A6-4297-A425-A554E5D767E8}.Release|x64.Build.0 = Release|x64
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.ActiveCfg = Debug|Win32
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.Build.0 = Debug|Win32
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|x64
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.Build.0 = Debug|x64
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.ActiveCfg = Release|Win32
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.Build.0 = Release|Win32
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|x64
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.Build.0 = Release|x64
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|x64
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.Build.0 = Debug|x64
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|x64
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.Build.0 = Release|x64
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
- {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.ActiveCfg = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Win32.Build.0 = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.ActiveCfg = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08305}.Debug|x64.Build.0 = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.ActiveCfg = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08305}.Release|Win32.Build.0 = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.ActiveCfg = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08305}.Release|x64.Build.0 = Release|x64
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.ActiveCfg = Debug|Win32
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|Win32.Build.0 = Debug|Win32
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.ActiveCfg = Debug|x64
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Debug|x64.Build.0 = Debug|x64
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.ActiveCfg = Release|Win32
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.Build.0 = Release|Win32
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.ActiveCfg = Release|x64
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.Build.0 = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.ActiveCfg = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.Build.0 = Debug|Win32
- {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.ActiveCfg = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.Build.0 = Debug|x64
- {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.ActiveCfg = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32
- {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64
- {55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {55812185-D13C-4022-9C81-32E0F4A08304} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {26932B24-EFC6-4E3A-B277-ED653DA37968} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {BFF40245-E9A6-4297-A425-A554E5D767E8} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- {26828762-C95D-4637-9CB1-7F0979523813} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
- EndGlobalSection
-EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain_VS2008.vcproj
deleted file mode 100644
index 65dd31d39c..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain_VS2008.vcproj
+++ /dev/null
@@ -1,296 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest_VS2008.vcproj
deleted file mode 100644
index 8a22d0fc45..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest_VS2008.vcproj
+++ /dev/null
@@ -1,352 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj
deleted file mode 100644
index b02c4cfa7d..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj
+++ /dev/null
@@ -1,388 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/controllermap/controllermap_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/controllermap/controllermap_VS2008.vcproj
deleted file mode 100644
index 1ecce67373..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/controllermap/controllermap_VS2008.vcproj
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/loopwave/loopwave_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/loopwave/loopwave_VS2008.vcproj
deleted file mode 100644
index 1cbf89a8cd..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/loopwave/loopwave_VS2008.vcproj
+++ /dev/null
@@ -1,396 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testatomic/testatomic_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testatomic/testatomic_VS2008.vcproj
deleted file mode 100644
index 5f4452b580..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testatomic/testatomic_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testautomation/testautomation_VS2008.vcproj
deleted file mode 100755
index dc1bec0f44..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testautomation/testautomation_VS2008.vcproj
+++ /dev/null
@@ -1,431 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj
deleted file mode 100644
index 16612aeaac..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj
+++ /dev/null
@@ -1,355 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testfile/testfile_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testfile/testfile_VS2008.vcproj
deleted file mode 100644
index 46f796a4a1..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testfile/testfile_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj
deleted file mode 100644
index 1b31f57b0a..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testgamecontroller/testgamecontroller_VS2008.vcproj
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgesture/testgesture_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testgesture/testgesture_VS2008.vcproj
deleted file mode 100644
index 4fff2273ea..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testgesture/testgesture_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgl2/testgl2_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testgl2/testgl2_VS2008.vcproj
deleted file mode 100644
index 0c42dc72a1..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testgl2/testgl2_VS2008.vcproj
+++ /dev/null
@@ -1,359 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2_VS2008.vcproj
deleted file mode 100644
index b70a137152..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj
deleted file mode 100644
index eb1a19fa6b..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj
deleted file mode 100644
index 578a7c34a2..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj
+++ /dev/null
@@ -1,392 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testplatform/testplatform_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testplatform/testplatform_VS2008.vcproj
deleted file mode 100644
index 014faeeaa0..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testplatform/testplatform_VS2008.vcproj
+++ /dev/null
@@ -1,364 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testpower/testpower_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testpower/testpower_VS2008.vcproj
deleted file mode 100644
index e140e6b947..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testpower/testpower_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj
deleted file mode 100644
index d13432ac22..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj
+++ /dev/null
@@ -1,443 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testrumble/testrumble_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testrumble/testrumble_VS2008.vcproj
deleted file mode 100644
index ea4a858365..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testrumble/testrumble_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testscale/testscale_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testscale/testscale_VS2008.vcproj
deleted file mode 100644
index 5a15fccf8d..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testscale/testscale_VS2008.vcproj
+++ /dev/null
@@ -1,443 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testshape/testshape_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testshape/testshape_VS2008.vcproj
deleted file mode 100644
index 73db789315..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testshape/testshape_VS2008.vcproj
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj b/3rdparty/sdl2-2.0.4/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj
deleted file mode 100644
index 7236ecc4f8..0000000000
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj
+++ /dev/null
@@ -1,399 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/WhatsNew.txt b/3rdparty/sdl2-2.0.4/WhatsNew.txt
deleted file mode 100644
index 698ebf7dfa..0000000000
--- a/3rdparty/sdl2-2.0.4/WhatsNew.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-
-This is a list of major changes in SDL's version history.
-
----------------------------------------------------------------------------
-2.0.4:
----------------------------------------------------------------------------
-
-General:
-* Added support for web applications using Emscripten, see docs/README-emscripten.md for more information
-* Added support for web applications using Native Client (NaCl), see docs/README-nacl.md for more information
-* Added an API to queue audio instead of using the audio callback:
- SDL_QueueAudio(), SDL_GetQueuedAudioSize(), SDL_ClearQueuedAudio()
-* Added events for audio device hot plug support:
- SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED
-* Added SDL_PointInRect()
-* Added SDL_HasAVX2() to detect CPUs with AVX2 support
-* Added SDL_SetWindowHitTest() to let apps treat parts of their SDL window like traditional window decorations (drag areas, resize areas)
-* Added SDL_GetGrabbedWindow() to get the window that currently has input grab, if any
-* Added SDL_RenderIsClipEnabled() to tell whether clipping is currently enabled in a renderer
-* Added SDL_CaptureMouse() to capture the mouse to get events while the mouse is not in your window
-* Added SDL_WarpMouseGlobal() to warp the mouse cursor in global screen space
-* Added SDL_GetGlobalMouseState() to get the current mouse state outside of an SDL window
-* Added a direction field to mouse wheel events to tell whether they are flipped (natural) or not
-* Added GL_CONTEXT_RELEASE_BEHAVIOR GL attribute (maps to [WGL|GLX]_ARB_context_flush_control extension)
-* Added EGL_KHR_create_context support to allow OpenGL ES version selection on some platforms
-* Added NV12 and NV21 YUV texture support for OpenGL and OpenGL ES 2.0 renderers
-* Added a Vivante video driver that is used on various SoC platforms
-* Added an event SDL_RENDER_DEVICE_RESET that is sent from the D3D renderers when the D3D device is lost, and from Android's event loop when the GLES context had to be recreated
-* Added a hint SDL_HINT_NO_SIGNAL_HANDLERS to disable SDL's built in signal handling
-* Added a hint SDL_HINT_THREAD_STACK_SIZE to set the stack size of SDL's threads
-* Added SDL_sqrtf(), SDL_tan(), and SDL_tanf() to the stdlib routines
-* Improved support for WAV and BMP files with unusual chunks in them
-* Renamed SDL_assert_data to SDL_AssertData and SDL_assert_state to SDL_AssertState
-* Added a hint SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN to prevent window interaction while cursor is hidden
-* Added SDL_GetDisplayDPI() to get the DPI information for a display
-* Added SDL_JoystickCurrentPowerLevel() to get the battery level of a joystick
-* Added SDL_JoystickFromInstanceID(), as a helper function, to get the SDL_Joystick* that an event is referring to.
-* Added SDL_GameControllerFromInstanceID(), as a helper function, to get the SDL_GameController* that an event is referring to.
-
-Windows:
-* Added support for Windows Phone 8.1 and Windows 10/UWP (Universal Windows Platform)
-* Timer resolution is now 1 ms by default, adjustable with the SDL_HINT_TIMER_RESOLUTION hint
-* SDLmain no longer depends on the C runtime, so you can use the same .lib in both Debug and Release builds
-* Added SDL_SetWindowsMessageHook() to set a function to be called for every windows message before TranslateMessage()
-* Added a hint SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP to control whether SDL_PumpEvents() processes the Windows message loop
-* You can distinguish between real mouse and touch events by looking for SDL_TOUCH_MOUSEID in the mouse event "which" field
-* SDL_SysWMinfo now contains the window HDC
-* Added support for Unicode command line options
-* Prevent beeping when Alt-key combos are pressed
-* SDL_SetTextInputRect() re-positions the OS-rendered IME
-* Added a hint SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to prevent generating SDL_WINDOWEVENT_CLOSE events when Alt-F4 is pressed
-* Added a hint SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING to use the old axis and button mapping for XInput devices (deprecated)
-
-Mac OS X:
-* Implemented drag-and-drop support
-* Improved joystick hot-plug detection
-* The SDL_WINDOWEVENT_EXPOSED window event is triggered in the appropriate situations
-* Fixed relative mouse mode when the application loses/regains focus
-* Fixed bugs related to transitioning to and from Spaces-aware fullscreen-desktop mode
-* Fixed the refresh rate of display modes
-* SDL_SysWMInfo is now ARC-compatible
-* Added a hint SDL_HINT_MAC_BACKGROUND_APP to prevent forcing the application to become a foreground process
-
-Linux:
-* Enabled building with Mir and Wayland support by default.
-* Added IBus IME support
-* Added a hint SDL_HINT_IME_INTERNAL_EDITING to control whether IBus should handle text editing internally instead of sending SDL_TEXTEDITING events
-* Added a hint SDL_HINT_VIDEO_X11_NET_WM_PING to allow disabling _NET_WM_PING protocol handling in SDL_CreateWindow()
-* Added support for multiple audio devices when using Pulseaudio
-* Fixed duplicate mouse events when using relative mouse motion
-
-iOS:
-* Added support for iOS 8
-* The SDL_WINDOW_ALLOW_HIGHDPI window flag now enables high-dpi support, and SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() gets the window resolution in pixels
-* SDL_GetWindowSize() and display mode sizes are in the "DPI-independent points" / "screen coordinates" coordinate space rather than pixels (matches OS X behavior)
-* Added native resolution support for the iPhone 6 Plus
-* Added support for MFi game controllers
-* Added support for the hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK
-* Added sRGB OpenGL ES context support on iOS 7+
-* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
-* SDL_SysWMinfo now contains the OpenGL ES framebuffer and color renderbuffer objects used by the window's active GLES view
-* Fixed various rotation and orientation issues
-* Fixed memory leaks
-
-Android:
-* Added a hint SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH to prevent mouse events from being registered as touch events
-* Added hints SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION and SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION
-* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
-* Added support for SDL_ShowMessageBox() and SDL_ShowSimpleMessageBox()
-
-Raspberry Pi:
-* Added support for the Raspberry Pi 2
-
-
----------------------------------------------------------------------------
-2.0.3:
----------------------------------------------------------------------------
-
-Mac OS X:
-* Fixed creating an OpenGL context by default on Mac OS X 10.6
-
-
----------------------------------------------------------------------------
-2.0.2:
----------------------------------------------------------------------------
-General:
-* Added SDL_GL_ResetAttributes() to reset OpenGL attributes to default values
-* Added an API to load a database of game controller mappings from a file:
- SDL_GameControllerAddMappingsFromFile(), SDL_GameControllerAddMappingsFromRW()
-* Added game controller mappings for the PS4 and OUYA controllers
-* Added SDL_GetDefaultAssertionHandler() and SDL_GetAssertionHandler()
-* Added SDL_DetachThread()
-* Added SDL_HasAVX() to determine if the CPU has AVX features
-* Added SDL_vsscanf(), SDL_acos(), and SDL_asin() to the stdlib routines
-* EGL can now create/manage OpenGL and OpenGL ES 1.x/2.x contexts, and share
- them using SDL_GL_SHARE_WITH_CURRENT_CONTEXT
-* Added a field "clicks" to the mouse button event which records whether the event is a single click, double click, etc.
-* The screensaver is now disabled by default, and there is a hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER that can change that behavior.
-* Added a hint SDL_HINT_MOUSE_RELATIVE_MODE_WARP to specify whether mouse relative mode should be emulated using mouse warping.
-* testgl2 does not need to link with libGL anymore
-* Added testgles2 test program to demonstrate working with OpenGL ES 2.0
-* Added controllermap test program to visually map a game controller
-
-Windows:
-* Support for OpenGL ES 2.x contexts using either WGL or EGL (natively via
- the driver or emulated through ANGLE)
-* Added a hint SDL_HINT_VIDEO_WIN_D3DCOMPILER to specify which D3D shader compiler to use for OpenGL ES 2 support through ANGLE
-* Added a hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that is useful when creating multiple windows that should share the same OpenGL context.
-* Added an event SDL_RENDER_TARGETS_RESET that is sent when D3D9 render targets are reset after the device has been restored.
-
-Mac OS X:
-* Added a hint SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK to control whether Ctrl+click should be treated as a right click on Mac OS X. This is off by default.
-
-Linux:
-* Fixed fullscreen and focused behavior when receiving NotifyGrab events
-* Added experimental Wayland and Mir support, disabled by default
-
-Android:
-* Joystick support (minimum SDK version required to build SDL is now 12,
- the required runtime version remains at 10, but on such devices joystick
- support won't be available).
-* Hotplugging support for joysticks
-* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
-
-
----------------------------------------------------------------------------
-2.0.1:
----------------------------------------------------------------------------
-
-General:
-* Added an API to get common filesystem paths in SDL_filesystem.h:
- SDL_GetBasePath(), SDL_GetPrefPath()
-* Added an API to do optimized YV12 and IYUV texture updates:
- SDL_UpdateYUVTexture()
-* Added an API to get the amount of RAM on the system:
- SDL_GetSystemRAM()
-* Added a macro to perform timestamp comparisons with SDL_GetTicks():
- SDL_TICKS_PASSED()
-* Dramatically improved OpenGL ES 2.0 rendering performance
-* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
-
-Windows:
-* Created a static library configuration for the Visual Studio 2010 project
-* Added a hint to create the Direct3D device with support for multi-threading:
- SDL_HINT_RENDER_DIRECT3D_THREADSAFE
-* Added a function to get the D3D9 adapter index for a display:
- SDL_Direct3D9GetAdapterIndex()
-* Added a function to get the D3D9 device for a D3D9 renderer:
- SDL_RenderGetD3D9Device()
-* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
-* Fixed crash when using two XInput controllers at the same time
-* Fixed detecting a mixture of XInput and DirectInput controllers
-* Fixed clearing a D3D render target larger than the window
-* Improved support for format specifiers in SDL_snprintf()
-
-Mac OS X:
-* Added support for retina displays:
- Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
-* Fixed mouse warping in fullscreen mode
-* Right mouse click is emulated by holding the Ctrl key while left clicking
-
-Linux:
-* Fixed float audio support with the PulseAudio driver
-* Fixed missing line endpoints in the OpenGL renderer on some drivers
-* X11 symbols are no longer defined to avoid collisions when linking statically
-
-iOS:
-* Fixed status bar visibility on iOS 7
-* Flipped the accelerometer Y axis to match expected values
-
-Android:
-IMPORTANT: You MUST get the updated SDLActivity.java to match C code
-* Moved EGL initialization to native code
-* Fixed the accelerometer axis rotation relative to the device rotation
-* Fixed race conditions when handling the EGL context on pause/resume
-* Touch devices are available for enumeration immediately after init
-
-Raspberry Pi:
-* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/rectangles.c b/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/rectangles.c
deleted file mode 100644
index 86fce49fe6..0000000000
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/rectangles.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * rectangles.c
- * written by Holmes Futrell
- * use however you want
-*/
-
-#include "SDL.h"
-#include
-#include "common.h"
-
-void
-render(SDL_Renderer *renderer)
-{
-
- Uint8 r, g, b;
- /* Come up with a random rectangle */
- SDL_Rect rect;
- rect.w = randomInt(64, 128);
- rect.h = randomInt(64, 128);
- rect.x = randomInt(0, SCREEN_WIDTH);
- rect.y = randomInt(0, SCREEN_HEIGHT);
-
- /* Come up with a random color */
- r = randomInt(50, 255);
- g = randomInt(50, 255);
- b = randomInt(50, 255);
-
- /* Fill the rectangle in the color */
- SDL_SetRenderDrawColor(renderer, r, g, b, 255);
- SDL_RenderFillRect(renderer, &rect);
-
- /* update screen */
- SDL_RenderPresent(renderer);
-
-}
-
-int
-main(int argc, char *argv[])
-{
- if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO */) < 0)
- {
- printf("Unable to initialize SDL");
- }
-
- SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-
- int landscape = 1;
- int modes = SDL_GetNumDisplayModes(0);
- int sx = 0, sy = 0;
- for (int i = 0; i < modes; i++)
- {
- SDL_DisplayMode mode;
- SDL_GetDisplayMode(0, i, &mode);
- if (landscape ? mode.w > sx : mode.h > sy)
- {
- sx = mode.w;
- sy = mode.h;
- }
- }
-
- printf("picked: %d %d\n", sx, sy);
-
- SDL_Window *_sdl_window = NULL;
- SDL_GLContext _sdl_context = NULL;
-
- _sdl_window = SDL_CreateWindow("fred",
- 0, 0,
- sx, sy,
- SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
-
- SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight");
-
- int ax = 0, ay = 0;
- SDL_GetWindowSize(_sdl_window, &ax, &ay);
-
- printf("given: %d %d\n", ax, ay);
-
- return 0;
-}
diff --git a/3rdparty/sdl2-2.0.4/Xcode/SDL/SDL.xcodeproj/project.xcworkspace/xcshareddata/SDL.xcscmblueprint b/3rdparty/sdl2-2.0.4/Xcode/SDL/SDL.xcodeproj/project.xcworkspace/xcshareddata/SDL.xcscmblueprint
deleted file mode 100644
index 7666622cf3..0000000000
--- a/3rdparty/sdl2-2.0.4/Xcode/SDL/SDL.xcodeproj/project.xcworkspace/xcshareddata/SDL.xcscmblueprint
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "63C4897045D0EF88507AD257AEF500CB53038CE0",
- "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
-
- },
- "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
- "63C4897045D0EF88507AD257AEF500CB53038CE0" : 0,
- "EF0074ACEA8EBDF04F37E9286B575E78349A7203" : 0
- },
- "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "09B03A57-FF11-46EE-859C-BF71AAED9443",
- "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
- "63C4897045D0EF88507AD257AEF500CB53038CE0" : "moai-dev\/",
- "EF0074ACEA8EBDF04F37E9286B575E78349A7203" : ""
- },
- "DVTSourceControlWorkspaceBlueprintNameKey" : "SDL",
- "DVTSourceControlWorkspaceBlueprintVersion" : 204,
- "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "3rdparty\/sdl2-2.0.4\/Xcode\/SDL\/SDL.xcodeproj",
- "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
- {
- "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/fallguyconsulting\/moai-dev.git",
- "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
- "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "63C4897045D0EF88507AD257AEF500CB53038CE0"
- },
- {
- "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/moai\/future-proof.git",
- "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
- "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "EF0074ACEA8EBDF04F37E9286B575E78349A7203"
- }
- ]
-}
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/android-project/AndroidManifest.xml b/3rdparty/sdl2-2.0.4/android-project/AndroidManifest.xml
deleted file mode 100644
index 5dbb5486a7..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/AndroidManifest.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/android-project/ant.properties b/3rdparty/sdl2-2.0.4/android-project/ant.properties
deleted file mode 100644
index b0971e891e..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/ant.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/3rdparty/sdl2-2.0.4/android-project/build.properties b/3rdparty/sdl2-2.0.4/android-project/build.properties
deleted file mode 100644
index edc7f23050..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/3rdparty/sdl2-2.0.4/android-project/build.xml b/3rdparty/sdl2-2.0.4/android-project/build.xml
deleted file mode 100644
index 9f19a077b1..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/build.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/android-project/default.properties b/3rdparty/sdl2-2.0.4/android-project/default.properties
deleted file mode 100644
index 0cdab9561b..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/default.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-12
diff --git a/3rdparty/sdl2-2.0.4/android-project/jni/Application.mk b/3rdparty/sdl2-2.0.4/android-project/jni/Application.mk
deleted file mode 100644
index e5b50793b9..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/jni/Application.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# Uncomment this if you're using STL in your project
-# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
-# APP_STL := stlport_static
-
-APP_ABI := armeabi armeabi-v7a x86
diff --git a/3rdparty/sdl2-2.0.4/android-project/jni/src/Android_static.mk b/3rdparty/sdl2-2.0.4/android-project/jni/src/Android_static.mk
deleted file mode 100644
index faed669c0e..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/jni/src/Android_static.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := main
-
-LOCAL_SRC_FILES := YourSourceHere.c
-
-LOCAL_STATIC_LIBRARIES := SDL2_static
-
-include $(BUILD_SHARED_LIBRARY)
-$(call import-module,SDL)LOCAL_PATH := $(call my-dir)
diff --git a/3rdparty/sdl2-2.0.4/android-project/res/layout/main.xml b/3rdparty/sdl2-2.0.4/android-project/res/layout/main.xml
deleted file mode 100644
index 123c4b6eac..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/res/layout/main.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
diff --git a/3rdparty/sdl2-2.0.4/android-project/res/values/strings.xml b/3rdparty/sdl2-2.0.4/android-project/res/values/strings.xml
deleted file mode 100644
index 9bce51cb36..0000000000
--- a/3rdparty/sdl2-2.0.4/android-project/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- SDL App
-
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/androidbuild.sh b/3rdparty/sdl2-2.0.4/build-scripts/androidbuild.sh
deleted file mode 100755
index 8ca3c916da..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/androidbuild.sh
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/bin/bash
-
-SOURCES=()
-MKSOURCES=""
-CURDIR=`pwd -P`
-
-# Fetch sources
-if [[ $# -ge 2 ]]; then
- for src in ${@:2}
- do
- SOURCES+=($src)
- MKSOURCES="$MKSOURCES $(basename $src)"
- done
-else
- if [ -n "$1" ]; then
- while read src
- do
- SOURCES+=($src)
- MKSOURCES="$MKSOURCES $(basename $src)"
- done
- fi
-fi
-
-if [ -z "$1" ] || [ -z "$SOURCES" ]; then
- echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list"
- echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c"
- echo "To copy SDL source instead of symlinking: COPYSOURCE=1 androidbuild.sh ... "
- echo "You can pass additional arguments to ndk-build with the NDKARGS variable: NDKARGS=\"-s\" androidbuild.sh ..."
- exit 1
-fi
-
-
-
-SDLPATH="$( cd "$(dirname "$0")/.." ; pwd -P )"
-
-NDKBUILD=`which ndk-build`
-if [ -z "$NDKBUILD" ];then
- echo "Could not find the ndk-build utility, install Android's NDK and add it to the path"
- exit 1
-fi
-
-ANDROID=`which android`
-if [ -z "$ANDROID" ];then
- echo "Could not find the android utility, install Android's SDK and add it to the path"
- exit 1
-fi
-
-ANT=`which ant`
-
-if [ -z "$ANT" ];then
- echo "Could not find the ant utility, install Android's SDK and add it to the path"
- exit 1
-fi
-
-NCPUS="1"
-case "$OSTYPE" in
- darwin*)
- NCPU=`sysctl -n hw.ncpu`
- ;;
- linux*)
- if [ -n `which nproc` ]; then
- NCPUS=`nproc`
- fi
- ;;
- *);;
-esac
-
-APP="$1"
-APPARR=(${APP//./ })
-BUILDPATH="$SDLPATH/build/$APP"
-
-# Start Building
-
-rm -rf $BUILDPATH
-mkdir -p $BUILDPATH
-
-cp -r $SDLPATH/android-project/* $BUILDPATH
-
-# Copy SDL sources
-mkdir -p $BUILDPATH/jni/SDL
-if [ -z "$COPYSOURCE" ]; then
- ln -s $SDLPATH/src $BUILDPATH/jni/SDL
- ln -s $SDLPATH/include $BUILDPATH/jni/SDL
-else
- cp -r $SDLPATH/src $BUILDPATH/jni/SDL
- cp -r $SDLPATH/include $BUILDPATH/jni/SDL
-fi
-
-cp -r $SDLPATH/Android.mk $BUILDPATH/jni/SDL
-sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk
-sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml
-
-# Copy user sources
-for src in "${SOURCES[@]}"
-do
- cp $src $BUILDPATH/jni/src
-done
-
-# Create an inherited Activity
-cd $BUILDPATH/src
-for folder in "${APPARR[@]}"
-do
- mkdir -p $folder
- cd $folder
-done
-
-ACTIVITY="${folder}Activity"
-sed -i "s|SDLActivity|$ACTIVITY|g" $BUILDPATH/AndroidManifest.xml
-sed -i "s|SDLActivity|$APP|g" $BUILDPATH/build.xml
-
-# Fill in a default Activity
-echo "package $APP;" > "$ACTIVITY.java"
-echo "import org.libsdl.app.SDLActivity;" >> "$ACTIVITY.java"
-echo "public class $ACTIVITY extends SDLActivity {}" >> "$ACTIVITY.java"
-
-# Update project and build
-cd $BUILDPATH
-$ANDROID update project --path $BUILDPATH
-$NDKBUILD -j $NCPUS $NDKARGS
-$ANT debug
-
-cd $CURDIR
-
-APK="$BUILDPATH/bin/$APP-debug.apk"
-
-if [ -f "$APK" ]; then
- echo "Your APK is ready at $APK"
- echo "To install to your device: "
- echo "cd $BUILDPATH"
- echo "ant debug install"
- exit 0
-fi
-
-echo "There was an error building the APK"
-exit 1
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/install-sh b/3rdparty/sdl2-2.0.4/build-scripts/install-sh
deleted file mode 100755
index 1a8353401c..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/install-sh
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2005-02-02.21
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-chmodcmd="$chmodprog 0755"
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test -n "$1"; do
- case $1 in
- -c) shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
- shift
- shift
- continue;;
-
- -T) no_target_directory=true
- shift
- continue;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- *) # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- test -n "$dir_arg$dstarg" && break
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
- break;;
- esac
-done
-
-if test -z "$1"; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src ;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- src=
-
- if test -d "$dst"; then
- mkdircmd=:
- chmodcmd=
- else
- mkdircmd=$mkdirprog
- fi
- else
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dstarg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dstarg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
- exit 1
- fi
- dst=$dst/`basename "$src"`
- fi
- fi
-
- # This sed command emulates the dirname command.
- dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-
- # Make sure that the destination directory exists.
-
- # Skip lots of stat calls in the usual case.
- if test ! -d "$dstdir"; then
- defaultIFS='
- '
- IFS="${IFS-$defaultIFS}"
-
- oIFS=$IFS
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
- shift
- IFS=$oIFS
-
- pathcomp=
-
- while test $# -ne 0 ; do
- pathcomp=$pathcomp$1
- shift
- if test ! -d "$pathcomp"; then
- $mkdirprog "$pathcomp"
- # mkdir can fail with a `File exist' error in case several
- # install-sh are creating the directory concurrently. This
- # is OK.
- test -d "$pathcomp" || exit
- fi
- pathcomp=$pathcomp/
- done
- fi
-
- if test -n "$dir_arg"; then
- $doit $mkdircmd "$dst" \
- && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
- else
- dstfile=`basename "$dst"`
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
- trap '(exit $?); exit' 1 2 13 15
-
- # Copy the file name to the temp name.
- $doit $cpprog "$src" "$dsttmp" &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dstdir/$dstfile"; then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
- || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
- || {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
- }
- }
- fi || { (exit 1); exit 1; }
-done
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
- (exit 0); exit 0
-}
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/iosbuild.sh b/3rdparty/sdl2-2.0.4/build-scripts/iosbuild.sh
deleted file mode 100755
index eeb5716244..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/iosbuild.sh
+++ /dev/null
@@ -1,277 +0,0 @@
-#!/bin/sh
-#
-# Build a fat binary for iOS
-# Based on fatbuild.sh and code from the Ignifuga Game Engine
-
-# Number of CPUs (for make -j)
-NCPU=`sysctl -n hw.ncpu`
-if test x$NJOB = x; then
- NJOB=$NCPU
-fi
-
-# SDK path
-XCODE_PATH=`xcode-select --print-path`
-if [ -z "$XCODE_PATH" ]; then
- echo "Could not find XCode location (use xcode-select -switch to set the correct path)"
- exit 1
-fi
-
-prepare_environment() {
- ARCH=$1
-
- if test x$SDK_VERSION = x; then
- export SDK_VERSION=`xcodebuild -showsdks | grep iphoneos | sed "s|.*iphoneos||"`
- if [ -z "$XCODE_PATH" ]; then
- echo "Could not find a valid iOS SDK"
- exit 1
- fi
- fi
-
- case $ARCH in
- armv6)
- DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer"
- SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
- ;;
- armv7)
- DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer"
- SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
- ;;
- i386)
- DEV_PATH="$XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer"
- SDK_PATH="$DEV_PATH/SDKs/iPhoneSimulator$SDK_VERSION.sdk"
- ;;
- *)
- echo "Unknown Architecture $ARCH"
- exit 1
- ;;
- esac
-
- if [ ! -d "$SDK_PATH" ]; then
- echo "Could not find iOS SDK at $SDK_PATH"
- exit 1
- fi
-
- if test x$MIN_OS_VERSION = x; then
- export MIN_OS_VERSION="3.0"
- fi
-
- # Environment flags
- CFLAGS="-g -O2 -pipe -no-cpp-precomp -isysroot $SDK_PATH \
- -miphoneos-version-min=$MIN_OS_VERSION -I$SDK_PATH/usr/include/"
- LDFLAGS="-L$SDK_PATH/usr/lib/ -isysroot $SDK_PATH \
- -miphoneos-version-min=$MIN_OS_VERSION -static-libgcc"
- export CXXFLAGS="$CFLAGS"
- export CXXCPP="$DEV_PATH/usr/bin/llvm-cpp-4.2"
- export CPP="$CXXCPP"
- export CXX="$DEV_PATH/usr/bin/llvm-g++-4.2"
- export CC="$DEV_PATH/usr/bin/llvm-gcc-4.2"
- export LD="$DEV_PATH/usr/bin/ld"
- export AR="$DEV_PATH/usr/bin/ar"
- export AS="$DEV_PATH/usr/bin/ls"
- export NM="$DEV_PATH/usr/bin/nm"
- export RANLIB="$DEV_PATH/usr/bin/ranlib"
- export STRIP="$DEV_PATH/usr/bin/strip"
-
- # We dynamically load X11, so using the system X11 headers is fine.
- CONFIG_FLAGS="--disable-shared --enable-static"
-
- case $ARCH in
- armv6)
- export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv6-apple-darwin"
- export CFLAGS="$CFLAGS -arch armv6"
- export LDFLAGS="$LDFLAGS -arch armv6"
- ;;
- armv7)
- export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv7-apple-darwin"
- export CFLAGS="$CFLAGS -arch armv7"
- export LDFLAGS="$LDFLAGS -arch armv7"
- ;;
- i386)
- export CONFIG_FLAGS="$CONFIG_FLAGS --host=i386-apple-darwin"
- export CFLAGS="$CFLAGS -arch i386"
- export LDFLAGS="$LDFLAGS -arch i386"
- ;;
- *)
- echo "Unknown Architecture $ARCH"
- exit 1
- ;;
- esac
-}
-
-prepare_environment "armv6"
-echo "Building with iOS SDK v$SDK_VERSION for iOS >= $MIN_OS_VERSION"
-
-#
-# Find the configure script
-#
-srcdir=`dirname $0`/..
-srcdir=`cd $srcdir && pwd`
-auxdir=$srcdir/build-scripts
-cd $srcdir
-
-#
-# Figure out which phase to build:
-# all,
-# configure, configure-armv6, configure-armv7, configure-i386
-# make, make-armv6, make-armv7, make-i386, merge
-# clean
-if test x"$1" = x; then
- phase=all
-else
- phase="$1"
-fi
-case $phase in
- all)
- configure_armv6="yes"
- configure_armv7="yes"
- configure_i386="yes"
- make_armv6="yes"
- make_armv7="yes"
- make_i386="yes"
- merge="yes"
- ;;
- configure)
- configure_armv6="yes"
- configure_armv7="yes"
- configure_i386="yes"
- ;;
- configure-armv6)
- configure_armv6="yes"
- ;;
- configure-armv7)
- configure_armv7="yes"
- ;;
- configure-i386)
- configure_i386="yes"
- ;;
- make)
- make_armv6="yes"
- make_armv7="yes"
- make_i386="yes"
- merge="yes"
- ;;
- make-armv6)
- make_armv6="yes"
- ;;
- make-armv7)
- make_armv7="yes"
- ;;
- make-i386)
- make_i386="yes"
- ;;
- merge)
- merge="yes"
- ;;
- clean)
- clean_armv6="yes"
- clean_armv7="yes"
- clean_i386="yes"
- ;;
- clean-armv6)
- clean_armv6="yes"
- ;;
- clean-armv7)
- clean_armv7="yes"
- ;;
- clean-i386)
- clean_i386="yes"
- ;;
- *)
- echo "Usage: $0 [all|configure[-armv6|-armv7|-i386]|make[-armv6|-armv7|-i386]|merge|clean[-armv6|-armv7|-i386]]"
- exit 1
- ;;
-esac
-
-#
-# Create the build directories
-#
-for dir in build build/armv6 build/armv7 build/i386; do
- if test -d $dir; then
- :
- else
- mkdir $dir || exit 1
- fi
-done
-
-#
-# Build the armv6 binary
-#
-prepare_environment "armv6"
-if test x$configure_armv6 = xyes; then
- (cd build/armv6 && \
- sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
- # configure is not yet fully ready for iOS, some manual patching is required
- cp include/* build/armv6/include
- cp include/SDL_config_iphoneos.h build/armv6/include/SDL_config.h || exit 2
- sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv6/Makefile || exit 2
- sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv6/Makefile || exit 2
-fi
-if test x$make_armv6 = xyes; then
- (cd build/armv6 && make -j$NJOB) || exit 3
-fi
-#
-# Build the armv7 binary
-#
-prepare_environment "armv7"
-if test x$configure_armv7 = xyes; then
- (cd build/armv7 && \
- sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
- # configure is not yet fully ready for iOS, some manual patching is required
- cp include/* build/armv7/include
- cp include/SDL_config_iphoneos.h build/armv7/include/SDL_config.h || exit 2
- sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv7/Makefile || exit 2
- sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv7/Makefile || exit 2
-fi
-if test x$make_armv7 = xyes; then
- (cd build/armv7 && make -j$NJOB) || exit 3
-fi
-#
-# Build the i386 binary
-#
-prepare_environment "i386"
-if test x$configure_i386 = xyes; then
- (cd build/i386 && \
- sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
- # configure is not yet fully ready for iOS, some manual patching is required
- cp include/* build/i386/include
- cp include/SDL_config_iphoneos.h build/i386/include/SDL_config.h || exit 2
- sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/i386/Makefile || exit 2
- sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/i386/Makefile || exit 2
-fi
-if test x$make_i386 = xyes; then
- (cd build/i386 && make -j$NJOB) || exit 3
-fi
-
-#
-# Combine into fat binary
-#
-if test x$merge = xyes; then
- output=ios/lib
- sh $auxdir/mkinstalldirs build/$output
- cd build
- target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
- (lipo -create -o $output/libSDL2.a armv6/build/.libs/libSDL2.a armv7/build/.libs/libSDL2.a i386/build/.libs/libSDL2.a &&
- lipo -create -o $output/libSDL2main.a armv6/build/libSDL2main.a armv7/build/libSDL2main.a i386/build/libSDL2main.a &&
- cp -r armv6/include ios
- echo "Build complete!" &&
- echo "Files can be found under the build/ios directory.") || exit 4
- cd ..
-fi
-
-#
-# Clean up
-#
-do_clean()
-{
- echo $*
- $* || exit 6
-}
-if test x$clean_armv6 = xyes; then
- do_clean rm -r build/armv6
-fi
-if test x$clean_armv7 = xyes; then
- do_clean rm -r build/armv7
-fi
-if test x$clean_i386 = xyes; then
- do_clean rm -r build/i386
-fi
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/mkinstalldirs b/3rdparty/sdl2-2.0.4/build-scripts/mkinstalldirs
deleted file mode 100755
index 8ab885ec92..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/mkinstalldirs
+++ /dev/null
@@ -1,99 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* ) # -h for help
- echo "${usage}" 1>&2; exit 0 ;;
- -m ) # -m PERM arg
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- dirmode="${1}"
- shift ;;
- -- ) shift; break ;; # stop option processing
- -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
- * ) break ;; # first non-opt arg
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
-0) exit 0 ;;
-esac
-
-case $dirmode in
-'')
- if mkdir -p -- . 2>/dev/null; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- fi ;;
-*)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- fi ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
-
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 3
-# End:
-# mkinstalldirs ends here
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/showrev.sh b/3rdparty/sdl2-2.0.4/build-scripts/showrev.sh
deleted file mode 100755
index 2a68fe694e..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/showrev.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-#
-# Print the current source revision, if available
-
-# FIXME: this prints the tip, which isn't useful if you're on a different
-# branch, or just not sync'd to the tip.
-hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
diff --git a/3rdparty/sdl2-2.0.4/build-scripts/update-copyright.sh b/3rdparty/sdl2-2.0.4/build-scripts/update-copyright.sh
deleted file mode 100755
index 34864bc91c..0000000000
--- a/3rdparty/sdl2-2.0.4/build-scripts/update-copyright.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-find . -type f -exec grep -Il "Copyright" {} \; \
-| grep -v \.hg \
-| while read i; \
-do \
- LC_ALL=C sed -ie "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$i"; \
- rm "${i}e"; \
-done
diff --git a/3rdparty/sdl2-2.0.4/include-moai/SDL_config_windows.h b/3rdparty/sdl2-2.0.4/include-moai/SDL_config_windows.h
deleted file mode 100644
index 58921c5fdc..0000000000
--- a/3rdparty/sdl2-2.0.4/include-moai/SDL_config_windows.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_windows_h
-#define _SDL_config_windows_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
-#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H 1
-#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#ifndef _UINTPTR_T_DEFINED
-#ifdef _WIN64
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
-#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
-
-#ifdef _WIN64
-# define SIZEOF_VOIDP 8
-#else
-# define SIZEOF_VOIDP 4
-#endif
-
-#define HAVE_DDRAW_H 1
-#define HAVE_DINPUT_H 1
-#define HAVE_DSOUND_H 1
-#define HAVE_DXGI_H 1
-#define HAVE_XINPUT_H 1
-
-/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
-#ifdef HAVE_LIBC
-/* Useful headers */
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE__STRREV 1
-#define HAVE__STRUPR 1
-#define HAVE__STRLWR 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE__LTOA 1
-#define HAVE__ULTOA 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__STRICMP 1
-#define HAVE__STRNICMP 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_ACOS 1
-#define HAVE_ASIN 1
-#define HAVE_CEIL 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_POW 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SQRTF 1
-#define HAVE_TAN 1
-#define HAVE_TANF 1
-#if _MSC_VER >= 1800
-#define HAVE_STRTOLL 1
-#define HAVE_VSSCANF 1
-#define HAVE_COPYSIGN 1
-#define HAVE_SCALBN 1
-#endif
-#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
-#endif
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_DSOUND 0
-#define SDL_AUDIO_DRIVER_XAUDIO2 0
-#define SDL_AUDIO_DRIVER_WINMM 0
-#define SDL_AUDIO_DRIVER_DISK 0
-#define SDL_AUDIO_DRIVER_DUMMY 0
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_DINPUT 1
-#define SDL_JOYSTICK_XINPUT 0
-#define SDL_HAPTIC_DINPUT 1
-#define SDL_HAPTIC_XINPUT 0
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_WINDOWS 0
-
-/* Enable various threading systems */
-#define SDL_THREAD_WINDOWS 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_WINDOWS 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY 0
-#define SDL_VIDEO_DRIVER_WINDOWS 1
-
-#ifndef SDL_VIDEO_RENDER_D3D
-#define SDL_VIDEO_RENDER_D3D 1
-#endif
-#ifndef SDL_VIDEO_RENDER_D3D11
-#define SDL_VIDEO_RENDER_D3D11 0
-#endif
-
-/* Enable OpenGL support */
-#ifndef SDL_VIDEO_OPENGL
-#define SDL_VIDEO_OPENGL 1
-#endif
-#ifndef SDL_VIDEO_OPENGL_WGL
-#define SDL_VIDEO_OPENGL_WGL 1
-#endif
-#ifndef SDL_VIDEO_RENDER_OGL
-#define SDL_VIDEO_RENDER_OGL 1
-#endif
-#ifndef SDL_VIDEO_RENDER_OGL_ES2
-#define SDL_VIDEO_RENDER_OGL_ES2 1
-#endif
-#ifndef SDL_VIDEO_OPENGL_ES2
-#define SDL_VIDEO_OPENGL_ES2 1
-#endif
-#ifndef SDL_VIDEO_OPENGL_EGL
-#define SDL_VIDEO_OPENGL_EGL 1
-#endif
-
-
-/* Enable system power support */
-#define SDL_POWER_WINDOWS 1
-
-/* Enable filesystem support */
-#define SDL_FILESYSTEM_WINDOWS 1
-
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES 1
-#endif
-
-#endif /* _SDL_config_windows_h */
diff --git a/3rdparty/sdl2-2.0.4/include/SDL_blendmode.h b/3rdparty/sdl2-2.0.4/include/SDL_blendmode.h
deleted file mode 100644
index 56d8ad66ef..0000000000
--- a/3rdparty/sdl2-2.0.4/include/SDL_blendmode.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- * \file SDL_blendmode.h
- *
- * Header file declaring the SDL_BlendMode enumeration
- */
-
-#ifndef _SDL_blendmode_h
-#define _SDL_blendmode_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief The blend mode used in SDL_RenderCopy() and drawing operations.
- */
-typedef enum
-{
- SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
- dstRGBA = srcRGBA */
- SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
- dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
- dstA = srcA + (dstA * (1-srcA)) */
- SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
- dstRGB = (srcRGB * srcA) + dstRGB
- dstA = dstA */
- SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate
- dstRGB = srcRGB * dstRGB
- dstA = dstA */
-} SDL_BlendMode;
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_blendmode_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/include/SDL_revision.h b/3rdparty/sdl2-2.0.4/include/SDL_revision.h
deleted file mode 100644
index 6d7163d4d4..0000000000
--- a/3rdparty/sdl2-2.0.4/include/SDL_revision.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define SDL_REVISION "hg-10001:e12c38730512"
-#define SDL_REVISION_NUMBER 10001
diff --git a/3rdparty/sdl2-2.0.4/src/audio/SDL_audio_c.h b/3rdparty/sdl2-2.0.4/src/audio/SDL_audio_c.h
deleted file mode 100644
index b03a9156f6..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/SDL_audio_c.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
-
-/* Functions to get a list of "close" audio formats */
-extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
-extern SDL_AudioFormat SDL_NextAudioFormat(void);
-
-/* Function to calculate the size and silence for a SDL_AudioSpec */
-extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
-
-/* The actual mixing thread function */
-extern int SDLCALL SDL_RunAudio(void *audiop);
-
-/* this is used internally to access some autogenerated code. */
-typedef struct
-{
- SDL_AudioFormat src_fmt;
- SDL_AudioFormat dst_fmt;
- SDL_AudioFilter filter;
-} SDL_AudioTypeFilters;
-extern const SDL_AudioTypeFilters sdl_audio_type_filters[];
-
-/* this is used internally to access some autogenerated code. */
-typedef struct
-{
- SDL_AudioFormat fmt;
- int channels;
- int upsample;
- int multiple;
- SDL_AudioFilter filter;
-} SDL_AudioRateFilters;
-extern const SDL_AudioRateFilters sdl_audio_rate_filters[];
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/SDL_audiocvt.c b/3rdparty/sdl2-2.0.4/src/audio/SDL_audiocvt.c
deleted file mode 100644
index 3b47c4cbcc..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/SDL_audiocvt.c
+++ /dev/null
@@ -1,1121 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* Functions for audio drivers to perform runtime conversion of audio format */
-
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#include "SDL_assert.h"
-
-/* #define DEBUG_CONVERT */
-
-/* Effectively mix right and left channels into a single channel */
-static void SDLCALL
-SDL_ConvertMono(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- Sint32 sample;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to mono\n");
-#endif
- switch (format & (SDL_AUDIO_MASK_SIGNED |
- SDL_AUDIO_MASK_BITSIZE |
- SDL_AUDIO_MASK_DATATYPE)) {
- case AUDIO_U8:
- {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- for (i = cvt->len_cvt / 2; i; --i) {
- sample = src[0] + src[1];
- *dst = (Uint8) (sample / 2);
- src += 2;
- dst += 1;
- }
- }
- break;
-
- case AUDIO_S8:
- {
- Sint8 *src, *dst;
-
- src = (Sint8 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / 2; i; --i) {
- sample = src[0] + src[1];
- *dst = (Sint8) (sample / 2);
- src += 2;
- dst += 1;
- }
- }
- break;
-
- case AUDIO_U16:
- {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- sample = (Uint16) ((src[0] << 8) | src[1]) +
- (Uint16) ((src[2] << 8) | src[3]);
- sample /= 2;
- dst[1] = (sample & 0xFF);
- sample >>= 8;
- dst[0] = (sample & 0xFF);
- src += 4;
- dst += 2;
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- sample = (Uint16) ((src[1] << 8) | src[0]) +
- (Uint16) ((src[3] << 8) | src[2]);
- sample /= 2;
- dst[0] = (sample & 0xFF);
- sample >>= 8;
- dst[1] = (sample & 0xFF);
- src += 4;
- dst += 2;
- }
- }
- }
- break;
-
- case AUDIO_S16:
- {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- sample = (Sint16) ((src[0] << 8) | src[1]) +
- (Sint16) ((src[2] << 8) | src[3]);
- sample /= 2;
- dst[1] = (sample & 0xFF);
- sample >>= 8;
- dst[0] = (sample & 0xFF);
- src += 4;
- dst += 2;
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- sample = (Sint16) ((src[1] << 8) | src[0]) +
- (Sint16) ((src[3] << 8) | src[2]);
- sample /= 2;
- dst[0] = (sample & 0xFF);
- sample >>= 8;
- dst[1] = (sample & 0xFF);
- src += 4;
- dst += 2;
- }
- }
- }
- break;
-
- case AUDIO_S32:
- {
- const Uint32 *src = (const Uint32 *) cvt->buf;
- Uint32 *dst = (Uint32 *) cvt->buf;
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i, src += 2) {
- const Sint64 added =
- (((Sint64) (Sint32) SDL_SwapBE32(src[0])) +
- ((Sint64) (Sint32) SDL_SwapBE32(src[1])));
- *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added / 2)));
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i, src += 2) {
- const Sint64 added =
- (((Sint64) (Sint32) SDL_SwapLE32(src[0])) +
- ((Sint64) (Sint32) SDL_SwapLE32(src[1])));
- *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added / 2)));
- }
- }
- }
- break;
-
- case AUDIO_F32:
- {
- const float *src = (const float *) cvt->buf;
- float *dst = (float *) cvt->buf;
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i, src += 2) {
- const float src1 = SDL_SwapFloatBE(src[0]);
- const float src2 = SDL_SwapFloatBE(src[1]);
- const double added = ((double) src1) + ((double) src2);
- const float halved = (float) (added * 0.5);
- *(dst++) = SDL_SwapFloatBE(halved);
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i, src += 2) {
- const float src1 = SDL_SwapFloatLE(src[0]);
- const float src2 = SDL_SwapFloatLE(src[1]);
- const double added = ((double) src1) + ((double) src2);
- const float halved = (float) (added * 0.5);
- *(dst++) = SDL_SwapFloatLE(halved);
- }
- }
- }
- break;
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-/* Discard top 4 channels */
-static void SDLCALL
-SDL_ConvertStrip(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting down from 6 channels to stereo\n");
-#endif
-
-#define strip_chans_6_to_2(type) \
- { \
- const type *src = (const type *) cvt->buf; \
- type *dst = (type *) cvt->buf; \
- for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \
- dst[0] = src[0]; \
- dst[1] = src[1]; \
- src += 6; \
- dst += 2; \
- } \
- }
-
- /* this function only cares about typesize, and data as a block of bits. */
- switch (SDL_AUDIO_BITSIZE(format)) {
- case 8:
- strip_chans_6_to_2(Uint8);
- break;
- case 16:
- strip_chans_6_to_2(Uint16);
- break;
- case 32:
- strip_chans_6_to_2(Uint32);
- break;
- }
-
-#undef strip_chans_6_to_2
-
- cvt->len_cvt /= 3;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-/* Discard top 2 channels of 6 */
-static void SDLCALL
-SDL_ConvertStrip_2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting 6 down to quad\n");
-#endif
-
-#define strip_chans_6_to_4(type) \
- { \
- const type *src = (const type *) cvt->buf; \
- type *dst = (type *) cvt->buf; \
- for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \
- dst[0] = src[0]; \
- dst[1] = src[1]; \
- dst[2] = src[2]; \
- dst[3] = src[3]; \
- src += 6; \
- dst += 4; \
- } \
- }
-
- /* this function only cares about typesize, and data as a block of bits. */
- switch (SDL_AUDIO_BITSIZE(format)) {
- case 8:
- strip_chans_6_to_4(Uint8);
- break;
- case 16:
- strip_chans_6_to_4(Uint16);
- break;
- case 32:
- strip_chans_6_to_4(Uint32);
- break;
- }
-
-#undef strip_chans_6_to_4
-
- cvt->len_cvt /= 6;
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-/* Duplicate a mono channel to both stereo channels */
-static void SDLCALL
-SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to stereo\n");
-#endif
-
-#define dup_chans_1_to_2(type) \
- { \
- const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
- type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
- for (i = cvt->len_cvt / sizeof(type); i; --i) { \
- src -= 1; \
- dst -= 2; \
- dst[0] = dst[1] = *src; \
- } \
- }
-
- /* this function only cares about typesize, and data as a block of bits. */
- switch (SDL_AUDIO_BITSIZE(format)) {
- case 8:
- dup_chans_1_to_2(Uint8);
- break;
- case 16:
- dup_chans_1_to_2(Uint16);
- break;
- case 32:
- dup_chans_1_to_2(Uint32);
- break;
- }
-
-#undef dup_chans_1_to_2
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-5.1 stream */
-static void SDLCALL
-SDL_ConvertSurround(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting stereo to surround\n");
-#endif
-
- switch (format & (SDL_AUDIO_MASK_SIGNED |
- SDL_AUDIO_MASK_BITSIZE |
- SDL_AUDIO_MASK_DATATYPE)) {
- case AUDIO_U8:
- {
- Uint8 *src, *dst, lf, rf, ce;
-
- src = (Uint8 *) (cvt->buf + cvt->len_cvt);
- dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 3);
- for (i = cvt->len_cvt; i; --i) {
- dst -= 6;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf / 2) + (rf / 2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- dst[4] = ce;
- dst[5] = ce;
- }
- }
- break;
-
- case AUDIO_S8:
- {
- Sint8 *src, *dst, lf, rf, ce;
-
- src = (Sint8 *) cvt->buf + cvt->len_cvt;
- dst = (Sint8 *) cvt->buf + cvt->len_cvt * 3;
- for (i = cvt->len_cvt; i; --i) {
- dst -= 6;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf / 2) + (rf / 2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- dst[4] = ce;
- dst[5] = ce;
- }
- }
- break;
-
- case AUDIO_U16:
- {
- Uint8 *src, *dst;
- Uint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf + cvt->len_cvt;
- dst = cvt->buf + cvt->len_cvt * 3;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 12;
- src -= 4;
- lf = (Uint16) ((src[0] << 8) | src[1]);
- rf = (Uint16) ((src[2] << 8) | src[3]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf & 0xFF);
- dst[0] = ((lf >> 8) & 0xFF);
- dst[3] = (rf & 0xFF);
- dst[2] = ((rf >> 8) & 0xFF);
-
- dst[1 + 4] = (lr & 0xFF);
- dst[0 + 4] = ((lr >> 8) & 0xFF);
- dst[3 + 4] = (rr & 0xFF);
- dst[2 + 4] = ((rr >> 8) & 0xFF);
-
- dst[1 + 8] = (ce & 0xFF);
- dst[0 + 8] = ((ce >> 8) & 0xFF);
- dst[3 + 8] = (ce & 0xFF);
- dst[2 + 8] = ((ce >> 8) & 0xFF);
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 12;
- src -= 4;
- lf = (Uint16) ((src[1] << 8) | src[0]);
- rf = (Uint16) ((src[3] << 8) | src[2]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf & 0xFF);
- dst[1] = ((lf >> 8) & 0xFF);
- dst[2] = (rf & 0xFF);
- dst[3] = ((rf >> 8) & 0xFF);
-
- dst[0 + 4] = (lr & 0xFF);
- dst[1 + 4] = ((lr >> 8) & 0xFF);
- dst[2 + 4] = (rr & 0xFF);
- dst[3 + 4] = ((rr >> 8) & 0xFF);
-
- dst[0 + 8] = (ce & 0xFF);
- dst[1 + 8] = ((ce >> 8) & 0xFF);
- dst[2 + 8] = (ce & 0xFF);
- dst[3 + 8] = ((ce >> 8) & 0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S16:
- {
- Uint8 *src, *dst;
- Sint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf + cvt->len_cvt;
- dst = cvt->buf + cvt->len_cvt * 3;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 12;
- src -= 4;
- lf = (Sint16) ((src[0] << 8) | src[1]);
- rf = (Sint16) ((src[2] << 8) | src[3]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf & 0xFF);
- dst[0] = ((lf >> 8) & 0xFF);
- dst[3] = (rf & 0xFF);
- dst[2] = ((rf >> 8) & 0xFF);
-
- dst[1 + 4] = (lr & 0xFF);
- dst[0 + 4] = ((lr >> 8) & 0xFF);
- dst[3 + 4] = (rr & 0xFF);
- dst[2 + 4] = ((rr >> 8) & 0xFF);
-
- dst[1 + 8] = (ce & 0xFF);
- dst[0 + 8] = ((ce >> 8) & 0xFF);
- dst[3 + 8] = (ce & 0xFF);
- dst[2 + 8] = ((ce >> 8) & 0xFF);
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 12;
- src -= 4;
- lf = (Sint16) ((src[1] << 8) | src[0]);
- rf = (Sint16) ((src[3] << 8) | src[2]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf & 0xFF);
- dst[1] = ((lf >> 8) & 0xFF);
- dst[2] = (rf & 0xFF);
- dst[3] = ((rf >> 8) & 0xFF);
-
- dst[0 + 4] = (lr & 0xFF);
- dst[1 + 4] = ((lr >> 8) & 0xFF);
- dst[2 + 4] = (rr & 0xFF);
- dst[3 + 4] = ((rr >> 8) & 0xFF);
-
- dst[0 + 8] = (ce & 0xFF);
- dst[1 + 8] = ((ce >> 8) & 0xFF);
- dst[2 + 8] = (ce & 0xFF);
- dst[3 + 8] = ((ce >> 8) & 0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S32:
- {
- Sint32 lf, rf, ce;
- const Uint32 *src = (const Uint32 *) (cvt->buf + cvt->len_cvt);
- Uint32 *dst = (Uint32 *) (cvt->buf + cvt->len_cvt * 3);
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 6;
- src -= 2;
- lf = (Sint32) SDL_SwapBE32(src[0]);
- rf = (Sint32) SDL_SwapBE32(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = SDL_SwapBE32((Uint32) lf);
- dst[1] = SDL_SwapBE32((Uint32) rf);
- dst[2] = SDL_SwapBE32((Uint32) (lf - ce));
- dst[3] = SDL_SwapBE32((Uint32) (rf - ce));
- dst[4] = SDL_SwapBE32((Uint32) ce);
- dst[5] = SDL_SwapBE32((Uint32) ce);
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 6;
- src -= 2;
- lf = (Sint32) SDL_SwapLE32(src[0]);
- rf = (Sint32) SDL_SwapLE32(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapLE32((Uint32) (lf - ce));
- dst[3] = SDL_SwapLE32((Uint32) (rf - ce));
- dst[4] = SDL_SwapLE32((Uint32) ce);
- dst[5] = SDL_SwapLE32((Uint32) ce);
- }
- }
- }
- break;
-
- case AUDIO_F32:
- {
- float lf, rf, ce;
- const float *src = (const float *) (cvt->buf + cvt->len_cvt);
- float *dst = (float *) (cvt->buf + cvt->len_cvt * 3);
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 6;
- src -= 2;
- lf = SDL_SwapFloatBE(src[0]);
- rf = SDL_SwapFloatBE(src[1]);
- ce = (lf * 0.5f) + (rf * 0.5f);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapFloatBE(lf - ce);
- dst[3] = SDL_SwapFloatBE(rf - ce);
- dst[4] = dst[5] = SDL_SwapFloatBE(ce);
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 6;
- src -= 2;
- lf = SDL_SwapFloatLE(src[0]);
- rf = SDL_SwapFloatLE(src[1]);
- ce = (lf * 0.5f) + (rf * 0.5f);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapFloatLE(lf - ce);
- dst[3] = SDL_SwapFloatLE(rf - ce);
- dst[4] = dst[5] = SDL_SwapFloatLE(ce);
- }
- }
- }
- break;
-
- }
- cvt->len_cvt *= 3;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-4.0 stream */
-static void SDLCALL
-SDL_ConvertSurround_4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting stereo to quad\n");
-#endif
-
- switch (format & (SDL_AUDIO_MASK_SIGNED |
- SDL_AUDIO_MASK_BITSIZE |
- SDL_AUDIO_MASK_DATATYPE)) {
- case AUDIO_U8:
- {
- Uint8 *src, *dst, lf, rf, ce;
-
- src = (Uint8 *) (cvt->buf + cvt->len_cvt);
- dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 2);
- for (i = cvt->len_cvt; i; --i) {
- dst -= 4;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf / 2) + (rf / 2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- }
- }
- break;
-
- case AUDIO_S8:
- {
- Sint8 *src, *dst, lf, rf, ce;
-
- src = (Sint8 *) cvt->buf + cvt->len_cvt;
- dst = (Sint8 *) cvt->buf + cvt->len_cvt * 2;
- for (i = cvt->len_cvt; i; --i) {
- dst -= 4;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf / 2) + (rf / 2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- }
- }
- break;
-
- case AUDIO_U16:
- {
- Uint8 *src, *dst;
- Uint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf + cvt->len_cvt;
- dst = cvt->buf + cvt->len_cvt * 2;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 8;
- src -= 4;
- lf = (Uint16) ((src[0] << 8) | src[1]);
- rf = (Uint16) ((src[2] << 8) | src[3]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf & 0xFF);
- dst[0] = ((lf >> 8) & 0xFF);
- dst[3] = (rf & 0xFF);
- dst[2] = ((rf >> 8) & 0xFF);
-
- dst[1 + 4] = (lr & 0xFF);
- dst[0 + 4] = ((lr >> 8) & 0xFF);
- dst[3 + 4] = (rr & 0xFF);
- dst[2 + 4] = ((rr >> 8) & 0xFF);
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 8;
- src -= 4;
- lf = (Uint16) ((src[1] << 8) | src[0]);
- rf = (Uint16) ((src[3] << 8) | src[2]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf & 0xFF);
- dst[1] = ((lf >> 8) & 0xFF);
- dst[2] = (rf & 0xFF);
- dst[3] = ((rf >> 8) & 0xFF);
-
- dst[0 + 4] = (lr & 0xFF);
- dst[1 + 4] = ((lr >> 8) & 0xFF);
- dst[2 + 4] = (rr & 0xFF);
- dst[3 + 4] = ((rr >> 8) & 0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S16:
- {
- Uint8 *src, *dst;
- Sint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf + cvt->len_cvt;
- dst = cvt->buf + cvt->len_cvt * 2;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 8;
- src -= 4;
- lf = (Sint16) ((src[0] << 8) | src[1]);
- rf = (Sint16) ((src[2] << 8) | src[3]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf & 0xFF);
- dst[0] = ((lf >> 8) & 0xFF);
- dst[3] = (rf & 0xFF);
- dst[2] = ((rf >> 8) & 0xFF);
-
- dst[1 + 4] = (lr & 0xFF);
- dst[0 + 4] = ((lr >> 8) & 0xFF);
- dst[3 + 4] = (rr & 0xFF);
- dst[2 + 4] = ((rr >> 8) & 0xFF);
- }
- } else {
- for (i = cvt->len_cvt / 4; i; --i) {
- dst -= 8;
- src -= 4;
- lf = (Sint16) ((src[1] << 8) | src[0]);
- rf = (Sint16) ((src[3] << 8) | src[2]);
- ce = (lf / 2) + (rf / 2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf & 0xFF);
- dst[1] = ((lf >> 8) & 0xFF);
- dst[2] = (rf & 0xFF);
- dst[3] = ((rf >> 8) & 0xFF);
-
- dst[0 + 4] = (lr & 0xFF);
- dst[1 + 4] = ((lr >> 8) & 0xFF);
- dst[2 + 4] = (rr & 0xFF);
- dst[3 + 4] = ((rr >> 8) & 0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S32:
- {
- const Uint32 *src = (const Uint32 *) (cvt->buf + cvt->len_cvt);
- Uint32 *dst = (Uint32 *) (cvt->buf + cvt->len_cvt * 2);
- Sint32 lf, rf, ce;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 4;
- src -= 2;
- lf = (Sint32) SDL_SwapBE32(src[0]);
- rf = (Sint32) SDL_SwapBE32(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapBE32((Uint32) (lf - ce));
- dst[3] = SDL_SwapBE32((Uint32) (rf - ce));
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 4;
- src -= 2;
- lf = (Sint32) SDL_SwapLE32(src[0]);
- rf = (Sint32) SDL_SwapLE32(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapLE32((Uint32) (lf - ce));
- dst[3] = SDL_SwapLE32((Uint32) (rf - ce));
- }
- }
- }
- break;
-
- case AUDIO_F32:
- {
- const float *src = (const float *) (cvt->buf + cvt->len_cvt);
- float *dst = (float *) (cvt->buf + cvt->len_cvt * 2);
- float lf, rf, ce;
-
- if (SDL_AUDIO_ISBIGENDIAN(format)) {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 4;
- src -= 2;
- lf = SDL_SwapFloatBE(src[0]);
- rf = SDL_SwapFloatBE(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapFloatBE(lf - ce);
- dst[3] = SDL_SwapFloatBE(rf - ce);
- }
- } else {
- for (i = cvt->len_cvt / 8; i; --i) {
- dst -= 4;
- src -= 2;
- lf = SDL_SwapFloatLE(src[0]);
- rf = SDL_SwapFloatLE(src[1]);
- ce = (lf / 2) + (rf / 2);
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = SDL_SwapFloatLE(lf - ce);
- dst[3] = SDL_SwapFloatLE(rf - ce);
- }
- }
- }
- break;
- }
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-int
-SDL_ConvertAudio(SDL_AudioCVT * cvt)
-{
- /* !!! FIXME: (cvt) should be const; stack-copy it here. */
- /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */
-
- /* Make sure there's data to convert */
- if (cvt->buf == NULL) {
- SDL_SetError("No buffer allocated for conversion");
- return (-1);
- }
- /* Return okay if no conversion is necessary */
- cvt->len_cvt = cvt->len;
- if (cvt->filters[0] == NULL) {
- return (0);
- }
-
- /* Set up the conversion and go! */
- cvt->filter_index = 0;
- cvt->filters[0] (cvt, cvt->src_format);
- return (0);
-}
-
-
-static SDL_AudioFilter
-SDL_HandTunedTypeCVT(SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt)
-{
- /*
- * Fill in any future conversions that are specialized to a
- * processor, platform, compiler, or library here.
- */
-
- return NULL; /* no specialized converter code available. */
-}
-
-
-/*
- * Find a converter between two data types. We try to select a hand-tuned
- * asm/vectorized/optimized function first, and then fallback to an
- * autogenerated function that is customized to convert between two
- * specific data types.
- */
-static int
-SDL_BuildAudioTypeCVT(SDL_AudioCVT * cvt,
- SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt)
-{
- if (src_fmt != dst_fmt) {
- const Uint16 src_bitsize = SDL_AUDIO_BITSIZE(src_fmt);
- const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt);
- SDL_AudioFilter filter = SDL_HandTunedTypeCVT(src_fmt, dst_fmt);
-
- /* No hand-tuned converter? Try the autogenerated ones. */
- if (filter == NULL) {
- int i;
- for (i = 0; sdl_audio_type_filters[i].filter != NULL; i++) {
- const SDL_AudioTypeFilters *filt = &sdl_audio_type_filters[i];
- if ((filt->src_fmt == src_fmt) && (filt->dst_fmt == dst_fmt)) {
- filter = filt->filter;
- break;
- }
- }
-
- if (filter == NULL) {
- SDL_SetError("No conversion available for these formats");
- return -1;
- }
- }
-
- /* Update (cvt) with filter details... */
- cvt->filters[cvt->filter_index++] = filter;
- if (src_bitsize < dst_bitsize) {
- const int mult = (dst_bitsize / src_bitsize);
- cvt->len_mult *= mult;
- cvt->len_ratio *= mult;
- } else if (src_bitsize > dst_bitsize) {
- cvt->len_ratio /= (src_bitsize / dst_bitsize);
- }
-
- return 1; /* added a converter. */
- }
-
- return 0; /* no conversion necessary. */
-}
-
-
-static SDL_AudioFilter
-SDL_HandTunedResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
- int src_rate, int dst_rate)
-{
- /*
- * Fill in any future conversions that are specialized to a
- * processor, platform, compiler, or library here.
- */
-
- return NULL; /* no specialized converter code available. */
-}
-
-static int
-SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate)
-{
- int retval = 0;
-
- /* If we only built with the arbitrary resamplers, ignore multiples. */
-#if !LESS_RESAMPLERS
- int lo, hi;
- int div;
-
- SDL_assert(src_rate != 0);
- SDL_assert(dst_rate != 0);
- SDL_assert(src_rate != dst_rate);
-
- if (src_rate < dst_rate) {
- lo = src_rate;
- hi = dst_rate;
- } else {
- lo = dst_rate;
- hi = src_rate;
- }
-
- /* zero means "not a supported multiple" ... we only do 2x and 4x. */
- if ((hi % lo) != 0)
- return 0; /* not a multiple. */
-
- div = hi / lo;
- retval = ((div == 2) || (div == 4)) ? div : 0;
-#endif
-
- return retval;
-}
-
-static int
-SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
- int src_rate, int dst_rate)
-{
- if (src_rate != dst_rate) {
- SDL_AudioFilter filter = SDL_HandTunedResampleCVT(cvt, dst_channels,
- src_rate, dst_rate);
-
- /* No hand-tuned converter? Try the autogenerated ones. */
- if (filter == NULL) {
- int i;
- const int upsample = (src_rate < dst_rate) ? 1 : 0;
- const int multiple =
- SDL_FindFrequencyMultiple(src_rate, dst_rate);
-
- for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) {
- const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i];
- if ((filt->fmt == cvt->dst_format) &&
- (filt->channels == dst_channels) &&
- (filt->upsample == upsample) &&
- (filt->multiple == multiple)) {
- filter = filt->filter;
- break;
- }
- }
-
- if (filter == NULL) {
- SDL_SetError("No conversion available for these rates");
- return -1;
- }
- }
-
- /* Update (cvt) with filter details... */
- cvt->filters[cvt->filter_index++] = filter;
- if (src_rate < dst_rate) {
- const double mult = ((double) dst_rate) / ((double) src_rate);
- cvt->len_mult *= (int) SDL_ceil(mult);
- cvt->len_ratio *= mult;
- } else {
- cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate);
- }
-
- return 1; /* added a converter. */
- }
-
- return 0; /* no conversion necessary. */
-}
-
-
-/* Creates a set of audio filters to convert from one format to another.
- Returns -1 if the format conversion is not supported, 0 if there's
- no conversion needed, or 1 if the audio filter is set up.
-*/
-
-int
-SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
- SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate,
- SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate)
-{
- /*
- * !!! FIXME: reorder filters based on which grow/shrink the buffer.
- * !!! FIXME: ideally, we should do everything that shrinks the buffer
- * !!! FIXME: first, so we don't have to process as many bytes in a given
- * !!! FIXME: filter and abuse the CPU cache less. This might not be as
- * !!! FIXME: good in practice as it sounds in theory, though.
- */
-
- /* Sanity check target pointer */
- if (cvt == NULL) {
- return SDL_InvalidParamError("cvt");
- }
-
- /* there are no unsigned types over 16 bits, so catch this up front. */
- if ((SDL_AUDIO_BITSIZE(src_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(src_fmt))) {
- return SDL_SetError("Invalid source format");
- }
- if ((SDL_AUDIO_BITSIZE(dst_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(dst_fmt))) {
- return SDL_SetError("Invalid destination format");
- }
-
- /* prevent possible divisions by zero, etc. */
- if ((src_channels == 0) || (dst_channels == 0)) {
- return SDL_SetError("Source or destination channels is zero");
- }
- if ((src_rate == 0) || (dst_rate == 0)) {
- return SDL_SetError("Source or destination rate is zero");
- }
-#ifdef DEBUG_CONVERT
- printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
- src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate);
-#endif
-
- /* Start off with no conversion necessary */
- SDL_zerop(cvt);
- cvt->src_format = src_fmt;
- cvt->dst_format = dst_fmt;
- cvt->needed = 0;
- cvt->filter_index = 0;
- cvt->filters[0] = NULL;
- cvt->len_mult = 1;
- cvt->len_ratio = 1.0;
- cvt->rate_incr = ((double) dst_rate) / ((double) src_rate);
-
- /* Convert data types, if necessary. Updates (cvt). */
- if (SDL_BuildAudioTypeCVT(cvt, src_fmt, dst_fmt) == -1) {
- return -1; /* shouldn't happen, but just in case... */
- }
-
- /* Channel conversion */
- if (src_channels != dst_channels) {
- if ((src_channels == 1) && (dst_channels > 1)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertStereo;
- cvt->len_mult *= 2;
- src_channels = 2;
- cvt->len_ratio *= 2;
- }
- if ((src_channels == 2) && (dst_channels == 6)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertSurround;
- src_channels = 6;
- cvt->len_mult *= 3;
- cvt->len_ratio *= 3;
- }
- if ((src_channels == 2) && (dst_channels == 4)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertSurround_4;
- src_channels = 4;
- cvt->len_mult *= 2;
- cvt->len_ratio *= 2;
- }
- while ((src_channels * 2) <= dst_channels) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertStereo;
- cvt->len_mult *= 2;
- src_channels *= 2;
- cvt->len_ratio *= 2;
- }
- if ((src_channels == 6) && (dst_channels <= 2)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertStrip;
- src_channels = 2;
- cvt->len_ratio /= 3;
- }
- if ((src_channels == 6) && (dst_channels == 4)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertStrip_2;
- src_channels = 4;
- cvt->len_ratio /= 2;
- }
- /* This assumes that 4 channel audio is in the format:
- Left {front/back} + Right {front/back}
- so converting to L/R stereo works properly.
- */
- while (((src_channels % 2) == 0) &&
- ((src_channels / 2) >= dst_channels)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertMono;
- src_channels /= 2;
- cvt->len_ratio /= 2;
- }
- if (src_channels != dst_channels) {
- /* Uh oh.. */ ;
- }
- }
-
- /* Do rate conversion, if necessary. Updates (cvt). */
- if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) ==
- -1) {
- return -1; /* shouldn't happen, but just in case... */
- }
-
- /* Set up the filter information */
- if (cvt->filter_index != 0) {
- cvt->needed = 1;
- cvt->src_format = src_fmt;
- cvt->dst_format = dst_fmt;
- cvt->len = 0;
- cvt->buf = NULL;
- cvt->filters[cvt->filter_index] = NULL;
- }
- return (cvt->needed);
-}
-
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/SDL_audiotypecvt.c b/3rdparty/sdl2-2.0.4/src/audio/SDL_audiotypecvt.c
deleted file mode 100644
index be3b7430aa..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/SDL_audiotypecvt.c
+++ /dev/null
@@ -1,16015 +0,0 @@
-/* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "../SDL_internal.h"
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#ifndef DEBUG_CONVERT
-#define DEBUG_CONVERT 0
-#endif
-
-
-/* If you can guarantee your data and need space, you can eliminate code... */
-
-/* Just build the arbitrary resamplers if you're saving code space. */
-#ifndef LESS_RESAMPLERS
-#define LESS_RESAMPLERS 0
-#endif
-
-/* Don't build any resamplers if you're REALLY saving code space. */
-#ifndef NO_RESAMPLERS
-#define NO_RESAMPLERS 0
-#endif
-
-/* Don't build any type converters if you're saving code space. */
-#ifndef NO_CONVERTERS
-#define NO_CONVERTERS 0
-#endif
-
-
-/* *INDENT-OFF* */
-
-#define DIVBY127 0.0078740157480315f
-#define DIVBY32767 3.05185094759972e-05f
-#define DIVBY2147483647 4.6566128752458e-10f
-
-#if !NO_CONVERTERS
-
-static void SDLCALL
-SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n");
-#endif
-
- src = (const Uint8 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
- const Sint8 val = ((*src) ^ 0x80);
- *dst = ((Sint8) val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Uint16 val = (((Uint16) *src) << 8);
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Uint16 val = (((Uint16) *src) << 8);
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const float val = ((((float) *src) * DIVBY127) - 1.0f);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const float val = ((((float) *src) * DIVBY127) - 1.0f);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n");
-#endif
-
- src = (const Uint8 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
- const Uint8 val = ((((Sint8) *src)) ^ 0x80);
- *dst = val;
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const float val = (((float) ((Sint8) *src)) * DIVBY127);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint8 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
- const float val = (((float) ((Sint8) *src)) * DIVBY127);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8));
- *dst = val;
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = SDL_SwapLE16(*src);
- *dst = SDL_SwapBE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8));
- *dst = val;
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
- *dst = SDL_SwapLE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
- *dst = SDL_SwapBE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) SDL_SwapLE16(*src));
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8));
- *dst = val;
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = SDL_SwapBE16(*src);
- *dst = SDL_SwapLE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8));
- *dst = val;
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
- *dst = SDL_SwapLE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) SDL_SwapBE16(*src));
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const Uint16 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
- const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
- *dst = SDL_SwapBE16(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
- *dst = SDL_SwapFloatLE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint16 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n");
-#endif
-
- src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
- for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
- const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
- *dst = SDL_SwapFloatBE(val);
- }
-
- cvt->len_cvt *= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24));
- *dst = val;
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) SDL_SwapLE32(*src));
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
- *dst = SDL_SwapFloatLE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
- *dst = SDL_SwapFloatBE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24));
- *dst = val;
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) SDL_SwapBE32(*src));
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
- *dst = SDL_SwapFloatLE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const Uint32 *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n");
-#endif
-
- src = (const Uint32 *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
- const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
- *dst = SDL_SwapFloatBE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f));
- *dst = val;
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const float val = SDL_SwapFloatLE(*src);
- *dst = SDL_SwapFloatBE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f));
- *dst = val;
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint8 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint8 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f));
- *dst = ((Sint8) val);
- }
-
- cvt->len_cvt /= 4;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
- *dst = SDL_SwapLE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
- *dst = ((Sint16) SDL_SwapLE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Uint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Uint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
- *dst = SDL_SwapBE16(val);
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint16 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint16 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
- *dst = ((Sint16) SDL_SwapBE16(val));
- }
-
- cvt->len_cvt /= 2;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
- *dst = ((Sint32) SDL_SwapLE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- Sint32 *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (Sint32 *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
- *dst = ((Sint32) SDL_SwapBE32(val));
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
- }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
- int i;
- const float *src;
- float *dst;
-
-#if DEBUG_CONVERT
- fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n");
-#endif
-
- src = (const float *) cvt->buf;
- dst = (float *) cvt->buf;
- for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
- const float val = SDL_SwapFloatBE(*src);
- *dst = SDL_SwapFloatLE(val);
- }
-
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
- }
-}
-
-#endif /* !NO_CONVERTERS */
-
-
-const SDL_AudioTypeFilters sdl_audio_type_filters[] =
-{
-#if !NO_CONVERTERS
- { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 },
- { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB },
- { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB },
- { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB },
- { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB },
- { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB },
- { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB },
- { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB },
- { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB },
- { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 },
- { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB },
- { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB },
- { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB },
- { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB },
- { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB },
- { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB },
- { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB },
- { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB },
- { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 },
- { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 },
- { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB },
- { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB },
- { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB },
- { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB },
- { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB },
- { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB },
- { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB },
- { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 },
- { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 },
- { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB },
- { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB },
- { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB },
- { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB },
- { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB },
- { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB },
- { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB },
- { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 },
- { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 },
- { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB },
- { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB },
- { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB },
- { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB },
- { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB },
- { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB },
- { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB },
- { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 },
- { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 },
- { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB },
- { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB },
- { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB },
- { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB },
- { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB },
- { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB },
- { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB },
- { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 },
- { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 },
- { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB },
- { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB },
- { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB },
- { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB },
- { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB },
- { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB },
- { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB },
- { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 },
- { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 },
- { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB },
- { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB },
- { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB },
- { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB },
- { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB },
- { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB },
- { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB },
- { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 },
- { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 },
- { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB },
- { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB },
- { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB },
- { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB },
- { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB },
- { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB },
- { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB },
- { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 },
- { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 },
- { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB },
- { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB },
- { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB },
- { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB },
- { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB },
- { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB },
- { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB },
-#endif /* !NO_CONVERTERS */
- { 0, 0, NULL }
-};
-
-
-#if !NO_RESAMPLERS
-
-static void SDLCALL
-SDL_Upsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 16;
- const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
- register int eps = 0;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Uint8 sample0 = src[0];
- Uint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = sample0;
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 16;
- const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
- register int eps = 0;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Uint8 sample0 = src[0];
- Uint8 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = sample0;
- dst++;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Uint8 sample1 = src[1];
- Uint8 sample0 = src[0];
- Uint8 last_sample1 = sample1;
- Uint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = sample1;
- dst[0] = sample0;
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Uint8 sample0 = src[0];
- Uint8 sample1 = src[1];
- Uint8 last_sample0 = sample0;
- Uint8 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = sample0;
- dst[1] = sample1;
- dst += 2;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Uint8 sample3 = src[3];
- Uint8 sample2 = src[2];
- Uint8 sample1 = src[1];
- Uint8 sample0 = src[0];
- Uint8 last_sample3 = sample3;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = sample3;
- dst[2] = sample2;
- dst[1] = sample1;
- dst[0] = sample0;
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Uint8 sample0 = src[0];
- Uint8 sample1 = src[1];
- Uint8 sample2 = src[2];
- Uint8 sample3 = src[3];
- Uint8 last_sample0 = sample0;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = sample0;
- dst[1] = sample1;
- dst[2] = sample2;
- dst[3] = sample3;
- dst += 4;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 96;
- const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
- register int eps = 0;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Uint8 sample5 = src[5];
- Uint8 sample4 = src[4];
- Uint8 sample3 = src[3];
- Uint8 sample2 = src[2];
- Uint8 sample1 = src[1];
- Uint8 sample0 = src[0];
- Uint8 last_sample5 = sample5;
- Uint8 last_sample4 = sample4;
- Uint8 last_sample3 = sample3;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = sample5;
- dst[4] = sample4;
- dst[3] = sample3;
- dst[2] = sample2;
- dst[1] = sample1;
- dst[0] = sample0;
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
- sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 96;
- const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
- register int eps = 0;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Uint8 sample0 = src[0];
- Uint8 sample1 = src[1];
- Uint8 sample2 = src[2];
- Uint8 sample3 = src[3];
- Uint8 sample4 = src[4];
- Uint8 sample5 = src[5];
- Uint8 last_sample0 = sample0;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample3 = sample3;
- Uint8 last_sample4 = sample4;
- Uint8 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = sample0;
- dst[1] = sample1;
- dst[2] = sample2;
- dst[3] = sample3;
- dst[4] = sample4;
- dst[5] = sample5;
- dst += 6;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
- sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Uint8 sample7 = src[7];
- Uint8 sample6 = src[6];
- Uint8 sample5 = src[5];
- Uint8 sample4 = src[4];
- Uint8 sample3 = src[3];
- Uint8 sample2 = src[2];
- Uint8 sample1 = src[1];
- Uint8 sample0 = src[0];
- Uint8 last_sample7 = sample7;
- Uint8 last_sample6 = sample6;
- Uint8 last_sample5 = sample5;
- Uint8 last_sample4 = sample4;
- Uint8 last_sample3 = sample3;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = sample7;
- dst[6] = sample6;
- dst[5] = sample5;
- dst[4] = sample4;
- dst[3] = sample3;
- dst[2] = sample2;
- dst[1] = sample1;
- dst[0] = sample0;
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
- sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
- sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
- sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Uint8 sample0 = src[0];
- Uint8 sample1 = src[1];
- Uint8 sample2 = src[2];
- Uint8 sample3 = src[3];
- Uint8 sample4 = src[4];
- Uint8 sample5 = src[5];
- Uint8 sample6 = src[6];
- Uint8 sample7 = src[7];
- Uint8 last_sample0 = sample0;
- Uint8 last_sample1 = sample1;
- Uint8 last_sample2 = sample2;
- Uint8 last_sample3 = sample3;
- Uint8 last_sample4 = sample4;
- Uint8 last_sample5 = sample5;
- Uint8 last_sample6 = sample6;
- Uint8 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = sample0;
- dst[1] = sample1;
- dst[2] = sample2;
- dst[3] = sample3;
- dst[4] = sample4;
- dst[5] = sample5;
- dst[6] = sample6;
- dst[7] = sample7;
- dst += 8;
- sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
- sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
- sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
- sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
- sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 16;
- const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
- register int eps = 0;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = ((Sint8) sample0);
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 16;
- const int dstsize = (int) (((double)(cvt->len_cvt/1)) * cvt->rate_incr) * 1;
- register int eps = 0;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint8) sample0);
- dst++;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample1 = sample1;
- Sint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = ((Sint8) sample1);
- dst[0] = ((Sint8) sample0);
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 last_sample0 = sample0;
- Sint8 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint8) sample0);
- dst[1] = ((Sint8) sample1);
- dst += 2;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample3 = sample3;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = ((Sint8) sample3);
- dst[2] = ((Sint8) sample2);
- dst[1] = ((Sint8) sample1);
- dst[0] = ((Sint8) sample0);
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 last_sample0 = sample0;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint8) sample0);
- dst[1] = ((Sint8) sample1);
- dst[2] = ((Sint8) sample2);
- dst[3] = ((Sint8) sample3);
- dst += 4;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 96;
- const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
- register int eps = 0;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint8 sample5 = ((Sint8) src[5]);
- Sint8 sample4 = ((Sint8) src[4]);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample5 = sample5;
- Sint8 last_sample4 = sample4;
- Sint8 last_sample3 = sample3;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = ((Sint8) sample5);
- dst[4] = ((Sint8) sample4);
- dst[3] = ((Sint8) sample3);
- dst[2] = ((Sint8) sample2);
- dst[1] = ((Sint8) sample1);
- dst[0] = ((Sint8) sample0);
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
- sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 96;
- const int dstsize = (int) (((double)(cvt->len_cvt/6)) * cvt->rate_incr) * 6;
- register int eps = 0;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 sample4 = ((Sint8) src[4]);
- Sint8 sample5 = ((Sint8) src[5]);
- Sint8 last_sample0 = sample0;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample3 = sample3;
- Sint8 last_sample4 = sample4;
- Sint8 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint8) sample0);
- dst[1] = ((Sint8) sample1);
- dst[2] = ((Sint8) sample2);
- dst[3] = ((Sint8) sample3);
- dst[4] = ((Sint8) sample4);
- dst[5] = ((Sint8) sample5);
- dst += 6;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
- sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint8 sample7 = ((Sint8) src[7]);
- Sint8 sample6 = ((Sint8) src[6]);
- Sint8 sample5 = ((Sint8) src[5]);
- Sint8 sample4 = ((Sint8) src[4]);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 last_sample7 = sample7;
- Sint8 last_sample6 = sample6;
- Sint8 last_sample5 = sample5;
- Sint8 last_sample4 = sample4;
- Sint8 last_sample3 = sample3;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = ((Sint8) sample7);
- dst[6] = ((Sint8) sample6);
- dst[5] = ((Sint8) sample5);
- dst[4] = ((Sint8) sample4);
- dst[3] = ((Sint8) sample3);
- dst[2] = ((Sint8) sample2);
- dst[1] = ((Sint8) sample1);
- dst[0] = ((Sint8) sample0);
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
- sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
- sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
- sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint8 sample0 = ((Sint8) src[0]);
- Sint8 sample1 = ((Sint8) src[1]);
- Sint8 sample2 = ((Sint8) src[2]);
- Sint8 sample3 = ((Sint8) src[3]);
- Sint8 sample4 = ((Sint8) src[4]);
- Sint8 sample5 = ((Sint8) src[5]);
- Sint8 sample6 = ((Sint8) src[6]);
- Sint8 sample7 = ((Sint8) src[7]);
- Sint8 last_sample0 = sample0;
- Sint8 last_sample1 = sample1;
- Sint8 last_sample2 = sample2;
- Sint8 last_sample3 = sample3;
- Sint8 last_sample4 = sample4;
- Sint8 last_sample5 = sample5;
- Sint8 last_sample6 = sample6;
- Sint8 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint8) sample0);
- dst[1] = ((Sint8) sample1);
- dst[2] = ((Sint8) sample2);
- dst[3] = ((Sint8) sample3);
- dst[4] = ((Sint8) sample4);
- dst[5] = ((Sint8) sample5);
- dst[6] = ((Sint8) sample6);
- dst[7] = ((Sint8) sample7);
- dst += 8;
- sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
- sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
- sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
- sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
- sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
- sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
- sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
- sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = SDL_SwapLE16(sample0);
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapLE16(sample0);
- dst++;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = SDL_SwapLE16(sample1);
- dst[0] = SDL_SwapLE16(sample0);
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapLE16(sample0);
- dst[1] = SDL_SwapLE16(sample1);
- dst += 2;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = SDL_SwapLE16(sample3);
- dst[2] = SDL_SwapLE16(sample2);
- dst[1] = SDL_SwapLE16(sample1);
- dst[0] = SDL_SwapLE16(sample0);
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapLE16(sample0);
- dst[1] = SDL_SwapLE16(sample1);
- dst[2] = SDL_SwapLE16(sample2);
- dst[3] = SDL_SwapLE16(sample3);
- dst += 4;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample5 = SDL_SwapLE16(src[5]);
- Uint16 sample4 = SDL_SwapLE16(src[4]);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample5 = sample5;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = SDL_SwapLE16(sample5);
- dst[4] = SDL_SwapLE16(sample4);
- dst[3] = SDL_SwapLE16(sample3);
- dst[2] = SDL_SwapLE16(sample2);
- dst[1] = SDL_SwapLE16(sample1);
- dst[0] = SDL_SwapLE16(sample0);
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 sample4 = SDL_SwapLE16(src[4]);
- Uint16 sample5 = SDL_SwapLE16(src[5]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapLE16(sample0);
- dst[1] = SDL_SwapLE16(sample1);
- dst[2] = SDL_SwapLE16(sample2);
- dst[3] = SDL_SwapLE16(sample3);
- dst[4] = SDL_SwapLE16(sample4);
- dst[5] = SDL_SwapLE16(sample5);
- dst += 6;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample7 = SDL_SwapLE16(src[7]);
- Uint16 sample6 = SDL_SwapLE16(src[6]);
- Uint16 sample5 = SDL_SwapLE16(src[5]);
- Uint16 sample4 = SDL_SwapLE16(src[4]);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 last_sample7 = sample7;
- Uint16 last_sample6 = sample6;
- Uint16 last_sample5 = sample5;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = SDL_SwapLE16(sample7);
- dst[6] = SDL_SwapLE16(sample6);
- dst[5] = SDL_SwapLE16(sample5);
- dst[4] = SDL_SwapLE16(sample4);
- dst[3] = SDL_SwapLE16(sample3);
- dst[2] = SDL_SwapLE16(sample2);
- dst[1] = SDL_SwapLE16(sample1);
- dst[0] = SDL_SwapLE16(sample0);
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
- sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapLE16(src[0]);
- Uint16 sample1 = SDL_SwapLE16(src[1]);
- Uint16 sample2 = SDL_SwapLE16(src[2]);
- Uint16 sample3 = SDL_SwapLE16(src[3]);
- Uint16 sample4 = SDL_SwapLE16(src[4]);
- Uint16 sample5 = SDL_SwapLE16(src[5]);
- Uint16 sample6 = SDL_SwapLE16(src[6]);
- Uint16 sample7 = SDL_SwapLE16(src[7]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample5 = sample5;
- Uint16 last_sample6 = sample6;
- Uint16 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapLE16(sample0);
- dst[1] = SDL_SwapLE16(sample1);
- dst[2] = SDL_SwapLE16(sample2);
- dst[3] = SDL_SwapLE16(sample3);
- dst[4] = SDL_SwapLE16(sample4);
- dst[5] = SDL_SwapLE16(sample5);
- dst[6] = SDL_SwapLE16(sample6);
- dst[7] = SDL_SwapLE16(sample7);
- dst += 8;
- sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
- sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst++;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst += 2;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst += 4;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
- Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample5 = sample5;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = ((Sint16) SDL_SwapLE16(sample5));
- dst[4] = ((Sint16) SDL_SwapLE16(sample4));
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
- Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst[4] = ((Sint16) SDL_SwapLE16(sample4));
- dst[5] = ((Sint16) SDL_SwapLE16(sample5));
- dst += 6;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
- Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
- Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
- Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 last_sample7 = sample7;
- Sint16 last_sample6 = sample6;
- Sint16 last_sample5 = sample5;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = ((Sint16) SDL_SwapLE16(sample7));
- dst[6] = ((Sint16) SDL_SwapLE16(sample6));
- dst[5] = ((Sint16) SDL_SwapLE16(sample5));
- dst[4] = ((Sint16) SDL_SwapLE16(sample4));
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
- sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
- Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
- Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
- Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
- Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample5 = sample5;
- Sint16 last_sample6 = sample6;
- Sint16 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapLE16(sample0));
- dst[1] = ((Sint16) SDL_SwapLE16(sample1));
- dst[2] = ((Sint16) SDL_SwapLE16(sample2));
- dst[3] = ((Sint16) SDL_SwapLE16(sample3));
- dst[4] = ((Sint16) SDL_SwapLE16(sample4));
- dst[5] = ((Sint16) SDL_SwapLE16(sample5));
- dst[6] = ((Sint16) SDL_SwapLE16(sample6));
- dst[7] = ((Sint16) SDL_SwapLE16(sample7));
- dst += 8;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
- sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = SDL_SwapBE16(sample0);
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapBE16(sample0);
- dst++;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = SDL_SwapBE16(sample1);
- dst[0] = SDL_SwapBE16(sample0);
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapBE16(sample0);
- dst[1] = SDL_SwapBE16(sample1);
- dst += 2;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = SDL_SwapBE16(sample3);
- dst[2] = SDL_SwapBE16(sample2);
- dst[1] = SDL_SwapBE16(sample1);
- dst[0] = SDL_SwapBE16(sample0);
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapBE16(sample0);
- dst[1] = SDL_SwapBE16(sample1);
- dst[2] = SDL_SwapBE16(sample2);
- dst[3] = SDL_SwapBE16(sample3);
- dst += 4;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample5 = SDL_SwapBE16(src[5]);
- Uint16 sample4 = SDL_SwapBE16(src[4]);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample5 = sample5;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = SDL_SwapBE16(sample5);
- dst[4] = SDL_SwapBE16(sample4);
- dst[3] = SDL_SwapBE16(sample3);
- dst[2] = SDL_SwapBE16(sample2);
- dst[1] = SDL_SwapBE16(sample1);
- dst[0] = SDL_SwapBE16(sample0);
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 sample4 = SDL_SwapBE16(src[4]);
- Uint16 sample5 = SDL_SwapBE16(src[5]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapBE16(sample0);
- dst[1] = SDL_SwapBE16(sample1);
- dst[2] = SDL_SwapBE16(sample2);
- dst[3] = SDL_SwapBE16(sample3);
- dst[4] = SDL_SwapBE16(sample4);
- dst[5] = SDL_SwapBE16(sample5);
- dst += 6;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Uint16 sample7 = SDL_SwapBE16(src[7]);
- Uint16 sample6 = SDL_SwapBE16(src[6]);
- Uint16 sample5 = SDL_SwapBE16(src[5]);
- Uint16 sample4 = SDL_SwapBE16(src[4]);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 last_sample7 = sample7;
- Uint16 last_sample6 = sample6;
- Uint16 last_sample5 = sample5;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = SDL_SwapBE16(sample7);
- dst[6] = SDL_SwapBE16(sample6);
- dst[5] = SDL_SwapBE16(sample5);
- dst[4] = SDL_SwapBE16(sample4);
- dst[3] = SDL_SwapBE16(sample3);
- dst[2] = SDL_SwapBE16(sample2);
- dst[1] = SDL_SwapBE16(sample1);
- dst[0] = SDL_SwapBE16(sample0);
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
- sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Uint16 sample0 = SDL_SwapBE16(src[0]);
- Uint16 sample1 = SDL_SwapBE16(src[1]);
- Uint16 sample2 = SDL_SwapBE16(src[2]);
- Uint16 sample3 = SDL_SwapBE16(src[3]);
- Uint16 sample4 = SDL_SwapBE16(src[4]);
- Uint16 sample5 = SDL_SwapBE16(src[5]);
- Uint16 sample6 = SDL_SwapBE16(src[6]);
- Uint16 sample7 = SDL_SwapBE16(src[7]);
- Uint16 last_sample0 = sample0;
- Uint16 last_sample1 = sample1;
- Uint16 last_sample2 = sample2;
- Uint16 last_sample3 = sample3;
- Uint16 last_sample4 = sample4;
- Uint16 last_sample5 = sample5;
- Uint16 last_sample6 = sample6;
- Uint16 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapBE16(sample0);
- dst[1] = SDL_SwapBE16(sample1);
- dst[2] = SDL_SwapBE16(sample2);
- dst[3] = SDL_SwapBE16(sample3);
- dst[4] = SDL_SwapBE16(sample4);
- dst[5] = SDL_SwapBE16(sample5);
- dst[6] = SDL_SwapBE16(sample6);
- dst[7] = SDL_SwapBE16(sample7);
- dst += 8;
- sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
- sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
- sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 32;
- const int dstsize = (int) (((double)(cvt->len_cvt/2)) * cvt->rate_incr) * 2;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst++;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst += 2;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst += 4;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
- Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample5 = sample5;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = ((Sint16) SDL_SwapBE16(sample5));
- dst[4] = ((Sint16) SDL_SwapBE16(sample4));
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 192;
- const int dstsize = (int) (((double)(cvt->len_cvt/12)) * cvt->rate_incr) * 12;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
- Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst[4] = ((Sint16) SDL_SwapBE16(sample4));
- dst[5] = ((Sint16) SDL_SwapBE16(sample5));
- dst += 6;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
- Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
- Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
- Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 last_sample7 = sample7;
- Sint16 last_sample6 = sample6;
- Sint16 last_sample5 = sample5;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = ((Sint16) SDL_SwapBE16(sample7));
- dst[6] = ((Sint16) SDL_SwapBE16(sample6));
- dst[5] = ((Sint16) SDL_SwapBE16(sample5));
- dst[4] = ((Sint16) SDL_SwapBE16(sample4));
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
- sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
- Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
- Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
- Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
- Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
- Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
- Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
- Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
- Sint16 last_sample0 = sample0;
- Sint16 last_sample1 = sample1;
- Sint16 last_sample2 = sample2;
- Sint16 last_sample3 = sample3;
- Sint16 last_sample4 = sample4;
- Sint16 last_sample5 = sample5;
- Sint16 last_sample6 = sample6;
- Sint16 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint16) SDL_SwapBE16(sample0));
- dst[1] = ((Sint16) SDL_SwapBE16(sample1));
- dst[2] = ((Sint16) SDL_SwapBE16(sample2));
- dst[3] = ((Sint16) SDL_SwapBE16(sample3));
- dst[4] = ((Sint16) SDL_SwapBE16(sample4));
- dst[5] = ((Sint16) SDL_SwapBE16(sample5));
- dst[6] = ((Sint16) SDL_SwapBE16(sample6));
- dst[7] = ((Sint16) SDL_SwapBE16(sample7));
- dst += 8;
- sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
- sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
- sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
- sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
- sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
- sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
- sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
- sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst++;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst += 2;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst += 4;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
- Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample5 = sample5;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = ((Sint32) SDL_SwapLE32(sample5));
- dst[4] = ((Sint32) SDL_SwapLE32(sample4));
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
- Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst[4] = ((Sint32) SDL_SwapLE32(sample4));
- dst[5] = ((Sint32) SDL_SwapLE32(sample5));
- dst += 6;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
- Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
- Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
- Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 last_sample7 = sample7;
- Sint32 last_sample6 = sample6;
- Sint32 last_sample5 = sample5;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = ((Sint32) SDL_SwapLE32(sample7));
- dst[6] = ((Sint32) SDL_SwapLE32(sample6));
- dst[5] = ((Sint32) SDL_SwapLE32(sample5));
- dst[4] = ((Sint32) SDL_SwapLE32(sample4));
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
- sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
- Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
- Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
- Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
- Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample5 = sample5;
- Sint32 last_sample6 = sample6;
- Sint32 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapLE32(sample0));
- dst[1] = ((Sint32) SDL_SwapLE32(sample1));
- dst[2] = ((Sint32) SDL_SwapLE32(sample2));
- dst[3] = ((Sint32) SDL_SwapLE32(sample3));
- dst[4] = ((Sint32) SDL_SwapLE32(sample4));
- dst[5] = ((Sint32) SDL_SwapLE32(sample5));
- dst[6] = ((Sint32) SDL_SwapLE32(sample6));
- dst[7] = ((Sint32) SDL_SwapLE32(sample7));
- dst += 8;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
- sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst++;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst += 2;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst += 4;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
- Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample5 = sample5;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = ((Sint32) SDL_SwapBE32(sample5));
- dst[4] = ((Sint32) SDL_SwapBE32(sample4));
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
- Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst[4] = ((Sint32) SDL_SwapBE32(sample4));
- dst[5] = ((Sint32) SDL_SwapBE32(sample5));
- dst += 6;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
- Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
- Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
- Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 last_sample7 = sample7;
- Sint32 last_sample6 = sample6;
- Sint32 last_sample5 = sample5;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = ((Sint32) SDL_SwapBE32(sample7));
- dst[6] = ((Sint32) SDL_SwapBE32(sample6));
- dst[5] = ((Sint32) SDL_SwapBE32(sample5));
- dst[4] = ((Sint32) SDL_SwapBE32(sample4));
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
- sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
- Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
- Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
- Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
- Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
- Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
- Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
- Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
- Sint32 last_sample0 = sample0;
- Sint32 last_sample1 = sample1;
- Sint32 last_sample2 = sample2;
- Sint32 last_sample3 = sample3;
- Sint32 last_sample4 = sample4;
- Sint32 last_sample5 = sample5;
- Sint32 last_sample6 = sample6;
- Sint32 last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = ((Sint32) SDL_SwapBE32(sample0));
- dst[1] = ((Sint32) SDL_SwapBE32(sample1));
- dst[2] = ((Sint32) SDL_SwapBE32(sample2));
- dst[3] = ((Sint32) SDL_SwapBE32(sample3));
- dst[4] = ((Sint32) SDL_SwapBE32(sample4));
- dst[5] = ((Sint32) SDL_SwapBE32(sample5));
- dst[6] = ((Sint32) SDL_SwapBE32(sample6));
- dst[7] = ((Sint32) SDL_SwapBE32(sample7));
- dst += 8;
- sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
- sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
- sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
- sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
- sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
- sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
- sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
- sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst++;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[0] = SDL_SwapFloatLE(sample0);
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst += 2;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = SDL_SwapFloatLE(sample3);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[0] = SDL_SwapFloatLE(sample0);
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[3] = SDL_SwapFloatLE(sample3);
- dst += 4;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- float sample5 = SDL_SwapFloatLE(src[5]);
- float sample4 = SDL_SwapFloatLE(src[4]);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample5 = sample5;
- float last_sample4 = sample4;
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = SDL_SwapFloatLE(sample5);
- dst[4] = SDL_SwapFloatLE(sample4);
- dst[3] = SDL_SwapFloatLE(sample3);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[0] = SDL_SwapFloatLE(sample0);
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float sample4 = SDL_SwapFloatLE(src[4]);
- float sample5 = SDL_SwapFloatLE(src[5]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- float last_sample4 = sample4;
- float last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[3] = SDL_SwapFloatLE(sample3);
- dst[4] = SDL_SwapFloatLE(sample4);
- dst[5] = SDL_SwapFloatLE(sample5);
- dst += 6;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- float sample7 = SDL_SwapFloatLE(src[7]);
- float sample6 = SDL_SwapFloatLE(src[6]);
- float sample5 = SDL_SwapFloatLE(src[5]);
- float sample4 = SDL_SwapFloatLE(src[4]);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float last_sample7 = sample7;
- float last_sample6 = sample6;
- float last_sample5 = sample5;
- float last_sample4 = sample4;
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = SDL_SwapFloatLE(sample7);
- dst[6] = SDL_SwapFloatLE(sample6);
- dst[5] = SDL_SwapFloatLE(sample5);
- dst[4] = SDL_SwapFloatLE(sample4);
- dst[3] = SDL_SwapFloatLE(sample3);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[0] = SDL_SwapFloatLE(sample0);
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
- sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatLE(src[0]);
- float sample1 = SDL_SwapFloatLE(src[1]);
- float sample2 = SDL_SwapFloatLE(src[2]);
- float sample3 = SDL_SwapFloatLE(src[3]);
- float sample4 = SDL_SwapFloatLE(src[4]);
- float sample5 = SDL_SwapFloatLE(src[5]);
- float sample6 = SDL_SwapFloatLE(src[6]);
- float sample7 = SDL_SwapFloatLE(src[7]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- float last_sample4 = sample4;
- float last_sample5 = sample5;
- float last_sample6 = sample6;
- float last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatLE(sample0);
- dst[1] = SDL_SwapFloatLE(sample1);
- dst[2] = SDL_SwapFloatLE(sample2);
- dst[3] = SDL_SwapFloatLE(sample3);
- dst[4] = SDL_SwapFloatLE(sample4);
- dst[5] = SDL_SwapFloatLE(sample5);
- dst[6] = SDL_SwapFloatLE(sample6);
- dst[7] = SDL_SwapFloatLE(sample7);
- dst += 8;
- sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
- sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
- sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst--;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src--;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 64;
- const int dstsize = (int) (((double)(cvt->len_cvt/4)) * cvt->rate_incr) * 4;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample0 = sample0;
- while (dst < target) {
- src++;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst++;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample0 = sample0;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[0] = SDL_SwapFloatBE(sample0);
- dst -= 2;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 2;
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 128;
- const int dstsize = (int) (((double)(cvt->len_cvt/8)) * cvt->rate_incr) * 8;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- while (dst < target) {
- src += 2;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst += 2;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[3] = SDL_SwapFloatBE(sample3);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[0] = SDL_SwapFloatBE(sample0);
- dst -= 4;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 4;
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 256;
- const int dstsize = (int) (((double)(cvt->len_cvt/16)) * cvt->rate_incr) * 16;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- while (dst < target) {
- src += 4;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[3] = SDL_SwapFloatBE(sample3);
- dst += 4;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- float sample5 = SDL_SwapFloatBE(src[5]);
- float sample4 = SDL_SwapFloatBE(src[4]);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample5 = sample5;
- float last_sample4 = sample4;
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[5] = SDL_SwapFloatBE(sample5);
- dst[4] = SDL_SwapFloatBE(sample4);
- dst[3] = SDL_SwapFloatBE(sample3);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[0] = SDL_SwapFloatBE(sample0);
- dst -= 6;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 6;
- sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 384;
- const int dstsize = (int) (((double)(cvt->len_cvt/24)) * cvt->rate_incr) * 24;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float sample4 = SDL_SwapFloatBE(src[4]);
- float sample5 = SDL_SwapFloatBE(src[5]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- float last_sample4 = sample4;
- float last_sample5 = sample5;
- while (dst < target) {
- src += 6;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[3] = SDL_SwapFloatBE(sample3);
- dst[4] = SDL_SwapFloatBE(sample4);
- dst[5] = SDL_SwapFloatBE(sample5);
- dst += 6;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- float sample7 = SDL_SwapFloatBE(src[7]);
- float sample6 = SDL_SwapFloatBE(src[6]);
- float sample5 = SDL_SwapFloatBE(src[5]);
- float sample4 = SDL_SwapFloatBE(src[4]);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float last_sample7 = sample7;
- float last_sample6 = sample6;
- float last_sample5 = sample5;
- float last_sample4 = sample4;
- float last_sample3 = sample3;
- float last_sample2 = sample2;
- float last_sample1 = sample1;
- float last_sample0 = sample0;
- while (dst >= target) {
- dst[7] = SDL_SwapFloatBE(sample7);
- dst[6] = SDL_SwapFloatBE(sample6);
- dst[5] = SDL_SwapFloatBE(sample5);
- dst[4] = SDL_SwapFloatBE(sample4);
- dst[3] = SDL_SwapFloatBE(sample3);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[0] = SDL_SwapFloatBE(sample0);
- dst -= 8;
- eps += srcsize;
- if ((eps << 1) >= dstsize) {
- src -= 8;
- sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
- sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- eps -= dstsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - 512;
- const int dstsize = (int) (((double)(cvt->len_cvt/32)) * cvt->rate_incr) * 32;
- register int eps = 0;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- float sample0 = SDL_SwapFloatBE(src[0]);
- float sample1 = SDL_SwapFloatBE(src[1]);
- float sample2 = SDL_SwapFloatBE(src[2]);
- float sample3 = SDL_SwapFloatBE(src[3]);
- float sample4 = SDL_SwapFloatBE(src[4]);
- float sample5 = SDL_SwapFloatBE(src[5]);
- float sample6 = SDL_SwapFloatBE(src[6]);
- float sample7 = SDL_SwapFloatBE(src[7]);
- float last_sample0 = sample0;
- float last_sample1 = sample1;
- float last_sample2 = sample2;
- float last_sample3 = sample3;
- float last_sample4 = sample4;
- float last_sample5 = sample5;
- float last_sample6 = sample6;
- float last_sample7 = sample7;
- while (dst < target) {
- src += 8;
- eps += dstsize;
- if ((eps << 1) >= srcsize) {
- dst[0] = SDL_SwapFloatBE(sample0);
- dst[1] = SDL_SwapFloatBE(sample1);
- dst[2] = SDL_SwapFloatBE(sample2);
- dst[3] = SDL_SwapFloatBE(sample3);
- dst[4] = SDL_SwapFloatBE(sample4);
- dst[5] = SDL_SwapFloatBE(sample5);
- dst[6] = SDL_SwapFloatBE(sample6);
- dst[7] = SDL_SwapFloatBE(sample7);
- dst += 8;
- sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
- sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
- sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
- sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
- sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
- sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
- sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
- sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- eps -= srcsize;
- }
- }
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-
-#if !LESS_RESAMPLERS
-
-static void SDLCALL
-SDL_Upsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample0 = (Sint16) src[0];
- src--;
- dst[1] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[0] = (Uint8) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- src += 2;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample0 = (Sint16) src[0];
- src--;
- dst[3] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Uint8) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- src += 4;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 2;
- dst[3] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- src += 4;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 2;
- dst[7] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- src += 8;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 4;
- dst[7] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[6] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- src += 8;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 4;
- dst[15] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- src += 16;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 6;
- dst[11] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[10] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[9] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[8] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[7] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[6] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[5] = (Uint8) sample5;
- dst[4] = (Uint8) sample4;
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample5 = (Sint16) src[5];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample5 = (Sint16) src[5];
- src += 12;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 6;
- dst[23] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[16] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[15] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[14] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[13] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[12] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[11] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Uint8) sample5;
- dst[4] = (Uint8) sample4;
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample5 = (Sint16) src[5];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample5 = (Sint16) src[5];
- src += 24;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 2;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample7 = (Sint16) src[7];
- Sint16 last_sample6 = (Sint16) src[6];
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample7 = (Sint16) src[7];
- const Sint16 sample6 = (Sint16) src[6];
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 8;
- dst[15] = (Uint8) ((sample7 + last_sample7) >> 1);
- dst[14] = (Uint8) ((sample6 + last_sample6) >> 1);
- dst[13] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[12] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint8) sample7;
- dst[6] = (Uint8) sample6;
- dst[5] = (Uint8) sample5;
- dst[4] = (Uint8) sample4;
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample6 = (Sint16) src[6];
- Sint16 last_sample7 = (Sint16) src[7];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample6 = (Sint16) src[6];
- const Sint16 sample7 = (Sint16) src[7];
- src += 16;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 4;
- const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint8 *target = ((const Uint8 *) cvt->buf);
- Sint16 last_sample7 = (Sint16) src[7];
- Sint16 last_sample6 = (Sint16) src[6];
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample0 = (Sint16) src[0];
- while (dst >= target) {
- const Sint16 sample7 = (Sint16) src[7];
- const Sint16 sample6 = (Sint16) src[6];
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample0 = (Sint16) src[0];
- src -= 8;
- dst[31] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Uint8) ((sample7 + last_sample7) >> 1);
- dst[22] = (Uint8) ((sample6 + last_sample6) >> 1);
- dst[21] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[20] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[19] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[18] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[17] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[16] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[15] = (Uint8) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Uint8) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Uint8) sample7;
- dst[6] = (Uint8) sample6;
- dst[5] = (Uint8) sample5;
- dst[4] = (Uint8) sample4;
- dst[3] = (Uint8) sample3;
- dst[2] = (Uint8) sample2;
- dst[1] = (Uint8) sample1;
- dst[0] = (Uint8) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint8 *dst = (Uint8 *) cvt->buf;
- const Uint8 *src = (Uint8 *) cvt->buf;
- const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) src[0];
- Sint16 last_sample1 = (Sint16) src[1];
- Sint16 last_sample2 = (Sint16) src[2];
- Sint16 last_sample3 = (Sint16) src[3];
- Sint16 last_sample4 = (Sint16) src[4];
- Sint16 last_sample5 = (Sint16) src[5];
- Sint16 last_sample6 = (Sint16) src[6];
- Sint16 last_sample7 = (Sint16) src[7];
- while (dst < target) {
- const Sint16 sample0 = (Sint16) src[0];
- const Sint16 sample1 = (Sint16) src[1];
- const Sint16 sample2 = (Sint16) src[2];
- const Sint16 sample3 = (Sint16) src[3];
- const Sint16 sample4 = (Sint16) src[4];
- const Sint16 sample5 = (Sint16) src[5];
- const Sint16 sample6 = (Sint16) src[6];
- const Sint16 sample7 = (Sint16) src[7];
- src += 32;
- dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src--;
- dst[1] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[0] = (Sint8) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src += 2;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src--;
- dst[3] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Sint8) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src += 4;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 2;
- dst[3] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- src += 4;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 2;
- dst[7] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- src += 8;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 4;
- dst[7] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[6] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- src += 8;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 4;
- dst[15] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- src += 16;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 6;
- dst[11] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[10] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[9] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[8] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[7] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[6] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[5] = (Sint8) sample5;
- dst[4] = (Sint8) sample4;
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- src += 12;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 6;
- dst[23] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[16] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[15] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[14] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[13] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[12] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[11] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Sint8) sample5;
- dst[4] = (Sint8) sample4;
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- src += 24;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 2;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
- Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
- const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 8;
- dst[15] = (Sint8) ((sample7 + last_sample7) >> 1);
- dst[14] = (Sint8) ((sample6 + last_sample6) >> 1);
- dst[13] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[12] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint8) sample7;
- dst[6] = (Sint8) sample6;
- dst[5] = (Sint8) sample5;
- dst[4] = (Sint8) sample4;
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
- Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
- const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
- src += 16;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 4;
- const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint8 *target = ((const Sint8 *) cvt->buf);
- Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
- Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- while (dst >= target) {
- const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
- const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- src -= 8;
- dst[31] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Sint8) ((sample7 + last_sample7) >> 1);
- dst[22] = (Sint8) ((sample6 + last_sample6) >> 1);
- dst[21] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[20] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[19] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[18] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[17] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[16] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[15] = (Sint8) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Sint8) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Sint8) sample7;
- dst[6] = (Sint8) sample6;
- dst[5] = (Sint8) sample5;
- dst[4] = (Sint8) sample4;
- dst[3] = (Sint8) sample3;
- dst[2] = (Sint8) sample2;
- dst[1] = (Sint8) sample1;
- dst[0] = (Sint8) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint8 *dst = (Sint8 *) cvt->buf;
- const Sint8 *src = (Sint8 *) cvt->buf;
- const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
- Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
- Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
- Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
- Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
- Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
- Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
- Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
- Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
- while (dst < target) {
- const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
- const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
- const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
- const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
- const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
- const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
- const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
- const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
- src += 32;
- dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src--;
- dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[0] = (Uint16) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src += 2;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src--;
- dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Uint16) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src += 4;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 2;
- dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- src += 4;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 2;
- dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- src += 8;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 4;
- dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- src += 8;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 4;
- dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- src += 16;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 6;
- dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- src += 12;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 6;
- dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- src += 24;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
- Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
- const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 8;
- dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
- dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint16) sample7;
- dst[6] = (Uint16) sample6;
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
- Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
- const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
- src += 16;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
- Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
- const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- src -= 8;
- dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
- dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Uint16) sample7;
- dst[6] = (Uint16) sample6;
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
- Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
- Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
- const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
- const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
- src += 32;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src--;
- dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[0] = (Sint16) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src += 2;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src--;
- dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Sint16) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src += 4;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 2;
- dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- src += 4;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 2;
- dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- src += 8;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 4;
- dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- src += 8;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 4;
- dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- src += 16;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 6;
- dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- src += 12;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 6;
- dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- src += 24;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 8;
- dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
- dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint16) sample7;
- dst[6] = (Sint16) sample6;
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- src += 16;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- src -= 8;
- dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
- dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Sint16) sample7;
- dst[6] = (Sint16) sample6;
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
- src += 32;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src--;
- dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[0] = (Uint16) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src += 2;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src--;
- dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Uint16) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src += 4;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 2;
- dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- src += 4;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 2;
- dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- src += 8;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 4;
- dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- src += 8;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 4;
- dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- src += 16;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 6;
- dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- src += 12;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 6;
- dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- src += 24;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
- Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
- const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 8;
- dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
- dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Uint16) sample7;
- dst[6] = (Uint16) sample6;
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
- Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
- const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
- src += 16;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
- const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Uint16 *target = ((const Uint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
- Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
- const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- src -= 8;
- dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
- dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Uint16) sample7;
- dst[6] = (Uint16) sample6;
- dst[5] = (Uint16) sample5;
- dst[4] = (Uint16) sample4;
- dst[3] = (Uint16) sample3;
- dst[2] = (Uint16) sample2;
- dst[1] = (Uint16) sample1;
- dst[0] = (Uint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Uint16 *dst = (Uint16 *) cvt->buf;
- const Uint16 *src = (Uint16 *) cvt->buf;
- const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
- Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
- Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
- Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
- Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
- Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
- Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
- Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
- while (dst < target) {
- const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
- const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
- const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
- const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
- const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
- const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
- const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
- const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
- src += 32;
- dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src--;
- dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[0] = (Sint16) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src += 2;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src--;
- dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Sint16) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src += 4;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 2;
- dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- src += 4;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 2;
- dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- src += 8;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 4;
- dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- src += 8;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 4;
- dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- src += 16;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 6;
- dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- src += 12;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 6;
- dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- src += 24;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 8;
- dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
- dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint16) sample7;
- dst[6] = (Sint16) sample6;
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- src += 16;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
- const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint16 *target = ((const Sint16 *) cvt->buf);
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- while (dst >= target) {
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- src -= 8;
- dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
- dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Sint16) sample7;
- dst[6] = (Sint16) sample6;
- dst[5] = (Sint16) sample5;
- dst[4] = (Sint16) sample4;
- dst[3] = (Sint16) sample3;
- dst[2] = (Sint16) sample2;
- dst[1] = (Sint16) sample1;
- dst[0] = (Sint16) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint16 *dst = (Sint16 *) cvt->buf;
- const Sint16 *src = (Sint16 *) cvt->buf;
- const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
- Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- while (dst < target) {
- const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
- const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
- const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
- const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
- const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
- const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
- const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
- const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
- src += 32;
- dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src--;
- dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[0] = (Sint32) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src += 2;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src--;
- dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Sint32) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src += 4;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 2;
- dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- src += 4;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 2;
- dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- src += 8;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 4;
- dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- src += 8;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 4;
- dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- src += 16;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 6;
- dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- src += 12;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 6;
- dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- src += 24;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 8;
- dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
- dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint32) sample7;
- dst[6] = (Sint32) sample6;
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- src += 16;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- while (dst >= target) {
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- src -= 8;
- dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
- dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Sint32) sample7;
- dst[6] = (Sint32) sample6;
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
- src += 32;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src--;
- dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[0] = (Sint32) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src += 2;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src--;
- dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[0] = (Sint32) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src += 4;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 2;
- dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- src += 4;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 2;
- dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- src += 8;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 4;
- dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- src += 8;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 4;
- dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- src += 16;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 6;
- dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- src += 12;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 6;
- dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
- dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
- dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
- dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
- dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- src += 24;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 8;
- dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
- dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[7] = (Sint32) sample7;
- dst[6] = (Sint32) sample6;
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- src += 16;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
- const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
- const Sint32 *target = ((const Sint32 *) cvt->buf);
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- while (dst >= target) {
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- src -= 8;
- dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
- dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
- dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
- dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
- dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
- dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
- dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
- dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
- dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
- dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
- dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
- dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
- dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
- dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
- dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
- dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
- dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
- dst[7] = (Sint32) sample7;
- dst[6] = (Sint32) sample6;
- dst[5] = (Sint32) sample5;
- dst[4] = (Sint32) sample4;
- dst[3] = (Sint32) sample3;
- dst[2] = (Sint32) sample2;
- dst[1] = (Sint32) sample1;
- dst[0] = (Sint32) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- Sint32 *dst = (Sint32 *) cvt->buf;
- const Sint32 *src = (Sint32 *) cvt->buf;
- const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
- Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- while (dst < target) {
- const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
- const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
- const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
- const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
- const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
- const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
- const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
- const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
- src += 32;
- dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
- dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
- dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
- dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
- dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
- dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
- dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
- dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src--;
- dst[1] = (float) ((sample0 + last_sample0) * 0.5);
- dst[0] = (float) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src += 2;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src--;
- dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[2] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[0] = (float) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src += 4;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 2;
- dst[3] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- src += 4;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 2;
- dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[5] = (float) ((sample1 + last_sample1) * 0.5);
- dst[4] = (float) ((sample0 + last_sample0) * 0.5);
- dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- src += 8;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 4;
- dst[7] = (float) ((sample3 + last_sample3) * 0.5);
- dst[6] = (float) ((sample2 + last_sample2) * 0.5);
- dst[5] = (float) ((sample1 + last_sample1) * 0.5);
- dst[4] = (float) ((sample0 + last_sample0) * 0.5);
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- src += 8;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 4;
- dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[11] = (float) ((sample3 + last_sample3) * 0.5);
- dst[10] = (float) ((sample2 + last_sample2) * 0.5);
- dst[9] = (float) ((sample1 + last_sample1) * 0.5);
- dst[8] = (float) ((sample0 + last_sample0) * 0.5);
- dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- src += 16;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 6;
- dst[11] = (float) ((sample5 + last_sample5) * 0.5);
- dst[10] = (float) ((sample4 + last_sample4) * 0.5);
- dst[9] = (float) ((sample3 + last_sample3) * 0.5);
- dst[8] = (float) ((sample2 + last_sample2) * 0.5);
- dst[7] = (float) ((sample1 + last_sample1) * 0.5);
- dst[6] = (float) ((sample0 + last_sample0) * 0.5);
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- src += 12;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 6;
- dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
- dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
- dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[17] = (float) ((sample5 + last_sample5) * 0.5);
- dst[16] = (float) ((sample4 + last_sample4) * 0.5);
- dst[15] = (float) ((sample3 + last_sample3) * 0.5);
- dst[14] = (float) ((sample2 + last_sample2) * 0.5);
- dst[13] = (float) ((sample1 + last_sample1) * 0.5);
- dst[12] = (float) ((sample0 + last_sample0) * 0.5);
- dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
- dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
- dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- src += 24;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
- double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample7 = (double) SDL_SwapFloatLE(src[7]);
- const double sample6 = (double) SDL_SwapFloatLE(src[6]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 8;
- dst[15] = (float) ((sample7 + last_sample7) * 0.5);
- dst[14] = (float) ((sample6 + last_sample6) * 0.5);
- dst[13] = (float) ((sample5 + last_sample5) * 0.5);
- dst[12] = (float) ((sample4 + last_sample4) * 0.5);
- dst[11] = (float) ((sample3 + last_sample3) * 0.5);
- dst[10] = (float) ((sample2 + last_sample2) * 0.5);
- dst[9] = (float) ((sample1 + last_sample1) * 0.5);
- dst[8] = (float) ((sample0 + last_sample0) * 0.5);
- dst[7] = (float) sample7;
- dst[6] = (float) sample6;
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
- double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample6 = (double) SDL_SwapFloatLE(src[6]);
- const double sample7 = (double) SDL_SwapFloatLE(src[7]);
- src += 16;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- dst[6] = (float) ((sample6 + last_sample6) * 0.5);
- dst[7] = (float) ((sample7 + last_sample7) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
- double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- while (dst >= target) {
- const double sample7 = (double) SDL_SwapFloatLE(src[7]);
- const double sample6 = (double) SDL_SwapFloatLE(src[6]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- src -= 8;
- dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
- dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
- dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
- dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
- dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[23] = (float) ((sample7 + last_sample7) * 0.5);
- dst[22] = (float) ((sample6 + last_sample6) * 0.5);
- dst[21] = (float) ((sample5 + last_sample5) * 0.5);
- dst[20] = (float) ((sample4 + last_sample4) * 0.5);
- dst[19] = (float) ((sample3 + last_sample3) * 0.5);
- dst[18] = (float) ((sample2 + last_sample2) * 0.5);
- dst[17] = (float) ((sample1 + last_sample1) * 0.5);
- dst[16] = (float) ((sample0 + last_sample0) * 0.5);
- dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
- dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
- dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
- dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
- dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[7] = (float) sample7;
- dst[6] = (float) sample6;
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
- double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
- double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatLE(src[0]);
- const double sample1 = (double) SDL_SwapFloatLE(src[1]);
- const double sample2 = (double) SDL_SwapFloatLE(src[2]);
- const double sample3 = (double) SDL_SwapFloatLE(src[3]);
- const double sample4 = (double) SDL_SwapFloatLE(src[4]);
- const double sample5 = (double) SDL_SwapFloatLE(src[5]);
- const double sample6 = (double) SDL_SwapFloatLE(src[6]);
- const double sample7 = (double) SDL_SwapFloatLE(src[7]);
- src += 32;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- dst[6] = (float) ((sample6 + last_sample6) * 0.5);
- dst[7] = (float) ((sample7 + last_sample7) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src--;
- dst[1] = (float) ((sample0 + last_sample0) * 0.5);
- dst[0] = (float) sample0;
- last_sample0 = sample0;
- dst -= 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src += 2;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
- const float *target = ((const float *) cvt->buf);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src--;
- dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[2] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[0] = (float) sample0;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src += 4;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- last_sample0 = sample0;
- dst++;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 2;
- dst[3] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- src += 4;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
- const float *target = ((const float *) cvt->buf);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 2;
- dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[5] = (float) ((sample1 + last_sample1) * 0.5);
- dst[4] = (float) ((sample0 + last_sample0) * 0.5);
- dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- src += 8;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- dst += 2;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 4;
- dst[7] = (float) ((sample3 + last_sample3) * 0.5);
- dst[6] = (float) ((sample2 + last_sample2) * 0.5);
- dst[5] = (float) ((sample1 + last_sample1) * 0.5);
- dst[4] = (float) ((sample0 + last_sample0) * 0.5);
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- src += 8;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
- const float *target = ((const float *) cvt->buf);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 4;
- dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[11] = (float) ((sample3 + last_sample3) * 0.5);
- dst[10] = (float) ((sample2 + last_sample2) * 0.5);
- dst[9] = (float) ((sample1 + last_sample1) * 0.5);
- dst[8] = (float) ((sample0 + last_sample0) * 0.5);
- dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- src += 16;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- dst += 4;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 6;
- dst[11] = (float) ((sample5 + last_sample5) * 0.5);
- dst[10] = (float) ((sample4 + last_sample4) * 0.5);
- dst[9] = (float) ((sample3 + last_sample3) * 0.5);
- dst[8] = (float) ((sample2 + last_sample2) * 0.5);
- dst[7] = (float) ((sample1 + last_sample1) * 0.5);
- dst[6] = (float) ((sample0 + last_sample0) * 0.5);
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 12;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- src += 12;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
- const float *target = ((const float *) cvt->buf);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 6;
- dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
- dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
- dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[17] = (float) ((sample5 + last_sample5) * 0.5);
- dst[16] = (float) ((sample4 + last_sample4) * 0.5);
- dst[15] = (float) ((sample3 + last_sample3) * 0.5);
- dst[14] = (float) ((sample2 + last_sample2) * 0.5);
- dst[13] = (float) ((sample1 + last_sample1) * 0.5);
- dst[12] = (float) ((sample0 + last_sample0) * 0.5);
- dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
- dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
- dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 24;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- src += 24;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- dst += 6;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 2;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
- double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample7 = (double) SDL_SwapFloatBE(src[7]);
- const double sample6 = (double) SDL_SwapFloatBE(src[6]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 8;
- dst[15] = (float) ((sample7 + last_sample7) * 0.5);
- dst[14] = (float) ((sample6 + last_sample6) * 0.5);
- dst[13] = (float) ((sample5 + last_sample5) * 0.5);
- dst[12] = (float) ((sample4 + last_sample4) * 0.5);
- dst[11] = (float) ((sample3 + last_sample3) * 0.5);
- dst[10] = (float) ((sample2 + last_sample2) * 0.5);
- dst[9] = (float) ((sample1 + last_sample1) * 0.5);
- dst[8] = (float) ((sample0 + last_sample0) * 0.5);
- dst[7] = (float) sample7;
- dst[6] = (float) sample6;
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 16;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 2;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
- double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample6 = (double) SDL_SwapFloatBE(src[6]);
- const double sample7 = (double) SDL_SwapFloatBE(src[7]);
- src += 16;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- dst[6] = (float) ((sample6 + last_sample6) * 0.5);
- dst[7] = (float) ((sample7 + last_sample7) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt * 4;
- float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
- const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
- const float *target = ((const float *) cvt->buf);
- double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
- double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- while (dst >= target) {
- const double sample7 = (double) SDL_SwapFloatBE(src[7]);
- const double sample6 = (double) SDL_SwapFloatBE(src[6]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- src -= 8;
- dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
- dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
- dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
- dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
- dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
- dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
- dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
- dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
- dst[23] = (float) ((sample7 + last_sample7) * 0.5);
- dst[22] = (float) ((sample6 + last_sample6) * 0.5);
- dst[21] = (float) ((sample5 + last_sample5) * 0.5);
- dst[20] = (float) ((sample4 + last_sample4) * 0.5);
- dst[19] = (float) ((sample3 + last_sample3) * 0.5);
- dst[18] = (float) ((sample2 + last_sample2) * 0.5);
- dst[17] = (float) ((sample1 + last_sample1) * 0.5);
- dst[16] = (float) ((sample0 + last_sample0) * 0.5);
- dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
- dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
- dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
- dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
- dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
- dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
- dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
- dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
- dst[7] = (float) sample7;
- dst[6] = (float) sample6;
- dst[5] = (float) sample5;
- dst[4] = (float) sample4;
- dst[3] = (float) sample3;
- dst[2] = (float) sample2;
- dst[1] = (float) sample1;
- dst[0] = (float) sample0;
- last_sample7 = sample7;
- last_sample6 = sample6;
- last_sample5 = sample5;
- last_sample4 = sample4;
- last_sample3 = sample3;
- last_sample2 = sample2;
- last_sample1 = sample1;
- last_sample0 = sample0;
- dst -= 32;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
- fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
- const int dstsize = cvt->len_cvt / 4;
- float *dst = (float *) cvt->buf;
- const float *src = (float *) cvt->buf;
- const float *target = (const float *) (cvt->buf + dstsize);
- double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
- double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
- double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
- double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
- double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
- double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
- double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
- double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
- while (dst < target) {
- const double sample0 = (double) SDL_SwapFloatBE(src[0]);
- const double sample1 = (double) SDL_SwapFloatBE(src[1]);
- const double sample2 = (double) SDL_SwapFloatBE(src[2]);
- const double sample3 = (double) SDL_SwapFloatBE(src[3]);
- const double sample4 = (double) SDL_SwapFloatBE(src[4]);
- const double sample5 = (double) SDL_SwapFloatBE(src[5]);
- const double sample6 = (double) SDL_SwapFloatBE(src[6]);
- const double sample7 = (double) SDL_SwapFloatBE(src[7]);
- src += 32;
- dst[0] = (float) ((sample0 + last_sample0) * 0.5);
- dst[1] = (float) ((sample1 + last_sample1) * 0.5);
- dst[2] = (float) ((sample2 + last_sample2) * 0.5);
- dst[3] = (float) ((sample3 + last_sample3) * 0.5);
- dst[4] = (float) ((sample4 + last_sample4) * 0.5);
- dst[5] = (float) ((sample5 + last_sample5) * 0.5);
- dst[6] = (float) ((sample6 + last_sample6) * 0.5);
- dst[7] = (float) ((sample7 + last_sample7) * 0.5);
- last_sample0 = sample0;
- last_sample1 = sample1;
- last_sample2 = sample2;
- last_sample3 = sample3;
- last_sample4 = sample4;
- last_sample5 = sample5;
- last_sample6 = sample6;
- last_sample7 = sample7;
- dst += 8;
- }
-
- cvt->len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-#endif /* !LESS_RESAMPLERS */
-#endif /* !NO_RESAMPLERS */
-
-
-const SDL_AudioRateFilters sdl_audio_rate_filters[] =
-{
-#if !NO_RESAMPLERS
- { AUDIO_U8, 1, 0, 0, SDL_Downsample_U8_1c },
- { AUDIO_U8, 1, 1, 0, SDL_Upsample_U8_1c },
- { AUDIO_U8, 2, 0, 0, SDL_Downsample_U8_2c },
- { AUDIO_U8, 2, 1, 0, SDL_Upsample_U8_2c },
- { AUDIO_U8, 4, 0, 0, SDL_Downsample_U8_4c },
- { AUDIO_U8, 4, 1, 0, SDL_Upsample_U8_4c },
- { AUDIO_U8, 6, 0, 0, SDL_Downsample_U8_6c },
- { AUDIO_U8, 6, 1, 0, SDL_Upsample_U8_6c },
- { AUDIO_U8, 8, 0, 0, SDL_Downsample_U8_8c },
- { AUDIO_U8, 8, 1, 0, SDL_Upsample_U8_8c },
- { AUDIO_S8, 1, 0, 0, SDL_Downsample_S8_1c },
- { AUDIO_S8, 1, 1, 0, SDL_Upsample_S8_1c },
- { AUDIO_S8, 2, 0, 0, SDL_Downsample_S8_2c },
- { AUDIO_S8, 2, 1, 0, SDL_Upsample_S8_2c },
- { AUDIO_S8, 4, 0, 0, SDL_Downsample_S8_4c },
- { AUDIO_S8, 4, 1, 0, SDL_Upsample_S8_4c },
- { AUDIO_S8, 6, 0, 0, SDL_Downsample_S8_6c },
- { AUDIO_S8, 6, 1, 0, SDL_Upsample_S8_6c },
- { AUDIO_S8, 8, 0, 0, SDL_Downsample_S8_8c },
- { AUDIO_S8, 8, 1, 0, SDL_Upsample_S8_8c },
- { AUDIO_U16LSB, 1, 0, 0, SDL_Downsample_U16LSB_1c },
- { AUDIO_U16LSB, 1, 1, 0, SDL_Upsample_U16LSB_1c },
- { AUDIO_U16LSB, 2, 0, 0, SDL_Downsample_U16LSB_2c },
- { AUDIO_U16LSB, 2, 1, 0, SDL_Upsample_U16LSB_2c },
- { AUDIO_U16LSB, 4, 0, 0, SDL_Downsample_U16LSB_4c },
- { AUDIO_U16LSB, 4, 1, 0, SDL_Upsample_U16LSB_4c },
- { AUDIO_U16LSB, 6, 0, 0, SDL_Downsample_U16LSB_6c },
- { AUDIO_U16LSB, 6, 1, 0, SDL_Upsample_U16LSB_6c },
- { AUDIO_U16LSB, 8, 0, 0, SDL_Downsample_U16LSB_8c },
- { AUDIO_U16LSB, 8, 1, 0, SDL_Upsample_U16LSB_8c },
- { AUDIO_S16LSB, 1, 0, 0, SDL_Downsample_S16LSB_1c },
- { AUDIO_S16LSB, 1, 1, 0, SDL_Upsample_S16LSB_1c },
- { AUDIO_S16LSB, 2, 0, 0, SDL_Downsample_S16LSB_2c },
- { AUDIO_S16LSB, 2, 1, 0, SDL_Upsample_S16LSB_2c },
- { AUDIO_S16LSB, 4, 0, 0, SDL_Downsample_S16LSB_4c },
- { AUDIO_S16LSB, 4, 1, 0, SDL_Upsample_S16LSB_4c },
- { AUDIO_S16LSB, 6, 0, 0, SDL_Downsample_S16LSB_6c },
- { AUDIO_S16LSB, 6, 1, 0, SDL_Upsample_S16LSB_6c },
- { AUDIO_S16LSB, 8, 0, 0, SDL_Downsample_S16LSB_8c },
- { AUDIO_S16LSB, 8, 1, 0, SDL_Upsample_S16LSB_8c },
- { AUDIO_U16MSB, 1, 0, 0, SDL_Downsample_U16MSB_1c },
- { AUDIO_U16MSB, 1, 1, 0, SDL_Upsample_U16MSB_1c },
- { AUDIO_U16MSB, 2, 0, 0, SDL_Downsample_U16MSB_2c },
- { AUDIO_U16MSB, 2, 1, 0, SDL_Upsample_U16MSB_2c },
- { AUDIO_U16MSB, 4, 0, 0, SDL_Downsample_U16MSB_4c },
- { AUDIO_U16MSB, 4, 1, 0, SDL_Upsample_U16MSB_4c },
- { AUDIO_U16MSB, 6, 0, 0, SDL_Downsample_U16MSB_6c },
- { AUDIO_U16MSB, 6, 1, 0, SDL_Upsample_U16MSB_6c },
- { AUDIO_U16MSB, 8, 0, 0, SDL_Downsample_U16MSB_8c },
- { AUDIO_U16MSB, 8, 1, 0, SDL_Upsample_U16MSB_8c },
- { AUDIO_S16MSB, 1, 0, 0, SDL_Downsample_S16MSB_1c },
- { AUDIO_S16MSB, 1, 1, 0, SDL_Upsample_S16MSB_1c },
- { AUDIO_S16MSB, 2, 0, 0, SDL_Downsample_S16MSB_2c },
- { AUDIO_S16MSB, 2, 1, 0, SDL_Upsample_S16MSB_2c },
- { AUDIO_S16MSB, 4, 0, 0, SDL_Downsample_S16MSB_4c },
- { AUDIO_S16MSB, 4, 1, 0, SDL_Upsample_S16MSB_4c },
- { AUDIO_S16MSB, 6, 0, 0, SDL_Downsample_S16MSB_6c },
- { AUDIO_S16MSB, 6, 1, 0, SDL_Upsample_S16MSB_6c },
- { AUDIO_S16MSB, 8, 0, 0, SDL_Downsample_S16MSB_8c },
- { AUDIO_S16MSB, 8, 1, 0, SDL_Upsample_S16MSB_8c },
- { AUDIO_S32LSB, 1, 0, 0, SDL_Downsample_S32LSB_1c },
- { AUDIO_S32LSB, 1, 1, 0, SDL_Upsample_S32LSB_1c },
- { AUDIO_S32LSB, 2, 0, 0, SDL_Downsample_S32LSB_2c },
- { AUDIO_S32LSB, 2, 1, 0, SDL_Upsample_S32LSB_2c },
- { AUDIO_S32LSB, 4, 0, 0, SDL_Downsample_S32LSB_4c },
- { AUDIO_S32LSB, 4, 1, 0, SDL_Upsample_S32LSB_4c },
- { AUDIO_S32LSB, 6, 0, 0, SDL_Downsample_S32LSB_6c },
- { AUDIO_S32LSB, 6, 1, 0, SDL_Upsample_S32LSB_6c },
- { AUDIO_S32LSB, 8, 0, 0, SDL_Downsample_S32LSB_8c },
- { AUDIO_S32LSB, 8, 1, 0, SDL_Upsample_S32LSB_8c },
- { AUDIO_S32MSB, 1, 0, 0, SDL_Downsample_S32MSB_1c },
- { AUDIO_S32MSB, 1, 1, 0, SDL_Upsample_S32MSB_1c },
- { AUDIO_S32MSB, 2, 0, 0, SDL_Downsample_S32MSB_2c },
- { AUDIO_S32MSB, 2, 1, 0, SDL_Upsample_S32MSB_2c },
- { AUDIO_S32MSB, 4, 0, 0, SDL_Downsample_S32MSB_4c },
- { AUDIO_S32MSB, 4, 1, 0, SDL_Upsample_S32MSB_4c },
- { AUDIO_S32MSB, 6, 0, 0, SDL_Downsample_S32MSB_6c },
- { AUDIO_S32MSB, 6, 1, 0, SDL_Upsample_S32MSB_6c },
- { AUDIO_S32MSB, 8, 0, 0, SDL_Downsample_S32MSB_8c },
- { AUDIO_S32MSB, 8, 1, 0, SDL_Upsample_S32MSB_8c },
- { AUDIO_F32LSB, 1, 0, 0, SDL_Downsample_F32LSB_1c },
- { AUDIO_F32LSB, 1, 1, 0, SDL_Upsample_F32LSB_1c },
- { AUDIO_F32LSB, 2, 0, 0, SDL_Downsample_F32LSB_2c },
- { AUDIO_F32LSB, 2, 1, 0, SDL_Upsample_F32LSB_2c },
- { AUDIO_F32LSB, 4, 0, 0, SDL_Downsample_F32LSB_4c },
- { AUDIO_F32LSB, 4, 1, 0, SDL_Upsample_F32LSB_4c },
- { AUDIO_F32LSB, 6, 0, 0, SDL_Downsample_F32LSB_6c },
- { AUDIO_F32LSB, 6, 1, 0, SDL_Upsample_F32LSB_6c },
- { AUDIO_F32LSB, 8, 0, 0, SDL_Downsample_F32LSB_8c },
- { AUDIO_F32LSB, 8, 1, 0, SDL_Upsample_F32LSB_8c },
- { AUDIO_F32MSB, 1, 0, 0, SDL_Downsample_F32MSB_1c },
- { AUDIO_F32MSB, 1, 1, 0, SDL_Upsample_F32MSB_1c },
- { AUDIO_F32MSB, 2, 0, 0, SDL_Downsample_F32MSB_2c },
- { AUDIO_F32MSB, 2, 1, 0, SDL_Upsample_F32MSB_2c },
- { AUDIO_F32MSB, 4, 0, 0, SDL_Downsample_F32MSB_4c },
- { AUDIO_F32MSB, 4, 1, 0, SDL_Upsample_F32MSB_4c },
- { AUDIO_F32MSB, 6, 0, 0, SDL_Downsample_F32MSB_6c },
- { AUDIO_F32MSB, 6, 1, 0, SDL_Upsample_F32MSB_6c },
- { AUDIO_F32MSB, 8, 0, 0, SDL_Downsample_F32MSB_8c },
- { AUDIO_F32MSB, 8, 1, 0, SDL_Upsample_F32MSB_8c },
-#if !LESS_RESAMPLERS
- { AUDIO_U8, 1, 0, 2, SDL_Downsample_U8_1c_x2 },
- { AUDIO_U8, 1, 1, 2, SDL_Upsample_U8_1c_x2 },
- { AUDIO_U8, 1, 0, 4, SDL_Downsample_U8_1c_x4 },
- { AUDIO_U8, 1, 1, 4, SDL_Upsample_U8_1c_x4 },
- { AUDIO_U8, 2, 0, 2, SDL_Downsample_U8_2c_x2 },
- { AUDIO_U8, 2, 1, 2, SDL_Upsample_U8_2c_x2 },
- { AUDIO_U8, 2, 0, 4, SDL_Downsample_U8_2c_x4 },
- { AUDIO_U8, 2, 1, 4, SDL_Upsample_U8_2c_x4 },
- { AUDIO_U8, 4, 0, 2, SDL_Downsample_U8_4c_x2 },
- { AUDIO_U8, 4, 1, 2, SDL_Upsample_U8_4c_x2 },
- { AUDIO_U8, 4, 0, 4, SDL_Downsample_U8_4c_x4 },
- { AUDIO_U8, 4, 1, 4, SDL_Upsample_U8_4c_x4 },
- { AUDIO_U8, 6, 0, 2, SDL_Downsample_U8_6c_x2 },
- { AUDIO_U8, 6, 1, 2, SDL_Upsample_U8_6c_x2 },
- { AUDIO_U8, 6, 0, 4, SDL_Downsample_U8_6c_x4 },
- { AUDIO_U8, 6, 1, 4, SDL_Upsample_U8_6c_x4 },
- { AUDIO_U8, 8, 0, 2, SDL_Downsample_U8_8c_x2 },
- { AUDIO_U8, 8, 1, 2, SDL_Upsample_U8_8c_x2 },
- { AUDIO_U8, 8, 0, 4, SDL_Downsample_U8_8c_x4 },
- { AUDIO_U8, 8, 1, 4, SDL_Upsample_U8_8c_x4 },
- { AUDIO_S8, 1, 0, 2, SDL_Downsample_S8_1c_x2 },
- { AUDIO_S8, 1, 1, 2, SDL_Upsample_S8_1c_x2 },
- { AUDIO_S8, 1, 0, 4, SDL_Downsample_S8_1c_x4 },
- { AUDIO_S8, 1, 1, 4, SDL_Upsample_S8_1c_x4 },
- { AUDIO_S8, 2, 0, 2, SDL_Downsample_S8_2c_x2 },
- { AUDIO_S8, 2, 1, 2, SDL_Upsample_S8_2c_x2 },
- { AUDIO_S8, 2, 0, 4, SDL_Downsample_S8_2c_x4 },
- { AUDIO_S8, 2, 1, 4, SDL_Upsample_S8_2c_x4 },
- { AUDIO_S8, 4, 0, 2, SDL_Downsample_S8_4c_x2 },
- { AUDIO_S8, 4, 1, 2, SDL_Upsample_S8_4c_x2 },
- { AUDIO_S8, 4, 0, 4, SDL_Downsample_S8_4c_x4 },
- { AUDIO_S8, 4, 1, 4, SDL_Upsample_S8_4c_x4 },
- { AUDIO_S8, 6, 0, 2, SDL_Downsample_S8_6c_x2 },
- { AUDIO_S8, 6, 1, 2, SDL_Upsample_S8_6c_x2 },
- { AUDIO_S8, 6, 0, 4, SDL_Downsample_S8_6c_x4 },
- { AUDIO_S8, 6, 1, 4, SDL_Upsample_S8_6c_x4 },
- { AUDIO_S8, 8, 0, 2, SDL_Downsample_S8_8c_x2 },
- { AUDIO_S8, 8, 1, 2, SDL_Upsample_S8_8c_x2 },
- { AUDIO_S8, 8, 0, 4, SDL_Downsample_S8_8c_x4 },
- { AUDIO_S8, 8, 1, 4, SDL_Upsample_S8_8c_x4 },
- { AUDIO_U16LSB, 1, 0, 2, SDL_Downsample_U16LSB_1c_x2 },
- { AUDIO_U16LSB, 1, 1, 2, SDL_Upsample_U16LSB_1c_x2 },
- { AUDIO_U16LSB, 1, 0, 4, SDL_Downsample_U16LSB_1c_x4 },
- { AUDIO_U16LSB, 1, 1, 4, SDL_Upsample_U16LSB_1c_x4 },
- { AUDIO_U16LSB, 2, 0, 2, SDL_Downsample_U16LSB_2c_x2 },
- { AUDIO_U16LSB, 2, 1, 2, SDL_Upsample_U16LSB_2c_x2 },
- { AUDIO_U16LSB, 2, 0, 4, SDL_Downsample_U16LSB_2c_x4 },
- { AUDIO_U16LSB, 2, 1, 4, SDL_Upsample_U16LSB_2c_x4 },
- { AUDIO_U16LSB, 4, 0, 2, SDL_Downsample_U16LSB_4c_x2 },
- { AUDIO_U16LSB, 4, 1, 2, SDL_Upsample_U16LSB_4c_x2 },
- { AUDIO_U16LSB, 4, 0, 4, SDL_Downsample_U16LSB_4c_x4 },
- { AUDIO_U16LSB, 4, 1, 4, SDL_Upsample_U16LSB_4c_x4 },
- { AUDIO_U16LSB, 6, 0, 2, SDL_Downsample_U16LSB_6c_x2 },
- { AUDIO_U16LSB, 6, 1, 2, SDL_Upsample_U16LSB_6c_x2 },
- { AUDIO_U16LSB, 6, 0, 4, SDL_Downsample_U16LSB_6c_x4 },
- { AUDIO_U16LSB, 6, 1, 4, SDL_Upsample_U16LSB_6c_x4 },
- { AUDIO_U16LSB, 8, 0, 2, SDL_Downsample_U16LSB_8c_x2 },
- { AUDIO_U16LSB, 8, 1, 2, SDL_Upsample_U16LSB_8c_x2 },
- { AUDIO_U16LSB, 8, 0, 4, SDL_Downsample_U16LSB_8c_x4 },
- { AUDIO_U16LSB, 8, 1, 4, SDL_Upsample_U16LSB_8c_x4 },
- { AUDIO_S16LSB, 1, 0, 2, SDL_Downsample_S16LSB_1c_x2 },
- { AUDIO_S16LSB, 1, 1, 2, SDL_Upsample_S16LSB_1c_x2 },
- { AUDIO_S16LSB, 1, 0, 4, SDL_Downsample_S16LSB_1c_x4 },
- { AUDIO_S16LSB, 1, 1, 4, SDL_Upsample_S16LSB_1c_x4 },
- { AUDIO_S16LSB, 2, 0, 2, SDL_Downsample_S16LSB_2c_x2 },
- { AUDIO_S16LSB, 2, 1, 2, SDL_Upsample_S16LSB_2c_x2 },
- { AUDIO_S16LSB, 2, 0, 4, SDL_Downsample_S16LSB_2c_x4 },
- { AUDIO_S16LSB, 2, 1, 4, SDL_Upsample_S16LSB_2c_x4 },
- { AUDIO_S16LSB, 4, 0, 2, SDL_Downsample_S16LSB_4c_x2 },
- { AUDIO_S16LSB, 4, 1, 2, SDL_Upsample_S16LSB_4c_x2 },
- { AUDIO_S16LSB, 4, 0, 4, SDL_Downsample_S16LSB_4c_x4 },
- { AUDIO_S16LSB, 4, 1, 4, SDL_Upsample_S16LSB_4c_x4 },
- { AUDIO_S16LSB, 6, 0, 2, SDL_Downsample_S16LSB_6c_x2 },
- { AUDIO_S16LSB, 6, 1, 2, SDL_Upsample_S16LSB_6c_x2 },
- { AUDIO_S16LSB, 6, 0, 4, SDL_Downsample_S16LSB_6c_x4 },
- { AUDIO_S16LSB, 6, 1, 4, SDL_Upsample_S16LSB_6c_x4 },
- { AUDIO_S16LSB, 8, 0, 2, SDL_Downsample_S16LSB_8c_x2 },
- { AUDIO_S16LSB, 8, 1, 2, SDL_Upsample_S16LSB_8c_x2 },
- { AUDIO_S16LSB, 8, 0, 4, SDL_Downsample_S16LSB_8c_x4 },
- { AUDIO_S16LSB, 8, 1, 4, SDL_Upsample_S16LSB_8c_x4 },
- { AUDIO_U16MSB, 1, 0, 2, SDL_Downsample_U16MSB_1c_x2 },
- { AUDIO_U16MSB, 1, 1, 2, SDL_Upsample_U16MSB_1c_x2 },
- { AUDIO_U16MSB, 1, 0, 4, SDL_Downsample_U16MSB_1c_x4 },
- { AUDIO_U16MSB, 1, 1, 4, SDL_Upsample_U16MSB_1c_x4 },
- { AUDIO_U16MSB, 2, 0, 2, SDL_Downsample_U16MSB_2c_x2 },
- { AUDIO_U16MSB, 2, 1, 2, SDL_Upsample_U16MSB_2c_x2 },
- { AUDIO_U16MSB, 2, 0, 4, SDL_Downsample_U16MSB_2c_x4 },
- { AUDIO_U16MSB, 2, 1, 4, SDL_Upsample_U16MSB_2c_x4 },
- { AUDIO_U16MSB, 4, 0, 2, SDL_Downsample_U16MSB_4c_x2 },
- { AUDIO_U16MSB, 4, 1, 2, SDL_Upsample_U16MSB_4c_x2 },
- { AUDIO_U16MSB, 4, 0, 4, SDL_Downsample_U16MSB_4c_x4 },
- { AUDIO_U16MSB, 4, 1, 4, SDL_Upsample_U16MSB_4c_x4 },
- { AUDIO_U16MSB, 6, 0, 2, SDL_Downsample_U16MSB_6c_x2 },
- { AUDIO_U16MSB, 6, 1, 2, SDL_Upsample_U16MSB_6c_x2 },
- { AUDIO_U16MSB, 6, 0, 4, SDL_Downsample_U16MSB_6c_x4 },
- { AUDIO_U16MSB, 6, 1, 4, SDL_Upsample_U16MSB_6c_x4 },
- { AUDIO_U16MSB, 8, 0, 2, SDL_Downsample_U16MSB_8c_x2 },
- { AUDIO_U16MSB, 8, 1, 2, SDL_Upsample_U16MSB_8c_x2 },
- { AUDIO_U16MSB, 8, 0, 4, SDL_Downsample_U16MSB_8c_x4 },
- { AUDIO_U16MSB, 8, 1, 4, SDL_Upsample_U16MSB_8c_x4 },
- { AUDIO_S16MSB, 1, 0, 2, SDL_Downsample_S16MSB_1c_x2 },
- { AUDIO_S16MSB, 1, 1, 2, SDL_Upsample_S16MSB_1c_x2 },
- { AUDIO_S16MSB, 1, 0, 4, SDL_Downsample_S16MSB_1c_x4 },
- { AUDIO_S16MSB, 1, 1, 4, SDL_Upsample_S16MSB_1c_x4 },
- { AUDIO_S16MSB, 2, 0, 2, SDL_Downsample_S16MSB_2c_x2 },
- { AUDIO_S16MSB, 2, 1, 2, SDL_Upsample_S16MSB_2c_x2 },
- { AUDIO_S16MSB, 2, 0, 4, SDL_Downsample_S16MSB_2c_x4 },
- { AUDIO_S16MSB, 2, 1, 4, SDL_Upsample_S16MSB_2c_x4 },
- { AUDIO_S16MSB, 4, 0, 2, SDL_Downsample_S16MSB_4c_x2 },
- { AUDIO_S16MSB, 4, 1, 2, SDL_Upsample_S16MSB_4c_x2 },
- { AUDIO_S16MSB, 4, 0, 4, SDL_Downsample_S16MSB_4c_x4 },
- { AUDIO_S16MSB, 4, 1, 4, SDL_Upsample_S16MSB_4c_x4 },
- { AUDIO_S16MSB, 6, 0, 2, SDL_Downsample_S16MSB_6c_x2 },
- { AUDIO_S16MSB, 6, 1, 2, SDL_Upsample_S16MSB_6c_x2 },
- { AUDIO_S16MSB, 6, 0, 4, SDL_Downsample_S16MSB_6c_x4 },
- { AUDIO_S16MSB, 6, 1, 4, SDL_Upsample_S16MSB_6c_x4 },
- { AUDIO_S16MSB, 8, 0, 2, SDL_Downsample_S16MSB_8c_x2 },
- { AUDIO_S16MSB, 8, 1, 2, SDL_Upsample_S16MSB_8c_x2 },
- { AUDIO_S16MSB, 8, 0, 4, SDL_Downsample_S16MSB_8c_x4 },
- { AUDIO_S16MSB, 8, 1, 4, SDL_Upsample_S16MSB_8c_x4 },
- { AUDIO_S32LSB, 1, 0, 2, SDL_Downsample_S32LSB_1c_x2 },
- { AUDIO_S32LSB, 1, 1, 2, SDL_Upsample_S32LSB_1c_x2 },
- { AUDIO_S32LSB, 1, 0, 4, SDL_Downsample_S32LSB_1c_x4 },
- { AUDIO_S32LSB, 1, 1, 4, SDL_Upsample_S32LSB_1c_x4 },
- { AUDIO_S32LSB, 2, 0, 2, SDL_Downsample_S32LSB_2c_x2 },
- { AUDIO_S32LSB, 2, 1, 2, SDL_Upsample_S32LSB_2c_x2 },
- { AUDIO_S32LSB, 2, 0, 4, SDL_Downsample_S32LSB_2c_x4 },
- { AUDIO_S32LSB, 2, 1, 4, SDL_Upsample_S32LSB_2c_x4 },
- { AUDIO_S32LSB, 4, 0, 2, SDL_Downsample_S32LSB_4c_x2 },
- { AUDIO_S32LSB, 4, 1, 2, SDL_Upsample_S32LSB_4c_x2 },
- { AUDIO_S32LSB, 4, 0, 4, SDL_Downsample_S32LSB_4c_x4 },
- { AUDIO_S32LSB, 4, 1, 4, SDL_Upsample_S32LSB_4c_x4 },
- { AUDIO_S32LSB, 6, 0, 2, SDL_Downsample_S32LSB_6c_x2 },
- { AUDIO_S32LSB, 6, 1, 2, SDL_Upsample_S32LSB_6c_x2 },
- { AUDIO_S32LSB, 6, 0, 4, SDL_Downsample_S32LSB_6c_x4 },
- { AUDIO_S32LSB, 6, 1, 4, SDL_Upsample_S32LSB_6c_x4 },
- { AUDIO_S32LSB, 8, 0, 2, SDL_Downsample_S32LSB_8c_x2 },
- { AUDIO_S32LSB, 8, 1, 2, SDL_Upsample_S32LSB_8c_x2 },
- { AUDIO_S32LSB, 8, 0, 4, SDL_Downsample_S32LSB_8c_x4 },
- { AUDIO_S32LSB, 8, 1, 4, SDL_Upsample_S32LSB_8c_x4 },
- { AUDIO_S32MSB, 1, 0, 2, SDL_Downsample_S32MSB_1c_x2 },
- { AUDIO_S32MSB, 1, 1, 2, SDL_Upsample_S32MSB_1c_x2 },
- { AUDIO_S32MSB, 1, 0, 4, SDL_Downsample_S32MSB_1c_x4 },
- { AUDIO_S32MSB, 1, 1, 4, SDL_Upsample_S32MSB_1c_x4 },
- { AUDIO_S32MSB, 2, 0, 2, SDL_Downsample_S32MSB_2c_x2 },
- { AUDIO_S32MSB, 2, 1, 2, SDL_Upsample_S32MSB_2c_x2 },
- { AUDIO_S32MSB, 2, 0, 4, SDL_Downsample_S32MSB_2c_x4 },
- { AUDIO_S32MSB, 2, 1, 4, SDL_Upsample_S32MSB_2c_x4 },
- { AUDIO_S32MSB, 4, 0, 2, SDL_Downsample_S32MSB_4c_x2 },
- { AUDIO_S32MSB, 4, 1, 2, SDL_Upsample_S32MSB_4c_x2 },
- { AUDIO_S32MSB, 4, 0, 4, SDL_Downsample_S32MSB_4c_x4 },
- { AUDIO_S32MSB, 4, 1, 4, SDL_Upsample_S32MSB_4c_x4 },
- { AUDIO_S32MSB, 6, 0, 2, SDL_Downsample_S32MSB_6c_x2 },
- { AUDIO_S32MSB, 6, 1, 2, SDL_Upsample_S32MSB_6c_x2 },
- { AUDIO_S32MSB, 6, 0, 4, SDL_Downsample_S32MSB_6c_x4 },
- { AUDIO_S32MSB, 6, 1, 4, SDL_Upsample_S32MSB_6c_x4 },
- { AUDIO_S32MSB, 8, 0, 2, SDL_Downsample_S32MSB_8c_x2 },
- { AUDIO_S32MSB, 8, 1, 2, SDL_Upsample_S32MSB_8c_x2 },
- { AUDIO_S32MSB, 8, 0, 4, SDL_Downsample_S32MSB_8c_x4 },
- { AUDIO_S32MSB, 8, 1, 4, SDL_Upsample_S32MSB_8c_x4 },
- { AUDIO_F32LSB, 1, 0, 2, SDL_Downsample_F32LSB_1c_x2 },
- { AUDIO_F32LSB, 1, 1, 2, SDL_Upsample_F32LSB_1c_x2 },
- { AUDIO_F32LSB, 1, 0, 4, SDL_Downsample_F32LSB_1c_x4 },
- { AUDIO_F32LSB, 1, 1, 4, SDL_Upsample_F32LSB_1c_x4 },
- { AUDIO_F32LSB, 2, 0, 2, SDL_Downsample_F32LSB_2c_x2 },
- { AUDIO_F32LSB, 2, 1, 2, SDL_Upsample_F32LSB_2c_x2 },
- { AUDIO_F32LSB, 2, 0, 4, SDL_Downsample_F32LSB_2c_x4 },
- { AUDIO_F32LSB, 2, 1, 4, SDL_Upsample_F32LSB_2c_x4 },
- { AUDIO_F32LSB, 4, 0, 2, SDL_Downsample_F32LSB_4c_x2 },
- { AUDIO_F32LSB, 4, 1, 2, SDL_Upsample_F32LSB_4c_x2 },
- { AUDIO_F32LSB, 4, 0, 4, SDL_Downsample_F32LSB_4c_x4 },
- { AUDIO_F32LSB, 4, 1, 4, SDL_Upsample_F32LSB_4c_x4 },
- { AUDIO_F32LSB, 6, 0, 2, SDL_Downsample_F32LSB_6c_x2 },
- { AUDIO_F32LSB, 6, 1, 2, SDL_Upsample_F32LSB_6c_x2 },
- { AUDIO_F32LSB, 6, 0, 4, SDL_Downsample_F32LSB_6c_x4 },
- { AUDIO_F32LSB, 6, 1, 4, SDL_Upsample_F32LSB_6c_x4 },
- { AUDIO_F32LSB, 8, 0, 2, SDL_Downsample_F32LSB_8c_x2 },
- { AUDIO_F32LSB, 8, 1, 2, SDL_Upsample_F32LSB_8c_x2 },
- { AUDIO_F32LSB, 8, 0, 4, SDL_Downsample_F32LSB_8c_x4 },
- { AUDIO_F32LSB, 8, 1, 4, SDL_Upsample_F32LSB_8c_x4 },
- { AUDIO_F32MSB, 1, 0, 2, SDL_Downsample_F32MSB_1c_x2 },
- { AUDIO_F32MSB, 1, 1, 2, SDL_Upsample_F32MSB_1c_x2 },
- { AUDIO_F32MSB, 1, 0, 4, SDL_Downsample_F32MSB_1c_x4 },
- { AUDIO_F32MSB, 1, 1, 4, SDL_Upsample_F32MSB_1c_x4 },
- { AUDIO_F32MSB, 2, 0, 2, SDL_Downsample_F32MSB_2c_x2 },
- { AUDIO_F32MSB, 2, 1, 2, SDL_Upsample_F32MSB_2c_x2 },
- { AUDIO_F32MSB, 2, 0, 4, SDL_Downsample_F32MSB_2c_x4 },
- { AUDIO_F32MSB, 2, 1, 4, SDL_Upsample_F32MSB_2c_x4 },
- { AUDIO_F32MSB, 4, 0, 2, SDL_Downsample_F32MSB_4c_x2 },
- { AUDIO_F32MSB, 4, 1, 2, SDL_Upsample_F32MSB_4c_x2 },
- { AUDIO_F32MSB, 4, 0, 4, SDL_Downsample_F32MSB_4c_x4 },
- { AUDIO_F32MSB, 4, 1, 4, SDL_Upsample_F32MSB_4c_x4 },
- { AUDIO_F32MSB, 6, 0, 2, SDL_Downsample_F32MSB_6c_x2 },
- { AUDIO_F32MSB, 6, 1, 2, SDL_Upsample_F32MSB_6c_x2 },
- { AUDIO_F32MSB, 6, 0, 4, SDL_Downsample_F32MSB_6c_x4 },
- { AUDIO_F32MSB, 6, 1, 4, SDL_Upsample_F32MSB_6c_x4 },
- { AUDIO_F32MSB, 8, 0, 2, SDL_Downsample_F32MSB_8c_x2 },
- { AUDIO_F32MSB, 8, 1, 2, SDL_Upsample_F32MSB_8c_x2 },
- { AUDIO_F32MSB, 8, 0, 4, SDL_Downsample_F32MSB_8c_x4 },
- { AUDIO_F32MSB, 8, 1, 4, SDL_Upsample_F32MSB_8c_x4 },
-#endif /* !LESS_RESAMPLERS */
-#endif /* !NO_RESAMPLERS */
- { 0, 0, 0, 0, NULL }
-};
-
-/* 390 converters generated. */
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/alsa/SDL_alsa_audio.c b/3rdparty/sdl2-2.0.4/src/audio/alsa/SDL_alsa_audio.c
deleted file mode 100644
index af952371b4..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/alsa/SDL_alsa_audio.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_AUDIO_DRIVER_ALSA
-
-/* Allow access to a raw mixing buffer */
-
-#include
-#include /* For kill() */
-#include
-#include
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_alsa_audio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#include "SDL_loadso.h"
-#endif
-
-static int (*ALSA_snd_pcm_open)
- (snd_pcm_t **, const char *, snd_pcm_stream_t, int);
-static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm);
-static snd_pcm_sframes_t(*ALSA_snd_pcm_writei)
- (snd_pcm_t *, const void *, snd_pcm_uframes_t);
-static int (*ALSA_snd_pcm_recover) (snd_pcm_t *, int, int);
-static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *);
-static int (*ALSA_snd_pcm_drain) (snd_pcm_t *);
-static const char *(*ALSA_snd_strerror) (int);
-static size_t(*ALSA_snd_pcm_hw_params_sizeof) (void);
-static size_t(*ALSA_snd_pcm_sw_params_sizeof) (void);
-static void (*ALSA_snd_pcm_hw_params_copy)
- (snd_pcm_hw_params_t *, const snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_hw_params_set_access)
- (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t);
-static int (*ALSA_snd_pcm_hw_params_set_format)
- (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t);
-static int (*ALSA_snd_pcm_hw_params_set_channels)
- (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int);
-static int (*ALSA_snd_pcm_hw_params_get_channels)
- (const snd_pcm_hw_params_t *, unsigned int *);
-static int (*ALSA_snd_pcm_hw_params_set_rate_near)
- (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_period_size_near)
- (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *);
-static int (*ALSA_snd_pcm_hw_params_get_period_size)
- (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_periods_near)
- (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_get_periods)
- (const snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near)
- (snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
-static int (*ALSA_snd_pcm_hw_params_get_buffer_size)
- (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
-static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *,
- snd_pcm_sw_params_t *);
-static int (*ALSA_snd_pcm_sw_params_set_start_threshold)
- (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
-static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *);
-static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int);
-static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int);
-static int (*ALSA_snd_pcm_sw_params_set_avail_min)
- (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof
-#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof
-
-static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC;
-static void *alsa_handle = NULL;
-
-static int
-load_alsa_sym(const char *fn, void **addr)
-{
- *addr = SDL_LoadFunction(alsa_handle, fn);
- if (*addr == NULL) {
- /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
- return 0;
- }
-
- return 1;
-}
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-#define SDL_ALSA_SYM(x) \
- if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1
-#else
-#define SDL_ALSA_SYM(x) ALSA_##x = x
-#endif
-
-static int
-load_alsa_syms(void)
-{
- SDL_ALSA_SYM(snd_pcm_open);
- SDL_ALSA_SYM(snd_pcm_close);
- SDL_ALSA_SYM(snd_pcm_writei);
- SDL_ALSA_SYM(snd_pcm_recover);
- SDL_ALSA_SYM(snd_pcm_prepare);
- SDL_ALSA_SYM(snd_pcm_drain);
- SDL_ALSA_SYM(snd_strerror);
- SDL_ALSA_SYM(snd_pcm_hw_params_sizeof);
- SDL_ALSA_SYM(snd_pcm_sw_params_sizeof);
- SDL_ALSA_SYM(snd_pcm_hw_params_copy);
- SDL_ALSA_SYM(snd_pcm_hw_params_any);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_access);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_format);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_channels);
- SDL_ALSA_SYM(snd_pcm_hw_params_get_channels);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near);
- SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_periods_near);
- SDL_ALSA_SYM(snd_pcm_hw_params_get_periods);
- SDL_ALSA_SYM(snd_pcm_hw_params_set_buffer_size_near);
- SDL_ALSA_SYM(snd_pcm_hw_params_get_buffer_size);
- SDL_ALSA_SYM(snd_pcm_hw_params);
- SDL_ALSA_SYM(snd_pcm_sw_params_current);
- SDL_ALSA_SYM(snd_pcm_sw_params_set_start_threshold);
- SDL_ALSA_SYM(snd_pcm_sw_params);
- SDL_ALSA_SYM(snd_pcm_nonblock);
- SDL_ALSA_SYM(snd_pcm_wait);
- SDL_ALSA_SYM(snd_pcm_sw_params_set_avail_min);
- return 0;
-}
-
-#undef SDL_ALSA_SYM
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-
-static void
-UnloadALSALibrary(void)
-{
- if (alsa_handle != NULL) {
- SDL_UnloadObject(alsa_handle);
- alsa_handle = NULL;
- }
-}
-
-static int
-LoadALSALibrary(void)
-{
- int retval = 0;
- if (alsa_handle == NULL) {
- alsa_handle = SDL_LoadObject(alsa_library);
- if (alsa_handle == NULL) {
- retval = -1;
- /* Don't call SDL_SetError(): SDL_LoadObject already did. */
- } else {
- retval = load_alsa_syms();
- if (retval < 0) {
- UnloadALSALibrary();
- }
- }
- }
- return retval;
-}
-
-#else
-
-static void
-UnloadALSALibrary(void)
-{
-}
-
-static int
-LoadALSALibrary(void)
-{
- load_alsa_syms();
- return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
-
-static const char *
-get_audio_device(int channels)
-{
- const char *device;
-
- device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */
- if (device == NULL) {
- switch (channels) {
- case 6:
- device = "plug:surround51";
- break;
- case 4:
- device = "plug:surround40";
- break;
- default:
- device = "default";
- break;
- }
- }
- return device;
-}
-
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-ALSA_WaitDevice(_THIS)
-{
- /* We're in blocking mode, so there's nothing to do here */
-}
-
-
-/* !!! FIXME: is there a channel swizzler in alsalib instead? */
-/*
- * http://bugzilla.libsdl.org/show_bug.cgi?id=110
- * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE
- * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR"
- */
-#define SWIZ6(T) \
- T *ptr = (T *) this->hidden->mixbuf; \
- Uint32 i; \
- for (i = 0; i < this->spec.samples; i++, ptr += 6) { \
- T tmp; \
- tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \
- tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \
- }
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_64bit(_THIS)
-{
- SWIZ6(Uint64);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_32bit(_THIS)
-{
- SWIZ6(Uint32);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_16bit(_THIS)
-{
- SWIZ6(Uint16);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_8bit(_THIS)
-{
- SWIZ6(Uint8);
-}
-
-#undef SWIZ6
-
-
-/*
- * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle
- * channels from Windows/Mac order to the format alsalib will want.
- */
-static SDL_INLINE void
-swizzle_alsa_channels(_THIS)
-{
- if (this->spec.channels == 6) {
- const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */
- if (fmtsize == 16)
- swizzle_alsa_channels_6_16bit(this);
- else if (fmtsize == 8)
- swizzle_alsa_channels_6_8bit(this);
- else if (fmtsize == 32)
- swizzle_alsa_channels_6_32bit(this);
- else if (fmtsize == 64)
- swizzle_alsa_channels_6_64bit(this);
- }
-
- /* !!! FIXME: update this for 7.1 if needed, later. */
-}
-
-
-static void
-ALSA_PlayDevice(_THIS)
-{
- int status;
- const Uint8 *sample_buf = (const Uint8 *) this->hidden->mixbuf;
- const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) *
- this->spec.channels;
- snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->spec.samples);
-
- swizzle_alsa_channels(this);
-
- while ( frames_left > 0 && this->enabled ) {
- /* !!! FIXME: This works, but needs more testing before going live */
- /* ALSA_snd_pcm_wait(this->hidden->pcm_handle, -1); */
- status = ALSA_snd_pcm_writei(this->hidden->pcm_handle,
- sample_buf, frames_left);
-
- if (status < 0) {
- if (status == -EAGAIN) {
- /* Apparently snd_pcm_recover() doesn't handle this case -
- does it assume snd_pcm_wait() above? */
- SDL_Delay(1);
- continue;
- }
- status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0);
- if (status < 0) {
- /* Hmm, not much we can do - abort */
- fprintf(stderr, "ALSA write failed (unrecoverable): %s\n",
- ALSA_snd_strerror(status));
- SDL_OpenedAudioDeviceDisconnected(this);
- return;
- }
- continue;
- }
- sample_buf += status * frame_size;
- frames_left -= status;
- }
-}
-
-static Uint8 *
-ALSA_GetDeviceBuf(_THIS)
-{
- return (this->hidden->mixbuf);
-}
-
-static void
-ALSA_CloseDevice(_THIS)
-{
- if (this->hidden != NULL) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- if (this->hidden->pcm_handle) {
- ALSA_snd_pcm_drain(this->hidden->pcm_handle);
- ALSA_snd_pcm_close(this->hidden->pcm_handle);
- this->hidden->pcm_handle = NULL;
- }
- SDL_free(this->hidden);
- this->hidden = NULL;
- }
-}
-
-static int
-ALSA_finalize_hardware(_THIS, snd_pcm_hw_params_t *hwparams, int override)
-{
- int status;
- snd_pcm_uframes_t bufsize;
-
- /* "set" the hardware with the desired parameters */
- status = ALSA_snd_pcm_hw_params(this->hidden->pcm_handle, hwparams);
- if ( status < 0 ) {
- return(-1);
- }
-
- /* Get samples for the actual buffer size */
- status = ALSA_snd_pcm_hw_params_get_buffer_size(hwparams, &bufsize);
- if ( status < 0 ) {
- return(-1);
- }
- if ( !override && bufsize != this->spec.samples * 2 ) {
- return(-1);
- }
-
- /* !!! FIXME: Is this safe to do? */
- this->spec.samples = bufsize / 2;
-
- /* This is useful for debugging */
- if ( SDL_getenv("SDL_AUDIO_ALSA_DEBUG") ) {
- snd_pcm_uframes_t persize = 0;
- unsigned int periods = 0;
-
- ALSA_snd_pcm_hw_params_get_period_size(hwparams, &persize, NULL);
- ALSA_snd_pcm_hw_params_get_periods(hwparams, &periods, NULL);
-
- fprintf(stderr,
- "ALSA: period size = %ld, periods = %u, buffer size = %lu\n",
- persize, periods, bufsize);
- }
-
- return(0);
-}
-
-static int
-ALSA_set_period_size(_THIS, snd_pcm_hw_params_t *params, int override)
-{
- const char *env;
- int status;
- snd_pcm_hw_params_t *hwparams;
- snd_pcm_uframes_t frames;
- unsigned int periods;
-
- /* Copy the hardware parameters for this setup */
- snd_pcm_hw_params_alloca(&hwparams);
- ALSA_snd_pcm_hw_params_copy(hwparams, params);
-
- if ( !override ) {
- env = SDL_getenv("SDL_AUDIO_ALSA_SET_PERIOD_SIZE");
- if ( env ) {
- override = SDL_atoi(env);
- if ( override == 0 ) {
- return(-1);
- }
- }
- }
-
- frames = this->spec.samples;
- status = ALSA_snd_pcm_hw_params_set_period_size_near(
- this->hidden->pcm_handle, hwparams, &frames, NULL);
- if ( status < 0 ) {
- return(-1);
- }
-
- periods = 2;
- status = ALSA_snd_pcm_hw_params_set_periods_near(
- this->hidden->pcm_handle, hwparams, &periods, NULL);
- if ( status < 0 ) {
- return(-1);
- }
-
- return ALSA_finalize_hardware(this, hwparams, override);
-}
-
-static int
-ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params, int override)
-{
- const char *env;
- int status;
- snd_pcm_hw_params_t *hwparams;
- snd_pcm_uframes_t frames;
-
- /* Copy the hardware parameters for this setup */
- snd_pcm_hw_params_alloca(&hwparams);
- ALSA_snd_pcm_hw_params_copy(hwparams, params);
-
- if ( !override ) {
- env = SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE");
- if ( env ) {
- override = SDL_atoi(env);
- if ( override == 0 ) {
- return(-1);
- }
- }
- }
-
- frames = this->spec.samples * 2;
- status = ALSA_snd_pcm_hw_params_set_buffer_size_near(
- this->hidden->pcm_handle, hwparams, &frames);
- if ( status < 0 ) {
- return(-1);
- }
-
- return ALSA_finalize_hardware(this, hwparams, override);
-}
-
-static int
-ALSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
-{
- int status = 0;
- snd_pcm_t *pcm_handle = NULL;
- snd_pcm_hw_params_t *hwparams = NULL;
- snd_pcm_sw_params_t *swparams = NULL;
- snd_pcm_format_t format = 0;
- SDL_AudioFormat test_format = 0;
- unsigned int rate = 0;
- unsigned int channels = 0;
-
- /* Initialize all variables that we clean on shutdown */
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- if (this->hidden == NULL) {
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Open the audio device */
- /* Name of device should depend on # channels in spec */
- status = ALSA_snd_pcm_open(&pcm_handle,
- get_audio_device(this->spec.channels),
- SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
-
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't open audio device: %s",
- ALSA_snd_strerror(status));
- }
-
- this->hidden->pcm_handle = pcm_handle;
-
- /* Figure out what the hardware is capable of */
- snd_pcm_hw_params_alloca(&hwparams);
- status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't get hardware config: %s",
- ALSA_snd_strerror(status));
- }
-
- /* SDL only uses interleaved sample output */
- status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams,
- SND_PCM_ACCESS_RW_INTERLEAVED);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't set interleaved access: %s",
- ALSA_snd_strerror(status));
- }
-
- /* Try for a closest match on audio format */
- status = -1;
- for (test_format = SDL_FirstAudioFormat(this->spec.format);
- test_format && (status < 0);) {
- status = 0; /* if we can't support a format, it'll become -1. */
- switch (test_format) {
- case AUDIO_U8:
- format = SND_PCM_FORMAT_U8;
- break;
- case AUDIO_S8:
- format = SND_PCM_FORMAT_S8;
- break;
- case AUDIO_S16LSB:
- format = SND_PCM_FORMAT_S16_LE;
- break;
- case AUDIO_S16MSB:
- format = SND_PCM_FORMAT_S16_BE;
- break;
- case AUDIO_U16LSB:
- format = SND_PCM_FORMAT_U16_LE;
- break;
- case AUDIO_U16MSB:
- format = SND_PCM_FORMAT_U16_BE;
- break;
- case AUDIO_S32LSB:
- format = SND_PCM_FORMAT_S32_LE;
- break;
- case AUDIO_S32MSB:
- format = SND_PCM_FORMAT_S32_BE;
- break;
- case AUDIO_F32LSB:
- format = SND_PCM_FORMAT_FLOAT_LE;
- break;
- case AUDIO_F32MSB:
- format = SND_PCM_FORMAT_FLOAT_BE;
- break;
- default:
- status = -1;
- break;
- }
- if (status >= 0) {
- status = ALSA_snd_pcm_hw_params_set_format(pcm_handle,
- hwparams, format);
- }
- if (status < 0) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't find any hardware audio formats");
- }
- this->spec.format = test_format;
-
- /* Set the number of channels */
- status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams,
- this->spec.channels);
- channels = this->spec.channels;
- if (status < 0) {
- status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't set audio channels");
- }
- this->spec.channels = channels;
- }
-
- /* Set the audio rate */
- rate = this->spec.freq;
- status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams,
- &rate, NULL);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't set audio frequency: %s",
- ALSA_snd_strerror(status));
- }
- this->spec.freq = rate;
-
- /* Set the buffer size, in samples */
- if ( ALSA_set_period_size(this, hwparams, 0) < 0 &&
- ALSA_set_buffer_size(this, hwparams, 0) < 0 ) {
- /* Failed to set desired buffer size, do the best you can... */
- if ( ALSA_set_period_size(this, hwparams, 1) < 0 ) {
- ALSA_CloseDevice(this);
- return SDL_SetError("Couldn't set hardware audio parameters: %s", ALSA_snd_strerror(status));
- }
- }
- /* Set the software parameters */
- snd_pcm_sw_params_alloca(&swparams);
- status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't get software config: %s",
- ALSA_snd_strerror(status));
- }
- status = ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, this->spec.samples);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("Couldn't set minimum available samples: %s",
- ALSA_snd_strerror(status));
- }
- status =
- ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("ALSA: Couldn't set start threshold: %s",
- ALSA_snd_strerror(status));
- }
- status = ALSA_snd_pcm_sw_params(pcm_handle, swparams);
- if (status < 0) {
- ALSA_CloseDevice(this);
- return SDL_SetError("Couldn't set software audio parameters: %s",
- ALSA_snd_strerror(status));
- }
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(&this->spec);
-
- /* Allocate mixing buffer */
- this->hidden->mixlen = this->spec.size;
- this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
- if (this->hidden->mixbuf == NULL) {
- ALSA_CloseDevice(this);
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
-
- /* Switch to blocking mode for playback */
- ALSA_snd_pcm_nonblock(pcm_handle, 0);
-
- /* We're ready to rock and roll. :-) */
- return 0;
-}
-
-static void
-ALSA_Deinitialize(void)
-{
- UnloadALSALibrary();
-}
-
-static int
-ALSA_Init(SDL_AudioDriverImpl * impl)
-{
- if (LoadALSALibrary() < 0) {
- return 0;
- }
-
- /* Set the function pointers */
- impl->OpenDevice = ALSA_OpenDevice;
- impl->WaitDevice = ALSA_WaitDevice;
- impl->GetDeviceBuf = ALSA_GetDeviceBuf;
- impl->PlayDevice = ALSA_PlayDevice;
- impl->CloseDevice = ALSA_CloseDevice;
- impl->Deinitialize = ALSA_Deinitialize;
- impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */
-
- return 1; /* this audio target is available. */
-}
-
-
-AudioBootStrap ALSA_bootstrap = {
- "alsa", "ALSA PCM audio", ALSA_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_ALSA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/coreaudio/SDL_coreaudio.c b/3rdparty/sdl2-2.0.4/src/audio/coreaudio/SDL_coreaudio.c
deleted file mode 100644
index 46b617dc06..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/coreaudio/SDL_coreaudio.c
+++ /dev/null
@@ -1,698 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_AUDIO_DRIVER_COREAUDIO
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_coreaudio.h"
-#include "SDL_assert.h"
-
-#define DEBUG_COREAUDIO 0
-
-static void COREAUDIO_CloseDevice(_THIS);
-
-#define CHECK_RESULT(msg) \
- if (result != noErr) { \
- COREAUDIO_CloseDevice(this); \
- SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \
- return 0; \
- }
-
-#if MACOSX_COREAUDIO
-static const AudioObjectPropertyAddress devlist_address = {
- kAudioHardwarePropertyDevices,
- kAudioObjectPropertyScopeGlobal,
- kAudioObjectPropertyElementMaster
-};
-
-typedef void (*addDevFn)(const char *name, const int iscapture, AudioDeviceID devId, void *data);
-
-typedef struct AudioDeviceList
-{
- AudioDeviceID devid;
- SDL_bool alive;
- struct AudioDeviceList *next;
-} AudioDeviceList;
-
-static AudioDeviceList *output_devs = NULL;
-static AudioDeviceList *capture_devs = NULL;
-
-static SDL_bool
-add_to_internal_dev_list(const int iscapture, AudioDeviceID devId)
-{
- AudioDeviceList *item = (AudioDeviceList *) SDL_malloc(sizeof (AudioDeviceList));
- if (item == NULL) {
- return SDL_FALSE;
- }
- item->devid = devId;
- item->alive = SDL_TRUE;
- item->next = iscapture ? capture_devs : output_devs;
- if (iscapture) {
- capture_devs = item;
- } else {
- output_devs = item;
- }
-
- return SDL_TRUE;
-}
-
-static void
-addToDevList(const char *name, const int iscapture, AudioDeviceID devId, void *data)
-{
- if (add_to_internal_dev_list(iscapture, devId)) {
- SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId));
- }
-}
-
-static void
-build_device_list(int iscapture, addDevFn addfn, void *addfndata)
-{
- OSStatus result = noErr;
- UInt32 size = 0;
- AudioDeviceID *devs = NULL;
- UInt32 i = 0;
- UInt32 max = 0;
-
- result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject,
- &devlist_address, 0, NULL, &size);
- if (result != kAudioHardwareNoError)
- return;
-
- devs = (AudioDeviceID *) alloca(size);
- if (devs == NULL)
- return;
-
- result = AudioObjectGetPropertyData(kAudioObjectSystemObject,
- &devlist_address, 0, NULL, &size, devs);
- if (result != kAudioHardwareNoError)
- return;
-
- max = size / sizeof (AudioDeviceID);
- for (i = 0; i < max; i++) {
- CFStringRef cfstr = NULL;
- char *ptr = NULL;
- AudioDeviceID dev = devs[i];
- AudioBufferList *buflist = NULL;
- int usable = 0;
- CFIndex len = 0;
- const AudioObjectPropertyAddress addr = {
- kAudioDevicePropertyStreamConfiguration,
- iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
- };
-
- const AudioObjectPropertyAddress nameaddr = {
- kAudioObjectPropertyName,
- iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
- };
-
- result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size);
- if (result != noErr)
- continue;
-
- buflist = (AudioBufferList *) SDL_malloc(size);
- if (buflist == NULL)
- continue;
-
- result = AudioObjectGetPropertyData(dev, &addr, 0, NULL,
- &size, buflist);
-
- if (result == noErr) {
- UInt32 j;
- for (j = 0; j < buflist->mNumberBuffers; j++) {
- if (buflist->mBuffers[j].mNumberChannels > 0) {
- usable = 1;
- break;
- }
- }
- }
-
- SDL_free(buflist);
-
- if (!usable)
- continue;
-
-
- size = sizeof (CFStringRef);
- result = AudioObjectGetPropertyData(dev, &nameaddr, 0, NULL, &size, &cfstr);
- if (result != kAudioHardwareNoError)
- continue;
-
- len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr),
- kCFStringEncodingUTF8);
-
- ptr = (char *) SDL_malloc(len + 1);
- usable = ((ptr != NULL) &&
- (CFStringGetCString
- (cfstr, ptr, len + 1, kCFStringEncodingUTF8)));
-
- CFRelease(cfstr);
-
- if (usable) {
- len = strlen(ptr);
- /* Some devices have whitespace at the end...trim it. */
- while ((len > 0) && (ptr[len - 1] == ' ')) {
- len--;
- }
- usable = (len > 0);
- }
-
- if (usable) {
- ptr[len] = '\0';
-
-#if DEBUG_COREAUDIO
- printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n",
- ((iscapture) ? "capture" : "output"),
- (int) *devCount, ptr, (int) dev);
-#endif
- addfn(ptr, iscapture, dev, addfndata);
- }
- SDL_free(ptr); /* addfn() would have copied the string. */
- }
-}
-
-static void
-free_audio_device_list(AudioDeviceList **list)
-{
- AudioDeviceList *item = *list;
- while (item) {
- AudioDeviceList *next = item->next;
- SDL_free(item);
- item = next;
- }
- *list = NULL;
-}
-
-static void
-COREAUDIO_DetectDevices(void)
-{
- build_device_list(SDL_TRUE, addToDevList, NULL);
- build_device_list(SDL_FALSE, addToDevList, NULL);
-}
-
-static void
-build_device_change_list(const char *name, const int iscapture, AudioDeviceID devId, void *data)
-{
- AudioDeviceList **list = (AudioDeviceList **) data;
- AudioDeviceList *item;
- for (item = *list; item != NULL; item = item->next) {
- if (item->devid == devId) {
- item->alive = SDL_TRUE;
- return;
- }
- }
-
- add_to_internal_dev_list(iscapture, devId); /* new device, add it. */
- SDL_AddAudioDevice(iscapture, name, (void *) ((size_t) devId));
-}
-
-static void
-reprocess_device_list(const int iscapture, AudioDeviceList **list)
-{
- AudioDeviceList *item;
- AudioDeviceList *prev = NULL;
- for (item = *list; item != NULL; item = item->next) {
- item->alive = SDL_FALSE;
- }
-
- build_device_list(iscapture, build_device_change_list, list);
-
- /* free items in the list that aren't still alive. */
- item = *list;
- while (item != NULL) {
- AudioDeviceList *next = item->next;
- if (item->alive) {
- prev = item;
- } else {
- SDL_RemoveAudioDevice(iscapture, (void *) ((size_t) item->devid));
- if (prev) {
- prev->next = item->next;
- } else {
- *list = item->next;
- }
- SDL_free(item);
- }
- item = next;
- }
-}
-
-/* this is called when the system's list of available audio devices changes. */
-static OSStatus
-device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data)
-{
- reprocess_device_list(SDL_TRUE, &capture_devs);
- reprocess_device_list(SDL_FALSE, &output_devs);
- return 0;
-}
-#endif
-
-/* The CoreAudio callback */
-static OSStatus
-outputCallback(void *inRefCon,
- AudioUnitRenderActionFlags * ioActionFlags,
- const AudioTimeStamp * inTimeStamp,
- UInt32 inBusNumber, UInt32 inNumberFrames,
- AudioBufferList * ioData)
-{
- SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon;
- AudioBuffer *abuf;
- UInt32 remaining, len;
- void *ptr;
- UInt32 i;
-
- /* Only do anything if audio is enabled and not paused */
- if (!this->enabled || this->paused) {
- for (i = 0; i < ioData->mNumberBuffers; i++) {
- abuf = &ioData->mBuffers[i];
- SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize);
- }
- return 0;
- }
-
- /* No SDL conversion should be needed here, ever, since we accept
- any input format in OpenAudio, and leave the conversion to CoreAudio.
- */
- /*
- SDL_assert(!this->convert.needed);
- SDL_assert(this->spec.channels == ioData->mNumberChannels);
- */
-
- for (i = 0; i < ioData->mNumberBuffers; i++) {
- abuf = &ioData->mBuffers[i];
- remaining = abuf->mDataByteSize;
- ptr = abuf->mData;
- while (remaining > 0) {
- if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
- /* Generate the data */
- SDL_LockMutex(this->mixer_lock);
- (*this->spec.callback)(this->spec.userdata,
- this->hidden->buffer, this->hidden->bufferSize);
- SDL_UnlockMutex(this->mixer_lock);
- this->hidden->bufferOffset = 0;
- }
-
- len = this->hidden->bufferSize - this->hidden->bufferOffset;
- if (len > remaining)
- len = remaining;
- SDL_memcpy(ptr, (char *)this->hidden->buffer +
- this->hidden->bufferOffset, len);
- ptr = (char *)ptr + len;
- remaining -= len;
- this->hidden->bufferOffset += len;
- }
- }
-
- return 0;
-}
-
-static OSStatus
-inputCallback(void *inRefCon,
- AudioUnitRenderActionFlags * ioActionFlags,
- const AudioTimeStamp * inTimeStamp,
- UInt32 inBusNumber, UInt32 inNumberFrames,
- AudioBufferList * ioData)
-{
- /* err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); */
- /* !!! FIXME: write me! */
- return noErr;
-}
-
-
-#if MACOSX_COREAUDIO
-static const AudioObjectPropertyAddress alive_address =
-{
- kAudioDevicePropertyDeviceIsAlive,
- kAudioObjectPropertyScopeGlobal,
- kAudioObjectPropertyElementMaster
-};
-
-static OSStatus
-device_unplugged(AudioObjectID devid, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data)
-{
- SDL_AudioDevice *this = (SDL_AudioDevice *) data;
- SDL_bool dead = SDL_FALSE;
- UInt32 isAlive = 1;
- UInt32 size = sizeof (isAlive);
- OSStatus error;
-
- if (!this->enabled) {
- return 0; /* already known to be dead. */
- }
-
- error = AudioObjectGetPropertyData(this->hidden->deviceID, &alive_address,
- 0, NULL, &size, &isAlive);
-
- if (error == kAudioHardwareBadDeviceError) {
- dead = SDL_TRUE; /* device was unplugged. */
- } else if ((error == kAudioHardwareNoError) && (!isAlive)) {
- dead = SDL_TRUE; /* device died in some other way. */
- }
-
- if (dead) {
- SDL_OpenedAudioDeviceDisconnected(this);
- }
-
- return 0;
-}
-#endif
-
-static void
-COREAUDIO_CloseDevice(_THIS)
-{
- if (this->hidden != NULL) {
- if (this->hidden->audioUnitOpened) {
- #if MACOSX_COREAUDIO
- /* Unregister our disconnect callback. */
- AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this);
- #endif
-
- AURenderCallbackStruct callback;
- const AudioUnitElement output_bus = 0;
- const AudioUnitElement input_bus = 1;
- const int iscapture = this->iscapture;
- const AudioUnitElement bus =
- ((iscapture) ? input_bus : output_bus);
- const AudioUnitScope scope =
- ((iscapture) ? kAudioUnitScope_Output :
- kAudioUnitScope_Input);
-
- /* stop processing the audio unit */
- AudioOutputUnitStop(this->hidden->audioUnit);
-
- /* Remove the input callback */
- SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
- AudioUnitSetProperty(this->hidden->audioUnit,
- kAudioUnitProperty_SetRenderCallback,
- scope, bus, &callback, sizeof(callback));
-
- #if MACOSX_COREAUDIO
- CloseComponent(this->hidden->audioUnit);
- #else
- AudioComponentInstanceDispose(this->hidden->audioUnit);
- #endif
-
- this->hidden->audioUnitOpened = 0;
- }
- SDL_free(this->hidden->buffer);
- SDL_free(this->hidden);
- this->hidden = NULL;
- }
-}
-
-#if MACOSX_COREAUDIO
-static int
-prepare_device(_THIS, void *handle, int iscapture)
-{
- AudioDeviceID devid = (AudioDeviceID) ((size_t) handle);
- OSStatus result = noErr;
- UInt32 size = 0;
- UInt32 alive = 0;
- pid_t pid = 0;
-
- AudioObjectPropertyAddress addr = {
- 0,
- kAudioObjectPropertyScopeGlobal,
- kAudioObjectPropertyElementMaster
- };
-
- if (handle == NULL) {
- size = sizeof (AudioDeviceID);
- addr.mSelector =
- ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice :
- kAudioHardwarePropertyDefaultOutputDevice);
- result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr,
- 0, NULL, &size, &devid);
- CHECK_RESULT("AudioHardwareGetProperty (default device)");
- }
-
- addr.mSelector = kAudioDevicePropertyDeviceIsAlive;
- addr.mScope = iscapture ? kAudioDevicePropertyScopeInput :
- kAudioDevicePropertyScopeOutput;
-
- size = sizeof (alive);
- result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive);
- CHECK_RESULT
- ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)");
-
- if (!alive) {
- SDL_SetError("CoreAudio: requested device exists, but isn't alive.");
- return 0;
- }
-
- addr.mSelector = kAudioDevicePropertyHogMode;
- size = sizeof (pid);
- result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid);
-
- /* some devices don't support this property, so errors are fine here. */
- if ((result == noErr) && (pid != -1)) {
- SDL_SetError("CoreAudio: requested device is being hogged.");
- return 0;
- }
-
- this->hidden->deviceID = devid;
- return 1;
-}
-#endif
-
-static int
-prepare_audiounit(_THIS, void *handle, int iscapture,
- const AudioStreamBasicDescription * strdesc)
-{
- OSStatus result = noErr;
- AURenderCallbackStruct callback;
-#if MACOSX_COREAUDIO
- ComponentDescription desc;
- Component comp = NULL;
-#else
- AudioComponentDescription desc;
- AudioComponent comp = NULL;
-#endif
- const AudioUnitElement output_bus = 0;
- const AudioUnitElement input_bus = 1;
- const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
- const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output :
- kAudioUnitScope_Input);
-
-#if MACOSX_COREAUDIO
- if (!prepare_device(this, handle, iscapture)) {
- return 0;
- }
-#endif
-
- SDL_zero(desc);
- desc.componentType = kAudioUnitType_Output;
- desc.componentManufacturer = kAudioUnitManufacturer_Apple;
-
-#if MACOSX_COREAUDIO
- desc.componentSubType = kAudioUnitSubType_DefaultOutput;
- comp = FindNextComponent(NULL, &desc);
-#else
- desc.componentSubType = kAudioUnitSubType_RemoteIO;
- comp = AudioComponentFindNext(NULL, &desc);
-#endif
-
- if (comp == NULL) {
- SDL_SetError("Couldn't find requested CoreAudio component");
- return 0;
- }
-
- /* Open & initialize the audio unit */
-#if MACOSX_COREAUDIO
- result = OpenAComponent(comp, &this->hidden->audioUnit);
- CHECK_RESULT("OpenAComponent");
-#else
- /*
- AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6
- We can't use OpenAComponent on iPhone because it is not present
- */
- result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit);
- CHECK_RESULT("AudioComponentInstanceNew");
-#endif
-
- this->hidden->audioUnitOpened = 1;
-
-#if MACOSX_COREAUDIO
- result = AudioUnitSetProperty(this->hidden->audioUnit,
- kAudioOutputUnitProperty_CurrentDevice,
- kAudioUnitScope_Global, 0,
- &this->hidden->deviceID,
- sizeof(AudioDeviceID));
- CHECK_RESULT
- ("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)");
-#endif
-
- /* Set the data format of the audio unit. */
- result = AudioUnitSetProperty(this->hidden->audioUnit,
- kAudioUnitProperty_StreamFormat,
- scope, bus, strdesc, sizeof(*strdesc));
- CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)");
-
- /* Set the audio callback */
- SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
- callback.inputProc = ((iscapture) ? inputCallback : outputCallback);
- callback.inputProcRefCon = this;
- result = AudioUnitSetProperty(this->hidden->audioUnit,
- kAudioUnitProperty_SetRenderCallback,
- scope, bus, &callback, sizeof(callback));
- CHECK_RESULT
- ("AudioUnitSetProperty (kAudioUnitProperty_SetRenderCallback)");
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(&this->spec);
-
- /* Allocate a sample buffer */
- this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size;
- this->hidden->buffer = SDL_malloc(this->hidden->bufferSize);
-
- result = AudioUnitInitialize(this->hidden->audioUnit);
- CHECK_RESULT("AudioUnitInitialize");
-
- /* Finally, start processing of the audio unit */
- result = AudioOutputUnitStart(this->hidden->audioUnit);
- CHECK_RESULT("AudioOutputUnitStart");
-
-#if MACOSX_COREAUDIO
- /* Fire a callback if the device stops being "alive" (disconnected, etc). */
- AudioObjectAddPropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this);
-#endif
-
- /* We're running! */
- return 1;
-}
-
-
-static int
-COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
-{
- AudioStreamBasicDescription strdesc;
- SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
- int valid_datatype = 0;
-
- /* Initialize all variables that we clean on shutdown */
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- if (this->hidden == NULL) {
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Setup a AudioStreamBasicDescription with the requested format */
- SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
- strdesc.mFormatID = kAudioFormatLinearPCM;
- strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
- strdesc.mChannelsPerFrame = this->spec.channels;
- strdesc.mSampleRate = this->spec.freq;
- strdesc.mFramesPerPacket = 1;
-
- while ((!valid_datatype) && (test_format)) {
- this->spec.format = test_format;
- /* Just a list of valid SDL formats, so people don't pass junk here. */
- switch (test_format) {
- case AUDIO_U8:
- case AUDIO_S8:
- case AUDIO_U16LSB:
- case AUDIO_S16LSB:
- case AUDIO_U16MSB:
- case AUDIO_S16MSB:
- case AUDIO_S32LSB:
- case AUDIO_S32MSB:
- case AUDIO_F32LSB:
- case AUDIO_F32MSB:
- valid_datatype = 1;
- strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format);
- if (SDL_AUDIO_ISBIGENDIAN(this->spec.format))
- strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
-
- if (SDL_AUDIO_ISFLOAT(this->spec.format))
- strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat;
- else if (SDL_AUDIO_ISSIGNED(this->spec.format))
- strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
- break;
- }
- }
-
- if (!valid_datatype) { /* shouldn't happen, but just in case... */
- COREAUDIO_CloseDevice(this);
- return SDL_SetError("Unsupported audio format");
- }
-
- strdesc.mBytesPerFrame =
- strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
- strdesc.mBytesPerPacket =
- strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
-
- if (!prepare_audiounit(this, handle, iscapture, &strdesc)) {
- COREAUDIO_CloseDevice(this);
- return -1; /* prepare_audiounit() will call SDL_SetError()... */
- }
-
- return 0; /* good to go. */
-}
-
-static void
-COREAUDIO_Deinitialize(void)
-{
-#if MACOSX_COREAUDIO
- AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL);
- free_audio_device_list(&capture_devs);
- free_audio_device_list(&output_devs);
-#endif
-}
-
-static int
-COREAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
- /* Set the function pointers */
- impl->OpenDevice = COREAUDIO_OpenDevice;
- impl->CloseDevice = COREAUDIO_CloseDevice;
- impl->Deinitialize = COREAUDIO_Deinitialize;
-
-#if MACOSX_COREAUDIO
- impl->DetectDevices = COREAUDIO_DetectDevices;
- AudioObjectAddPropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL);
-#else
- impl->OnlyHasDefaultOutputDevice = 1;
-
- /* Set category to ambient sound so that other music continues playing.
- You can change this at runtime in your own code if you need different
- behavior. If this is common, we can add an SDL hint for this.
- */
- AudioSessionInitialize(NULL, NULL, NULL, nil);
- UInt32 category = kAudioSessionCategory_AmbientSound;
- AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category);
-#endif
-
- impl->ProvidesOwnCallbackThread = 1;
-
- return 1; /* this audio target is available. */
-}
-
-AudioBootStrap COREAUDIO_bootstrap = {
- "coreaudio", "CoreAudio", COREAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_COREAUDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/disk/SDL_diskaudio.c b/3rdparty/sdl2-2.0.4/src/audio/disk/SDL_diskaudio.c
deleted file mode 100644
index 28745f9d04..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/disk/SDL_diskaudio.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_AUDIO_DRIVER_DISK
-
-/* Output raw audio data to a file. */
-
-#if HAVE_STDIO_H
-#include
-#endif
-
-#include "SDL_rwops.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_diskaudio.h"
-
-/* environment variables and defaults. */
-#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE"
-#define DISKDEFAULT_OUTFILE "sdlaudio.raw"
-#define DISKENVR_WRITEDELAY "SDL_DISKAUDIODELAY"
-#define DISKDEFAULT_WRITEDELAY 150
-
-static const char *
-DISKAUD_GetOutputFilename(const char *devname)
-{
- if (devname == NULL) {
- devname = SDL_getenv(DISKENVR_OUTFILE);
- if (devname == NULL) {
- devname = DISKDEFAULT_OUTFILE;
- }
- }
- return devname;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-DISKAUD_WaitDevice(_THIS)
-{
- SDL_Delay(this->hidden->write_delay);
-}
-
-static void
-DISKAUD_PlayDevice(_THIS)
-{
- size_t written;
-
- /* Write the audio data */
- written = SDL_RWwrite(this->hidden->output,
- this->hidden->mixbuf, 1, this->hidden->mixlen);
-
- /* If we couldn't write, assume fatal error for now */
- if (written != this->hidden->mixlen) {
- SDL_OpenedAudioDeviceDisconnected(this);
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *
-DISKAUD_GetDeviceBuf(_THIS)
-{
- return (this->hidden->mixbuf);
-}
-
-static void
-DISKAUD_CloseDevice(_THIS)
-{
- if (this->hidden != NULL) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- if (this->hidden->output != NULL) {
- SDL_RWclose(this->hidden->output);
- this->hidden->output = NULL;
- }
- SDL_free(this->hidden);
- this->hidden = NULL;
- }
-}
-
-static int
-DISKAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
-{
- /* handle != NULL means "user specified the placeholder name on the fake detected device list" */
- const char *fname = DISKAUD_GetOutputFilename(handle ? NULL : devname);
- const char *envr = SDL_getenv(DISKENVR_WRITEDELAY);
-
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc(sizeof(*this->hidden));
- if (this->hidden == NULL) {
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden, 0, sizeof(*this->hidden));
-
- this->hidden->mixlen = this->spec.size;
- this->hidden->write_delay =
- (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
-
- /* Open the audio device */
- this->hidden->output = SDL_RWFromFile(fname, "wb");
- if (this->hidden->output == NULL) {
- DISKAUD_CloseDevice(this);
- return -1;
- }
-
- /* Allocate mixing buffer */
- this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
- if (this->hidden->mixbuf == NULL) {
- DISKAUD_CloseDevice(this);
- return -1;
- }
- SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-#if HAVE_STDIO_H
- fprintf(stderr,
- "WARNING: You are using the SDL disk writer audio driver!\n"
- " Writing to file [%s].\n", fname);
-#endif
-
- /* We're ready to rock and roll. :-) */
- return 0;
-}
-
-static void
-DISKAUD_DetectDevices(void)
-{
- /* !!! FIXME: stole this literal string from DEFAULT_OUTPUT_DEVNAME in SDL_audio.c */
- SDL_AddAudioDevice(SDL_FALSE, "System audio output device", (void *) 0x1);
-}
-
-static int
-DISKAUD_Init(SDL_AudioDriverImpl * impl)
-{
- /* Set the function pointers */
- impl->OpenDevice = DISKAUD_OpenDevice;
- impl->WaitDevice = DISKAUD_WaitDevice;
- impl->PlayDevice = DISKAUD_PlayDevice;
- impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
- impl->CloseDevice = DISKAUD_CloseDevice;
- impl->DetectDevices = DISKAUD_DetectDevices;
-
- impl->AllowsArbitraryDeviceNames = 1;
-
- return 1; /* this audio target is available. */
-}
-
-AudioBootStrap DISKAUD_bootstrap = {
- "disk", "direct-to-disk audio", DISKAUD_Init, 1
-};
-
-#endif /* SDL_AUDIO_DRIVER_DISK */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/emscripten/SDL_emscriptenaudio.c b/3rdparty/sdl2-2.0.4/src/audio/emscripten/SDL_emscriptenaudio.c
deleted file mode 100644
index 8378233ca2..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/emscripten/SDL_emscriptenaudio.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_AUDIO_DRIVER_EMSCRIPTEN
-
-#include "SDL_audio.h"
-#include "SDL_log.h"
-#include "../SDL_audio_c.h"
-#include "SDL_emscriptenaudio.h"
-
-#include
-
-static int
-copyData(_THIS)
-{
- int byte_len;
-
- if (this->hidden->write_off + this->convert.len_cvt > this->hidden->mixlen) {
- if (this->hidden->write_off > this->hidden->read_off) {
- SDL_memmove(this->hidden->mixbuf,
- this->hidden->mixbuf + this->hidden->read_off,
- this->hidden->mixlen - this->hidden->read_off);
- this->hidden->write_off = this->hidden->write_off - this->hidden->read_off;
- } else {
- this->hidden->write_off = 0;
- }
- this->hidden->read_off = 0;
- }
-
- SDL_memcpy(this->hidden->mixbuf + this->hidden->write_off,
- this->convert.buf,
- this->convert.len_cvt);
- this->hidden->write_off += this->convert.len_cvt;
- byte_len = this->hidden->write_off - this->hidden->read_off;
-
- return byte_len;
-}
-
-static void
-HandleAudioProcess(_THIS)
-{
- Uint8 *buf = NULL;
- int byte_len = 0;
- int bytes = SDL_AUDIO_BITSIZE(this->spec.format) / 8;
- int bytes_in = SDL_AUDIO_BITSIZE(this->convert.src_format) / 8;
-
- /* Only do soemthing if audio is enabled */
- if (!this->enabled)
- return;
-
- if (this->paused)
- return;
-
- if (this->convert.needed) {
- if (this->hidden->conv_in_len != 0) {
- this->convert.len = this->hidden->conv_in_len * bytes_in * this->spec.channels;
- }
-
- (*this->spec.callback) (this->spec.userdata,
- this->convert.buf,
- this->convert.len);
- SDL_ConvertAudio(&this->convert);
- buf = this->convert.buf;
- byte_len = this->convert.len_cvt;
-
- /* size mismatch*/
- if (byte_len != this->spec.size) {
- if (!this->hidden->mixbuf) {
- this->hidden->mixlen = this->spec.size > byte_len ? this->spec.size * 2 : byte_len * 2;
- this->hidden->mixbuf = SDL_malloc(this->hidden->mixlen);
- }
-
- /* copy existing data */
- byte_len = copyData(this);
-
- /* read more data*/
- while (byte_len < this->spec.size) {
- (*this->spec.callback) (this->spec.userdata,
- this->convert.buf,
- this->convert.len);
- SDL_ConvertAudio(&this->convert);
- byte_len = copyData(this);
- }
-
- byte_len = this->spec.size;
- buf = this->hidden->mixbuf + this->hidden->read_off;
- this->hidden->read_off += byte_len;
- }
-
- } else {
- if (!this->hidden->mixbuf) {
- this->hidden->mixlen = this->spec.size;
- this->hidden->mixbuf = SDL_malloc(this->hidden->mixlen);
- }
- (*this->spec.callback) (this->spec.userdata,
- this->hidden->mixbuf,
- this->hidden->mixlen);
- buf = this->hidden->mixbuf;
- byte_len = this->hidden->mixlen;
- }
-
- if (buf) {
- EM_ASM_ARGS({
- var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels'];
- for (var c = 0; c < numChannels; ++c) {
- var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c);
- if (channelData.length != $1) {
- throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!';
- }
-
- for (var j = 0; j < $1; ++j) {
- channelData[j] = getValue($0 + (j*numChannels + c)*4, 'float');
- }
- }
- }, buf, byte_len / bytes / this->spec.channels);
- }
-}
-
-static void
-Emscripten_CloseDevice(_THIS)
-{
- if (this->hidden != NULL) {
- if (this->hidden->mixbuf != NULL) {
- /* Clean up the audio buffer */
- SDL_free(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- }
-
- SDL_free(this->hidden);
- this->hidden = NULL;
- }
-}
-
-static int
-Emscripten_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
-{
- SDL_bool valid_format = SDL_FALSE;
- SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
- int i;
- float f;
- int result;
-
- while ((!valid_format) && (test_format)) {
- switch (test_format) {
- case AUDIO_F32: /* web audio only supports floats */
- this->spec.format = test_format;
-
- valid_format = SDL_TRUE;
- break;
- }
- test_format = SDL_NextAudioFormat();
- }
-
- if (!valid_format) {
- /* Didn't find a compatible format :( */
- return SDL_SetError("No compatible audio format!");
- }
-
- /* Initialize all variables that we clean on shutdown */
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- if (this->hidden == NULL) {
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* based on parts of library_sdl.js */
-
- /* create context (TODO: this puts stuff in the global namespace...)*/
- result = EM_ASM_INT_V({
- if(typeof(SDL2) === 'undefined')
- SDL2 = {};
-
- if(typeof(SDL2.audio) === 'undefined')
- SDL2.audio = {};
-
- if (!SDL2.audioContext) {
- if (typeof(AudioContext) !== 'undefined') {
- SDL2.audioContext = new AudioContext();
- } else if (typeof(webkitAudioContext) !== 'undefined') {
- SDL2.audioContext = new webkitAudioContext();
- } else {
- return -1;
- }
- }
- return 0;
- });
- if (result < 0) {
- return SDL_SetError("Web Audio API is not available!");
- }
-
- /* limit to native freq */
- int sampleRate = EM_ASM_INT_V({
- return SDL2.audioContext['sampleRate'];
- });
-
- if(this->spec.freq != sampleRate) {
- for (i = this->spec.samples; i > 0; i--) {
- f = (float)i / (float)sampleRate * (float)this->spec.freq;
- if (SDL_floor(f) == f) {
- this->hidden->conv_in_len = SDL_floor(f);
- break;
- }
- }
-
- this->spec.freq = sampleRate;
- }
-
- SDL_CalculateAudioSpec(&this->spec);
-
- /* setup a ScriptProcessorNode */
- EM_ASM_ARGS({
- SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0);
- SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) {
- SDL2.audio.currentOutputBuffer = e['outputBuffer'];
- Runtime.dynCall('vi', $2, [$3]);
- };
- SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']);
- }, this->spec.channels, this->spec.samples, HandleAudioProcess, this);
- return 0;
-}
-
-static int
-Emscripten_Init(SDL_AudioDriverImpl * impl)
-{
- /* Set the function pointers */
- impl->OpenDevice = Emscripten_OpenDevice;
- impl->CloseDevice = Emscripten_CloseDevice;
-
- /* only one output */
- impl->OnlyHasDefaultOutputDevice = 1;
-
- /* no threads here */
- impl->SkipMixerLock = 1;
- impl->ProvidesOwnCallbackThread = 1;
-
- /* check availability */
- int available = EM_ASM_INT_V({
- if (typeof(AudioContext) !== 'undefined') {
- return 1;
- } else if (typeof(webkitAudioContext) !== 'undefined') {
- return 1;
- }
- return 0;
- });
-
- if (!available) {
- SDL_SetError("No audio context available");
- }
-
- return available;
-}
-
-AudioBootStrap EmscriptenAudio_bootstrap = {
- "emscripten", "SDL emscripten audio driver", Emscripten_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_EMSCRIPTEN */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/sdlgenaudiocvt.pl b/3rdparty/sdl2-2.0.4/src/audio/sdlgenaudiocvt.pl
deleted file mode 100755
index c53f1c3559..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/sdlgenaudiocvt.pl
+++ /dev/null
@@ -1,761 +0,0 @@
-#!/usr/bin/perl -w
-
-use warnings;
-use strict;
-
-my @audiotypes = qw(
- U8
- S8
- U16LSB
- S16LSB
- U16MSB
- S16MSB
- S32LSB
- S32MSB
- F32LSB
- F32MSB
-);
-
-my @channels = ( 1, 2, 4, 6, 8 );
-my %funcs;
-my $custom_converters = 0;
-
-
-sub getTypeConvertHashId {
- my ($from, $to) = @_;
- return "TYPECONVERTER $from/$to";
-}
-
-
-sub getResamplerHashId {
- my ($from, $channels, $upsample, $multiple) = @_;
- return "RESAMPLER $from/$channels/$upsample/$multiple";
-}
-
-
-sub outputHeader {
- print <
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "../SDL_internal.h"
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#ifndef DEBUG_CONVERT
-#define DEBUG_CONVERT 0
-#endif
-
-
-/* If you can guarantee your data and need space, you can eliminate code... */
-
-/* Just build the arbitrary resamplers if you're saving code space. */
-#ifndef LESS_RESAMPLERS
-#define LESS_RESAMPLERS 0
-#endif
-
-/* Don't build any resamplers if you're REALLY saving code space. */
-#ifndef NO_RESAMPLERS
-#define NO_RESAMPLERS 0
-#endif
-
-/* Don't build any type converters if you're saving code space. */
-#ifndef NO_CONVERTERS
-#define NO_CONVERTERS 0
-#endif
-
-
-/* *INDENT-OFF* */
-
-EOF
-
- my @vals = ( 127, 32767, 2147483647 );
- foreach (@vals) {
- my $val = $_;
- my $fval = 1.0 / $val;
- print("#define DIVBY${val} ${fval}f\n");
- }
-
- print("\n");
-}
-
-sub outputFooter {
- print < 8) {
- $code = "SDL_Swap${BEorLE}${size}($val)";
- } else {
- $code = $val;
- }
-
- if (($signed) and (!$float)) {
- $code = "((Sint${size}) $code)";
- }
- }
-
- return "${code}";
-}
-
-
-sub maxIntVal {
- my $size = shift;
- if ($size == 8) {
- return 0x7F;
- } elsif ($size == 16) {
- return 0x7FFF;
- } elsif ($size == 32) {
- return 0x7FFFFFFF;
- }
-
- die("bug in script.\n");
-}
-
-sub getFloatToIntMult {
- my $size = shift;
- my $val = maxIntVal($size) . '.0';
- $val .= 'f' if ($size < 32);
- return $val;
-}
-
-sub getIntToFloatDivBy {
- my $size = shift;
- return 'DIVBY' . maxIntVal($size);
-}
-
-sub getSignFlipVal {
- my $size = shift;
- if ($size == 8) {
- return '0x80';
- } elsif ($size == 16) {
- return '0x8000';
- } elsif ($size == 32) {
- return '0x80000000';
- }
-
- die("bug in script.\n");
-}
-
-sub buildCvtFunc {
- my ($from, $to) = @_;
- my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
- my ($tsigned, $tfloat, $tsize, $tendian, $tctype) = splittype($to);
- my $diffs = 0;
- $diffs++ if ($fsize != $tsize);
- $diffs++ if ($fsigned != $tsigned);
- $diffs++ if ($ffloat != $tfloat);
- $diffs++ if ($fendian ne $tendian);
-
- return if ($diffs == 0);
-
- my $hashid = getTypeConvertHashId($from, $to);
- if (1) { # !!! FIXME: if ($diffs > 1) {
- my $sym = "SDL_Convert_${from}_to_${to}";
- $funcs{$hashid} = $sym;
- $custom_converters++;
-
- # Always unsigned for ints, for possible byteswaps.
- my $srctype = (($ffloat) ? 'float' : "Uint${fsize}");
-
- print <buf + cvt->len_cvt)) - 1;
- dst = (($tctype *) (cvt->buf + cvt->len_cvt * $mult)) - 1;
- for (i = cvt->len_cvt / sizeof ($srctype); i; --i, --src, --dst) {
-EOF
- } else {
- print <buf;
- dst = ($tctype *) cvt->buf;
- for (i = cvt->len_cvt / sizeof ($srctype); i; --i, ++src, ++dst) {
-EOF
- }
-
- # Have to convert to/from float/int.
- # !!! FIXME: cast through double for int32<->float?
- my $code = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, '*src');
- if ($ffloat != $tfloat) {
- if ($ffloat) {
- my $mult = getFloatToIntMult($tsize);
- if (!$tsigned) { # bump from -1.0f/1.0f to 0.0f/2.0f
- $code = "($code + 1.0f)";
- }
- $code = "(($tctype) ($code * $mult))";
- } else {
- # $divby will be the reciprocal, to avoid pipeline stalls
- # from floating point division...so multiply it.
- my $divby = getIntToFloatDivBy($fsize);
- $code = "(((float) $code) * $divby)";
- if (!$fsigned) { # bump from 0.0f/2.0f to -1.0f/1.0f.
- $code = "($code - 1.0f)";
- }
- }
- } else {
- # All integer conversions here.
- if ($fsigned != $tsigned) {
- my $signflipval = getSignFlipVal($fsize);
- $code = "(($code) ^ $signflipval)";
- }
-
- my $shiftval = abs($fsize - $tsize);
- if ($fsize < $tsize) {
- $code = "((($tctype) $code) << $shiftval)";
- } elsif ($fsize > $tsize) {
- $code = "(($tctype) ($code >> $shiftval))";
- }
- }
-
- my $swap = getSwapFunc($tsize, $tsigned, $tfloat, $tendian, 'val');
-
- print < $tsize) {
- my $divby = $fsize / $tsize;
- print(" cvt->len_cvt /= $divby;\n");
- } elsif ($fsize < $tsize) {
- my $mult = $tsize / $fsize;
- print(" cvt->len_cvt *= $mult;\n");
- }
-
- print <filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, AUDIO_$to);
- }
-}
-
-EOF
-
- } else {
- if ($fsigned != $tsigned) {
- $funcs{$hashid} = 'SDL_ConvertSigned';
- } elsif ($ffloat != $tfloat) {
- $funcs{$hashid} = 'SDL_ConvertFloat';
- } elsif ($fsize != $tsize) {
- $funcs{$hashid} = 'SDL_ConvertSize';
- } elsif ($fendian ne $tendian) {
- $funcs{$hashid} = 'SDL_ConvertEndian';
- } else {
- die("error in script.\n");
- }
- }
-}
-
-
-sub buildTypeConverters {
- print "#if !NO_CONVERTERS\n\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@audiotypes) {
- my $to = $_;
- buildCvtFunc($from, $to);
- }
- }
- print "#endif /* !NO_CONVERTERS */\n\n\n";
-
- print "const SDL_AudioTypeFilters sdl_audio_type_filters[] =\n{\n";
- print "#if !NO_CONVERTERS\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@audiotypes) {
- my $to = $_;
- if ($from ne $to) {
- my $hashid = getTypeConvertHashId($from, $to);
- my $sym = $funcs{$hashid};
- print(" { AUDIO_$from, AUDIO_$to, $sym },\n");
- }
- }
- }
- print "#endif /* !NO_CONVERTERS */\n";
-
- print(" { 0, 0, NULL }\n");
- print "};\n\n\n";
-}
-
-sub getBiggerCtype {
- my ($isfloat, $size) = @_;
-
- if ($isfloat) {
- if ($size == 32) {
- return 'double';
- }
- die("bug in script.\n");
- }
-
- if ($size == 8) {
- return 'Sint16';
- } elsif ($size == 16) {
- return 'Sint32'
- } elsif ($size == 32) {
- return 'Sint64'
- }
-
- die("bug in script.\n");
-}
-
-
-# These handle arbitrary resamples...44100Hz to 48000Hz, for example.
-# Man, this code is skanky.
-sub buildArbitraryResampleFunc {
- # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc().
- my ($from, $channels, $upsample) = @_;
- my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
-
- my $bigger = getBiggerCtype($ffloat, $fsize);
- my $interp = ($ffloat) ? '* 0.5' : '>> 1';
-
- my $resample = ($upsample) ? 'Upsample' : 'Downsample';
- my $hashid = getResamplerHashId($from, $channels, $upsample, 0);
- my $sym = "SDL_${resample}_${from}_${channels}c";
- $funcs{$hashid} = $sym;
- $custom_converters++;
-
- my $fudge = $fsize * $channels * 2; # !!! FIXME
- my $eps_adjust = ($upsample) ? 'dstsize' : 'srcsize';
- my $incr = '';
- my $incr2 = '';
- my $block_align = $channels * $fsize/8;
-
-
- # !!! FIXME: DEBUG_CONVERT should report frequencies.
- print <rate_incr);
-#endif
-
- const int srcsize = cvt->len_cvt - $fudge;
- const int dstsize = (int) (((double)(cvt->len_cvt/${block_align})) * cvt->rate_incr) * ${block_align};
- register int eps = 0;
-EOF
-
- my $endcomparison = '!=';
-
- # Upsampling (growing the buffer) needs to work backwards, since we
- # overwrite the buffer as we go.
- if ($upsample) {
- $endcomparison = '>='; # dst > target
- print <buf + dstsize)) - $channels;
- const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
- const $fctype *target = ((const $fctype *) cvt->buf);
-EOF
- } else {
- $endcomparison = '<'; # dst < target
- print <buf;
- const $fctype *src = ($fctype *) cvt->buf;
- const $fctype *target = (const $fctype *) (cvt->buf + dstsize);
-EOF
- }
-
- for (my $i = 0; $i < $channels; $i++) {
- my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
- my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
- print <= dstsize) {
- $incr2;
-EOF
- } else { # downsample.
- $incr = ($channels == 1) ? 'src++' : "src += $channels";
- print <= srcsize) {
-EOF
- for (my $i = 0; $i < $channels; $i++) {
- my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "sample${i}");
- print <len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-EOF
-
-}
-
-# These handle clean resamples...doubling and quadrupling the sample rate, etc.
-sub buildMultipleResampleFunc {
- # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc().
- my ($from, $channels, $upsample, $multiple) = @_;
- my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
-
- my $bigger = getBiggerCtype($ffloat, $fsize);
- my $interp = ($ffloat) ? '* 0.5' : '>> 1';
- my $interp2 = ($ffloat) ? '* 0.25' : '>> 2';
- my $mult3 = ($ffloat) ? '3.0' : '3';
- my $lencvtop = ($upsample) ? '*' : '/';
-
- my $resample = ($upsample) ? 'Upsample' : 'Downsample';
- my $hashid = getResamplerHashId($from, $channels, $upsample, $multiple);
- my $sym = "SDL_${resample}_${from}_${channels}c_x${multiple}";
- $funcs{$hashid} = $sym;
- $custom_converters++;
-
- # !!! FIXME: DEBUG_CONVERT should report frequencies.
- print <len_cvt $lencvtop $multiple;
-EOF
-
- my $endcomparison = '!=';
-
- # Upsampling (growing the buffer) needs to work backwards, since we
- # overwrite the buffer as we go.
- if ($upsample) {
- $endcomparison = '>='; # dst > target
- print <buf + dstsize)) - $channels * $multiple;
- const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
- const $fctype *target = ((const $fctype *) cvt->buf);
-EOF
- } else {
- $endcomparison = '<'; # dst < target
- print <buf;
- const $fctype *src = ($fctype *) cvt->buf;
- const $fctype *target = (const $fctype *) (cvt->buf + dstsize);
-EOF
- }
-
- for (my $i = 0; $i < $channels; $i++) {
- my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
- my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
- print <= 0; $i--) {
- my $dsti = $i + $channels;
- print <= 0; $i--) {
- my $dsti = $i;
- print <= 0; $i--) {
- my $dsti = $i + ($channels * 3);
- print <= 0; $i--) {
- my $dsti = $i + ($channels * 2);
- print <= 0; $i--) {
- my $dsti = $i + ($channels * 1);
- print <= 0; $i--) {
- my $dsti = $i + ($channels * 0);
- print <len_cvt = dstsize;
- if (cvt->filters[++cvt->filter_index]) {
- cvt->filters[cvt->filter_index] (cvt, format);
- }
-}
-
-EOF
-
-}
-
-sub buildResamplers {
- print "#if !NO_RESAMPLERS\n\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@channels) {
- my $channel = $_;
- buildArbitraryResampleFunc($from, $channel, 1);
- buildArbitraryResampleFunc($from, $channel, 0);
- }
- }
-
- print "\n#if !LESS_RESAMPLERS\n\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@channels) {
- my $channel = $_;
- for (my $multiple = 2; $multiple <= 4; $multiple += 2) {
- buildMultipleResampleFunc($from, $channel, 1, $multiple);
- buildMultipleResampleFunc($from, $channel, 0, $multiple);
- }
- }
- }
-
- print "#endif /* !LESS_RESAMPLERS */\n";
- print "#endif /* !NO_RESAMPLERS */\n\n\n";
-
- print "const SDL_AudioRateFilters sdl_audio_rate_filters[] =\n{\n";
- print "#if !NO_RESAMPLERS\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@channels) {
- my $channel = $_;
- for (my $upsample = 0; $upsample <= 1; $upsample++) {
- my $hashid = getResamplerHashId($from, $channel, $upsample, 0);
- my $sym = $funcs{$hashid};
- print(" { AUDIO_$from, $channel, $upsample, 0, $sym },\n");
- }
- }
- }
-
- print "#if !LESS_RESAMPLERS\n";
- foreach (@audiotypes) {
- my $from = $_;
- foreach (@channels) {
- my $channel = $_;
- for (my $multiple = 2; $multiple <= 4; $multiple += 2) {
- for (my $upsample = 0; $upsample <= 1; $upsample++) {
- my $hashid = getResamplerHashId($from, $channel, $upsample, $multiple);
- my $sym = $funcs{$hashid};
- print(" { AUDIO_$from, $channel, $upsample, $multiple, $sym },\n");
- }
- }
- }
- }
-
- print "#endif /* !LESS_RESAMPLERS */\n";
- print "#endif /* !NO_RESAMPLERS */\n";
- print(" { 0, 0, 0, 0, NULL }\n");
- print "};\n\n";
-}
-
-
-# mainline ...
-
-outputHeader();
-buildTypeConverters();
-buildResamplers();
-outputFooter();
-
-exit 0;
-
-# end of sdlgenaudiocvt.pl ...
-
diff --git a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.c b/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.c
deleted file mode 100644
index dff234b401..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* WinRT NOTICE:
-
- A few changes to SDL's XAudio2 backend were warranted by API
- changes to Windows. Many, but not all of these are documented by Microsoft
- at:
- http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx
-
- 1. Windows' thread synchronization function, CreateSemaphore, was removed
- from WinRT. SDL's semaphore API was substituted instead.
- 2. The method calls, IXAudio2::GetDeviceCount and IXAudio2::GetDeviceDetails
- were removed from the XAudio2 API. Microsoft is telling developers to
- use APIs in Windows::Foundation instead.
- For SDL, the missing methods were reimplemented using the APIs Microsoft
- said to use.
- 3. CoInitialize and CoUninitialize are not available in WinRT.
- These calls were removed, as COM will have been initialized earlier,
- at least by the call to the WinRT app's main function
- (aka 'int main(Platform::Array^)). (DLudwig:
- This was my understanding of how WinRT: the 'main' function uses
- a tag of [MTAThread], which should initialize COM. My understanding
- of COM is somewhat limited, and I may be incorrect here.)
- 4. IXAudio2::CreateMasteringVoice changed its integer-based 'DeviceIndex'
- argument to a string-based one, 'szDeviceId'. In WinRT, the
- string-based argument will be used.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_AUDIO_DRIVER_XAUDIO2
-
-#include "../../core/windows/SDL_windows.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_assert.h"
-
-#ifdef __GNUC__
-/* The configure script already did any necessary checking */
-# define SDL_XAUDIO2_HAS_SDK 1
-#elif defined(__WINRT__)
-/* WinRT always has access to the XAudio 2 SDK (albeit with a header file
- that doesn't compile as C code).
-*/
-# define SDL_XAUDIO2_HAS_SDK
-#include "SDL_xaudio2.h" /* ... compiles as C code, in contrast to XAudio2 headers
- in the Windows SDK, v.10.0.10240.0 (Win 10's initial SDK)
- */
-#else
-/* XAudio2 exists in the last DirectX SDK as well as the latest Windows SDK.
- To enable XAudio2 support, you will need to add the location of your DirectX SDK headers to
- the SDL projects additional include directories and then set SDL_XAUDIO2_HAS_SDK=1 as a
- preprocessor define
- */
-#if 0 /* See comment above */
-#include
-#if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
-# pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.")
-#else
-# define SDL_XAUDIO2_HAS_SDK 1
-#endif
-#endif
-#endif /* 0 */
-
-#ifdef SDL_XAUDIO2_HAS_SDK
-
-/* Check to see if we're compiling for XAudio 2.8, or higher. */
-#ifdef WINVER
-#if WINVER >= 0x0602 /* Windows 8 SDK or higher? */
-#define SDL_XAUDIO2_WIN8 1
-#endif
-#endif
-
-#if !defined(_SDL_XAUDIO2_H)
-#define INITGUID 1
-#include
-#endif
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-#ifdef __WINRT__
-#include "SDL_xaudio2_winrthelpers.h"
-#endif
-
-/* Fixes bug 1210 where some versions of gcc need named parameters */
-#ifdef __GNUC__
-#ifdef THIS
-#undef THIS
-#endif
-#define THIS INTERFACE *p
-#ifdef THIS_
-#undef THIS_
-#endif
-#define THIS_ INTERFACE *p,
-#endif
-
-struct SDL_PrivateAudioData
-{
- IXAudio2 *ixa2;
- IXAudio2SourceVoice *source;
- IXAudio2MasteringVoice *mastering;
- SDL_sem * semaphore;
- Uint8 *mixbuf;
- int mixlen;
- Uint8 *nextbuf;
-};
-
-
-static void
-XAUDIO2_DetectDevices(void)
-{
- IXAudio2 *ixa2 = NULL;
- UINT32 devcount = 0;
- UINT32 i = 0;
-
- if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
- SDL_SetError("XAudio2: XAudio2Create() failed at detection.");
- return;
- } else if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) {
- SDL_SetError("XAudio2: IXAudio2::GetDeviceCount() failed.");
- IXAudio2_Release(ixa2);
- return;
- }
-
- for (i = 0; i < devcount; i++) {
- XAUDIO2_DEVICE_DETAILS details;
- if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) {
- char *str = WIN_StringToUTF8(details.DisplayName);
- if (str != NULL) {
- SDL_AddAudioDevice(SDL_FALSE, str, (void *) ((size_t) i+1));
- SDL_free(str); /* SDL_AddAudioDevice made a copy of the string. */
- }
- }
- }
-
- IXAudio2_Release(ixa2);
-}
-
-static void STDMETHODCALLTYPE
-VoiceCBOnBufferEnd(THIS_ void *data)
-{
- /* Just signal the SDL audio thread and get out of XAudio2's way. */
- SDL_AudioDevice *this = (SDL_AudioDevice *) data;
- SDL_SemPost(this->hidden->semaphore);
-}
-
-static void STDMETHODCALLTYPE
-VoiceCBOnVoiceError(THIS_ void *data, HRESULT Error)
-{
- SDL_AudioDevice *this = (SDL_AudioDevice *) data;
- SDL_OpenedAudioDeviceDisconnected(this);
-}
-
-/* no-op callbacks... */
-static void STDMETHODCALLTYPE VoiceCBOnStreamEnd(THIS) {}
-static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassStart(THIS_ UINT32 b) {}
-static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassEnd(THIS) {}
-static void STDMETHODCALLTYPE VoiceCBOnBufferStart(THIS_ void *data) {}
-static void STDMETHODCALLTYPE VoiceCBOnLoopEnd(THIS_ void *data) {}
-
-
-static Uint8 *
-XAUDIO2_GetDeviceBuf(_THIS)
-{
- return this->hidden->nextbuf;
-}
-
-static void
-XAUDIO2_PlayDevice(_THIS)
-{
- XAUDIO2_BUFFER buffer;
- Uint8 *mixbuf = this->hidden->mixbuf;
- Uint8 *nextbuf = this->hidden->nextbuf;
- const int mixlen = this->hidden->mixlen;
- IXAudio2SourceVoice *source = this->hidden->source;
- HRESULT result = S_OK;
-
- if (!this->enabled) { /* shutting down? */
- return;
- }
-
- /* Submit the next filled buffer */
- SDL_zero(buffer);
- buffer.AudioBytes = mixlen;
- buffer.pAudioData = nextbuf;
- buffer.pContext = this;
-
- if (nextbuf == mixbuf) {
- nextbuf += mixlen;
- } else {
- nextbuf = mixbuf;
- }
- this->hidden->nextbuf = nextbuf;
-
- result = IXAudio2SourceVoice_SubmitSourceBuffer(source, &buffer, NULL);
- if (result == XAUDIO2_E_DEVICE_INVALIDATED) {
- /* !!! FIXME: possibly disconnected or temporary lost. Recover? */
- }
-
- if (result != S_OK) { /* uhoh, panic! */
- IXAudio2SourceVoice_FlushSourceBuffers(source);
- SDL_OpenedAudioDeviceDisconnected(this);
- }
-}
-
-static void
-XAUDIO2_WaitDevice(_THIS)
-{
- if (this->enabled) {
- SDL_SemWait(this->hidden->semaphore);
- }
-}
-
-static void
-XAUDIO2_WaitDone(_THIS)
-{
- IXAudio2SourceVoice *source = this->hidden->source;
- XAUDIO2_VOICE_STATE state;
- SDL_assert(!this->enabled); /* flag that stops playing. */
- IXAudio2SourceVoice_Discontinuity(source);
-#if SDL_XAUDIO2_WIN8
- IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
-#else
- IXAudio2SourceVoice_GetState(source, &state);
-#endif
- while (state.BuffersQueued > 0) {
- SDL_SemWait(this->hidden->semaphore);
-#if SDL_XAUDIO2_WIN8
- IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
-#else
- IXAudio2SourceVoice_GetState(source, &state);
-#endif
- }
-}
-
-
-static void
-XAUDIO2_CloseDevice(_THIS)
-{
- if (this->hidden != NULL) {
- IXAudio2 *ixa2 = this->hidden->ixa2;
- IXAudio2SourceVoice *source = this->hidden->source;
- IXAudio2MasteringVoice *mastering = this->hidden->mastering;
-
- if (source != NULL) {
- IXAudio2SourceVoice_Stop(source, 0, XAUDIO2_COMMIT_NOW);
- IXAudio2SourceVoice_FlushSourceBuffers(source);
- IXAudio2SourceVoice_DestroyVoice(source);
- }
- if (ixa2 != NULL) {
- IXAudio2_StopEngine(ixa2);
- }
- if (mastering != NULL) {
- IXAudio2MasteringVoice_DestroyVoice(mastering);
- }
- if (ixa2 != NULL) {
- IXAudio2_Release(ixa2);
- }
- SDL_free(this->hidden->mixbuf);
- if (this->hidden->semaphore != NULL) {
- SDL_DestroySemaphore(this->hidden->semaphore);
- }
-
- SDL_free(this->hidden);
- this->hidden = NULL;
- }
-}
-
-static int
-XAUDIO2_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
-{
- HRESULT result = S_OK;
- WAVEFORMATEX waveformat;
- int valid_format = 0;
- SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
- IXAudio2 *ixa2 = NULL;
- IXAudio2SourceVoice *source = NULL;
-#if defined(SDL_XAUDIO2_WIN8)
- LPCWSTR devId = NULL;
-#else
- UINT32 devId = 0; /* 0 == system default device. */
-#endif
-
- static IXAudio2VoiceCallbackVtbl callbacks_vtable = {
- VoiceCBOnVoiceProcessPassStart,
- VoiceCBOnVoiceProcessPassEnd,
- VoiceCBOnStreamEnd,
- VoiceCBOnBufferStart,
- VoiceCBOnBufferEnd,
- VoiceCBOnLoopEnd,
- VoiceCBOnVoiceError
- };
-
- static IXAudio2VoiceCallback callbacks = { &callbacks_vtable };
-
-#if defined(SDL_XAUDIO2_WIN8)
- /* !!! FIXME: hook up hotplugging. */
-#else
- if (handle != NULL) { /* specific device requested? */
- /* -1 because we increment the original value to avoid NULL. */
- const size_t val = ((size_t) handle) - 1;
- devId = (UINT32) val;
- }
-#endif
-
- if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
- return SDL_SetError("XAudio2: XAudio2Create() failed at open.");
- }
-
- /*
- XAUDIO2_DEBUG_CONFIGURATION debugConfig;
- debugConfig.TraceMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS | XAUDIO2_LOG_DETAIL | XAUDIO2_LOG_FUNC_CALLS | XAUDIO2_LOG_TIMING | XAUDIO2_LOG_LOCKS | XAUDIO2_LOG_MEMORY | XAUDIO2_LOG_STREAMING;
- debugConfig.BreakMask = XAUDIO2_LOG_ERRORS; //XAUDIO2_LOG_WARNINGS;
- debugConfig.LogThreadID = TRUE;
- debugConfig.LogFileline = TRUE;
- debugConfig.LogFunctionName = TRUE;
- debugConfig.LogTiming = TRUE;
- ixa2->SetDebugConfiguration(&debugConfig);
- */
-
- /* Initialize all variables that we clean on shutdown */
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- if (this->hidden == NULL) {
- IXAudio2_Release(ixa2);
- return SDL_OutOfMemory();
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- this->hidden->ixa2 = ixa2;
- this->hidden->semaphore = SDL_CreateSemaphore(1);
- if (this->hidden->semaphore == NULL) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: CreateSemaphore() failed!");
- }
-
- while ((!valid_format) && (test_format)) {
- switch (test_format) {
- case AUDIO_U8:
- case AUDIO_S16:
- case AUDIO_S32:
- case AUDIO_F32:
- this->spec.format = test_format;
- valid_format = 1;
- break;
- }
- test_format = SDL_NextAudioFormat();
- }
-
- if (!valid_format) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: Unsupported audio format");
- }
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(&this->spec);
-
- /* We feed a Source, it feeds the Mastering, which feeds the device. */
- this->hidden->mixlen = this->spec.size;
- this->hidden->mixbuf = (Uint8 *) SDL_malloc(2 * this->hidden->mixlen);
- if (this->hidden->mixbuf == NULL) {
- XAUDIO2_CloseDevice(this);
- return SDL_OutOfMemory();
- }
- this->hidden->nextbuf = this->hidden->mixbuf;
- SDL_memset(this->hidden->mixbuf, 0, 2 * this->hidden->mixlen);
-
- /* We use XAUDIO2_DEFAULT_CHANNELS instead of this->spec.channels. On
- Xbox360, this means 5.1 output, but on Windows, it means "figure out
- what the system has." It might be preferable to let XAudio2 blast
- stereo output to appropriate surround sound configurations
- instead of clamping to 2 channels, even though we'll configure the
- Source Voice for whatever number of channels you supply. */
-#if SDL_XAUDIO2_WIN8
- result = IXAudio2_CreateMasteringVoice(ixa2, &this->hidden->mastering,
- XAUDIO2_DEFAULT_CHANNELS,
- this->spec.freq, 0, devId, NULL, AudioCategory_GameEffects);
-#else
- result = IXAudio2_CreateMasteringVoice(ixa2, &this->hidden->mastering,
- XAUDIO2_DEFAULT_CHANNELS,
- this->spec.freq, 0, devId, NULL);
-#endif
- if (result != S_OK) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: Couldn't create mastering voice");
- }
-
- SDL_zero(waveformat);
- if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
- waveformat.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
- } else {
- waveformat.wFormatTag = WAVE_FORMAT_PCM;
- }
- waveformat.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format);
- waveformat.nChannels = this->spec.channels;
- waveformat.nSamplesPerSec = this->spec.freq;
- waveformat.nBlockAlign =
- waveformat.nChannels * (waveformat.wBitsPerSample / 8);
- waveformat.nAvgBytesPerSec =
- waveformat.nSamplesPerSec * waveformat.nBlockAlign;
- waveformat.cbSize = sizeof(waveformat);
-
-#ifdef __WINRT__
- // DLudwig: for now, make XAudio2 do sample rate conversion, just to
- // get the loopwave test to work.
- //
- // TODO, WinRT: consider removing WinRT-specific source-voice creation code from SDL_xaudio2.c
- result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat,
- 0,
- 1.0f, &callbacks, NULL, NULL);
-#else
- result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat,
- XAUDIO2_VOICE_NOSRC |
- XAUDIO2_VOICE_NOPITCH,
- 1.0f, &callbacks, NULL, NULL);
-
-#endif
- if (result != S_OK) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: Couldn't create source voice");
- }
- this->hidden->source = source;
-
- /* Start everything playing! */
- result = IXAudio2_StartEngine(ixa2);
- if (result != S_OK) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: Couldn't start engine");
- }
-
- result = IXAudio2SourceVoice_Start(source, 0, XAUDIO2_COMMIT_NOW);
- if (result != S_OK) {
- XAUDIO2_CloseDevice(this);
- return SDL_SetError("XAudio2: Couldn't start source voice");
- }
-
- return 0; /* good to go. */
-}
-
-static void
-XAUDIO2_Deinitialize(void)
-{
-#if defined(__WIN32__)
- WIN_CoUninitialize();
-#endif
-}
-
-#endif /* SDL_XAUDIO2_HAS_SDK */
-
-
-static int
-XAUDIO2_Init(SDL_AudioDriverImpl * impl)
-{
-#ifndef SDL_XAUDIO2_HAS_SDK
- SDL_SetError("XAudio2: SDL was built without XAudio2 support (old DirectX SDK).");
- return 0; /* no XAudio2 support, ever. Update your SDK! */
-#else
- /* XAudio2Create() is a macro that uses COM; we don't load the .dll */
- IXAudio2 *ixa2 = NULL;
-#if defined(__WIN32__)
- // TODO, WinRT: Investigate using CoInitializeEx here
- if (FAILED(WIN_CoInitialize())) {
- SDL_SetError("XAudio2: CoInitialize() failed");
- return 0;
- }
-#endif
-
- if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
-#if defined(__WIN32__)
- WIN_CoUninitialize();
-#endif
- SDL_SetError("XAudio2: XAudio2Create() failed at initialization");
- return 0; /* not available. */
- }
- IXAudio2_Release(ixa2);
-
- /* Set the function pointers */
- impl->DetectDevices = XAUDIO2_DetectDevices;
- impl->OpenDevice = XAUDIO2_OpenDevice;
- impl->PlayDevice = XAUDIO2_PlayDevice;
- impl->WaitDevice = XAUDIO2_WaitDevice;
- impl->WaitDone = XAUDIO2_WaitDone;
- impl->GetDeviceBuf = XAUDIO2_GetDeviceBuf;
- impl->CloseDevice = XAUDIO2_CloseDevice;
- impl->Deinitialize = XAUDIO2_Deinitialize;
-
- /* !!! FIXME: We can apparently use a C++ interface on Windows 8
- * !!! FIXME: (Windows::Devices::Enumeration::DeviceInformation) for device
- * !!! FIXME: detection, but it's not implemented here yet.
- * !!! FIXME: see http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx
- * !!! FIXME: for now, force the default device.
- */
-#if defined(SDL_XAUDIO2_WIN8) || defined(__WINRT__)
- impl->OnlyHasDefaultOutputDevice = 1;
-#endif
-
- return 1; /* this audio target is available. */
-#endif
-}
-
-AudioBootStrap XAUDIO2_bootstrap = {
- "xaudio2", "XAudio2", XAUDIO2_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_XAUDIO2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.h b/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.h
deleted file mode 100644
index 864eba451d..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2.h
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_XAUDIO2_H
-#define _SDL_XAUDIO2_H
-
-#include
-#include
-#include
-
-/* XAudio2 packs its structure members together as tightly as possible.
- This pragma is needed to ensure compatibility with XAudio2 on 64-bit
- platforms.
-*/
-#pragma pack(push, 1)
-
-typedef interface IXAudio2 IXAudio2;
-typedef interface IXAudio2SourceVoice IXAudio2SourceVoice;
-typedef interface IXAudio2MasteringVoice IXAudio2MasteringVoice;
-typedef interface IXAudio2EngineCallback IXAudio2EngineCallback;
-typedef interface IXAudio2VoiceCallback IXAudio2VoiceCallback;
-typedef interface IXAudio2Voice IXAudio2Voice;
-typedef interface IXAudio2SubmixVoice IXAudio2SubmixVoice;
-
-typedef enum _AUDIO_STREAM_CATEGORY {
- AudioCategory_Other = 0,
- AudioCategory_ForegroundOnlyMedia,
- AudioCategory_BackgroundCapableMedia,
- AudioCategory_Communications,
- AudioCategory_Alerts,
- AudioCategory_SoundEffects,
- AudioCategory_GameEffects,
- AudioCategory_GameMedia,
- AudioCategory_GameChat,
- AudioCategory_Movie,
- AudioCategory_Media
-} AUDIO_STREAM_CATEGORY;
-
-typedef struct XAUDIO2_BUFFER {
- UINT32 Flags;
- UINT32 AudioBytes;
- const BYTE *pAudioData;
- UINT32 PlayBegin;
- UINT32 PlayLength;
- UINT32 LoopBegin;
- UINT32 LoopLength;
- UINT32 LoopCount;
- void *pContext;
-} XAUDIO2_BUFFER;
-
-typedef struct XAUDIO2_BUFFER_WMA {
- const UINT32 *pDecodedPacketCumulativeBytes;
- UINT32 PacketCount;
-} XAUDIO2_BUFFER_WMA;
-
-typedef struct XAUDIO2_SEND_DESCRIPTOR {
- UINT32 Flags;
- IXAudio2Voice *pOutputVoice;
-} XAUDIO2_SEND_DESCRIPTOR;
-
-typedef struct XAUDIO2_VOICE_SENDS {
- UINT32 SendCount;
- XAUDIO2_SEND_DESCRIPTOR *pSends;
-} XAUDIO2_VOICE_SENDS;
-
-typedef struct XAUDIO2_EFFECT_DESCRIPTOR {
- IUnknown *pEffect;
- BOOL InitialState;
- UINT32 OutputChannels;
-} XAUDIO2_EFFECT_DESCRIPTOR;
-
-typedef struct XAUDIO2_EFFECT_CHAIN {
- UINT32 EffectCount;
- XAUDIO2_EFFECT_DESCRIPTOR *pEffectDescriptors;
-} XAUDIO2_EFFECT_CHAIN;
-
-typedef struct XAUDIO2_PERFORMANCE_DATA {
- UINT64 AudioCyclesSinceLastQuery;
- UINT64 TotalCyclesSinceLastQuery;
- UINT32 MinimumCyclesPerQuantum;
- UINT32 MaximumCyclesPerQuantum;
- UINT32 MemoryUsageInBytes;
- UINT32 CurrentLatencyInSamples;
- UINT32 GlitchesSinceEngineStarted;
- UINT32 ActiveSourceVoiceCount;
- UINT32 TotalSourceVoiceCount;
- UINT32 ActiveSubmixVoiceCount;
- UINT32 ActiveResamplerCount;
- UINT32 ActiveMatrixMixCount;
- UINT32 ActiveXmaSourceVoices;
- UINT32 ActiveXmaStreams;
-} XAUDIO2_PERFORMANCE_DATA;
-
-typedef struct XAUDIO2_DEBUG_CONFIGURATION {
- UINT32 TraceMask;
- UINT32 BreakMask;
- BOOL LogThreadID;
- BOOL LogFileline;
- BOOL LogFunctionName;
- BOOL LogTiming;
-} XAUDIO2_DEBUG_CONFIGURATION;
-
-typedef struct XAUDIO2_VOICE_DETAILS {
- UINT32 CreationFlags;
- UINT32 ActiveFlags;
- UINT32 InputChannels;
- UINT32 InputSampleRate;
-} XAUDIO2_VOICE_DETAILS;
-
-typedef enum XAUDIO2_FILTER_TYPE {
- LowPassFilter = 0,
- BandPassFilter = 1,
- HighPassFilter = 2,
- NotchFilter = 3,
- LowPassOnePoleFilter = 4,
- HighPassOnePoleFilter = 5
-} XAUDIO2_FILTER_TYPE;
-
-typedef struct XAUDIO2_FILTER_PARAMETERS {
- XAUDIO2_FILTER_TYPE Type;
- float Frequency;
- float OneOverQ;
-} XAUDIO2_FILTER_PARAMETERS;
-
-typedef struct XAUDIO2_VOICE_STATE {
- void *pCurrentBufferContext;
- UINT32 BuffersQueued;
- UINT64 SamplesPlayed;
-} XAUDIO2_VOICE_STATE;
-
-
-typedef UINT32 XAUDIO2_PROCESSOR;
-#define Processor1 0x00000001
-#define XAUDIO2_DEFAULT_PROCESSOR Processor1
-
-#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004
-#define XAUDIO2_COMMIT_NOW 0
-#define XAUDIO2_VOICE_NOSAMPLESPLAYED 0x0100
-#define XAUDIO2_DEFAULT_CHANNELS 0
-
-extern HRESULT __stdcall XAudio2Create(
- _Out_ IXAudio2 **ppXAudio2,
- _In_ UINT32 Flags,
- _In_ XAUDIO2_PROCESSOR XAudio2Processor
- );
-
-#undef INTERFACE
-#define INTERFACE IXAudio2
-typedef interface IXAudio2 {
- const struct IXAudio2Vtbl FAR* lpVtbl;
-} IXAudio2;
-typedef const struct IXAudio2Vtbl IXAudio2Vtbl;
-const struct IXAudio2Vtbl
-{
- /* IUnknown */
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- /* IXAudio2 */
- STDMETHOD_(HRESULT, RegisterForCallbacks)(THIS, IXAudio2EngineCallback *pCallback) PURE;
- STDMETHOD_(VOID, UnregisterForCallbacks)(THIS, IXAudio2EngineCallback *pCallback) PURE;
- STDMETHOD_(HRESULT, CreateSourceVoice)(THIS, IXAudio2SourceVoice **ppSourceVoice,
- const WAVEFORMATEX *pSourceFormat,
- UINT32 Flags,
- float MaxFrequencyRatio,
- IXAudio2VoiceCallback *pCallback,
- const XAUDIO2_VOICE_SENDS *pSendList,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
- STDMETHOD_(HRESULT, CreateSubmixVoice)(THIS, IXAudio2SubmixVoice **ppSubmixVoice,
- UINT32 InputChannels,
- UINT32 InputSampleRate,
- UINT32 Flags,
- UINT32 ProcessingStage,
- const XAUDIO2_VOICE_SENDS *pSendList,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
- STDMETHOD_(HRESULT, CreateMasteringVoice)(THIS, IXAudio2MasteringVoice **ppMasteringVoice,
- UINT32 InputChannels,
- UINT32 InputSampleRate,
- UINT32 Flags,
- LPCWSTR szDeviceId,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain,
- AUDIO_STREAM_CATEGORY StreamCategory) PURE;
- STDMETHOD_(HRESULT, StartEngine)(THIS) PURE;
- STDMETHOD_(VOID, StopEngine)(THIS) PURE;
- STDMETHOD_(HRESULT, CommitChanges)(THIS, UINT32 OperationSet) PURE;
- STDMETHOD_(HRESULT, GetPerformanceData)(THIS, XAUDIO2_PERFORMANCE_DATA *pPerfData) PURE;
- STDMETHOD_(HRESULT, SetDebugConfiguration)(THIS, XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration,
- VOID *pReserved) PURE;
-};
-
-#define IXAudio2_Release(A) ((A)->lpVtbl->Release(A))
-#define IXAudio2_CreateSourceVoice(A,B,C,D,E,F,G,H) ((A)->lpVtbl->CreateSourceVoice(A,B,C,D,E,F,G,H))
-#define IXAudio2_CreateMasteringVoice(A,B,C,D,E,F,G,H) ((A)->lpVtbl->CreateMasteringVoice(A,B,C,D,E,F,G,H))
-#define IXAudio2_StartEngine(A) ((A)->lpVtbl->StartEngine(A))
-#define IXAudio2_StopEngine(A) ((A)->lpVtbl->StopEngine(A))
-
-
-#undef INTERFACE
-#define INTERFACE IXAudio2SourceVoice
-typedef interface IXAudio2SourceVoice {
- const struct IXAudio2SourceVoiceVtbl FAR* lpVtbl;
-} IXAudio2SourceVoice;
-typedef const struct IXAudio2SourceVoiceVtbl IXAudio2SourceVoiceVtbl;
-const struct IXAudio2SourceVoiceVtbl
-{
- /* MSDN says that IXAudio2Voice inherits from IXAudio2, but MSVC's debugger
- * says otherwise, and that IXAudio2Voice doesn't inherit from any other
- * interface!
- */
-
- /* IXAudio2Voice */
- STDMETHOD_(VOID, GetVoiceDetails)(THIS, XAUDIO2_VOICE_DETAILS *pVoiceDetails) PURE;
- STDMETHOD_(HRESULT, SetOutputVoices)(THIS, const XAUDIO2_VOICE_SENDS *pSendList) PURE;
- STDMETHOD_(HRESULT, SetEffectChain)(THIS, const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
- STDMETHOD_(HRESULT, EnableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
- STDMETHOD_(HRESULT, DisableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetEffectState)(THIS, UINT32 EffectIndex, BOOL *pEnabled) PURE;
- STDMETHOD_(HRESULT, SetEffectParameters)(THIS, UINT32 EffectIndex,
- const void *pParameters,
- UINT32 ParametersByteSize,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetEffectParameters)(THIS, UINT32 EffectIndex,
- void *pParameters,
- UINT32 ParametersByteSize) PURE;
- STDMETHOD_(HRESULT, SetFilterParameters)(THIS, const XAUDIO2_FILTER_PARAMETERS *pParameters,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetFilterParameters)(THIS, XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
- STDMETHOD_(HRESULT, SetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
- XAUDIO2_FILTER_PARAMETERS *pParameters,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
- XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
- STDMETHOD_(HRESULT, SetVolume)(THIS, float Volume,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetVolume)(THIS, float *pVolume) PURE;
- STDMETHOD_(HRESULT, SetChannelVolumes)(THIS, UINT32 Channels,
- const float *pVolumes,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetChannelVolumes)(THIS, UINT32 Channels,
- float *pVolumes) PURE;
- STDMETHOD_(HRESULT, SetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
- UINT32 SourceChannels,
- UINT32 DestinationChannels,
- const float *pLevelMatrix,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
- UINT32 SourceChannels,
- UINT32 DestinationChannels,
- float *pLevelMatrix) PURE;
- STDMETHOD_(VOID, DestroyVoice)(THIS) PURE;
-
- /* IXAudio2SourceVoice */
- STDMETHOD_(HRESULT, Start)(THIS, UINT32 Flags,
- UINT32 OperationSet) PURE;
- STDMETHOD_(HRESULT, Stop)(THIS, UINT32 Flags,
- UINT32 OperationSet) PURE;
- STDMETHOD_(HRESULT, SubmitSourceBuffer)(THIS, const XAUDIO2_BUFFER *pBuffer,
- const XAUDIO2_BUFFER_WMA *pBufferWMA) PURE;
- STDMETHOD_(HRESULT, FlushSourceBuffers)(THIS) PURE;
- STDMETHOD_(HRESULT, Discontinuity)(THIS) PURE;
- STDMETHOD_(HRESULT, ExitLoop)(THIS, UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetState)(THIS, XAUDIO2_VOICE_STATE *pVoiceState,
- UINT32 Flags) PURE;
- STDMETHOD_(HRESULT, SetFrequencyRatio)(THIS, float Ratio,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetFrequencyRatio)(THIS, float *pRatio) PURE;
- STDMETHOD_(HRESULT, SetSourceSampleRate)(THIS, UINT32 NewSourceSampleRate) PURE;
-};
-
-#define IXAudio2SourceVoice_DestroyVoice(A) ((A)->lpVtbl->DestroyVoice(A))
-#define IXAudio2SourceVoice_Start(A,B,C) ((A)->lpVtbl->Start(A,B,C))
-#define IXAudio2SourceVoice_Stop(A,B,C) ((A)->lpVtbl->Stop(A,B,C))
-#define IXAudio2SourceVoice_SubmitSourceBuffer(A,B,C) ((A)->lpVtbl->SubmitSourceBuffer(A,B,C))
-#define IXAudio2SourceVoice_FlushSourceBuffers(A) ((A)->lpVtbl->FlushSourceBuffers(A))
-#define IXAudio2SourceVoice_Discontinuity(A) ((A)->lpVtbl->Discontinuity(A))
-#define IXAudio2SourceVoice_GetState(A,B,C) ((A)->lpVtbl->GetState(A,B,C))
-
-
-#undef INTERFACE
-#define INTERFACE IXAudio2MasteringVoice
-typedef interface IXAudio2MasteringVoice {
- const struct IXAudio2MasteringVoiceVtbl FAR* lpVtbl;
-} IXAudio2MasteringVoice;
-typedef const struct IXAudio2MasteringVoiceVtbl IXAudio2MasteringVoiceVtbl;
-const struct IXAudio2MasteringVoiceVtbl
-{
- /* MSDN says that IXAudio2Voice inherits from IXAudio2, but MSVC's debugger
- * says otherwise, and that IXAudio2Voice doesn't inherit from any other
- * interface!
- */
-
- /* IXAudio2Voice */
- STDMETHOD_(VOID, GetVoiceDetails)(THIS, XAUDIO2_VOICE_DETAILS *pVoiceDetails) PURE;
- STDMETHOD_(HRESULT, SetOutputVoices)(THIS, const XAUDIO2_VOICE_SENDS *pSendList) PURE;
- STDMETHOD_(HRESULT, SetEffectChain)(THIS, const XAUDIO2_EFFECT_CHAIN *pEffectChain) PURE;
- STDMETHOD_(HRESULT, EnableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
- STDMETHOD_(HRESULT, DisableEffect)(THIS, UINT32 EffectIndex, UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetEffectState)(THIS, UINT32 EffectIndex, BOOL *pEnabled) PURE;
- STDMETHOD_(HRESULT, SetEffectParameters)(THIS, UINT32 EffectIndex,
- const void *pParameters,
- UINT32 ParametersByteSize,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetEffectParameters)(THIS, UINT32 EffectIndex,
- void *pParameters,
- UINT32 ParametersByteSize) PURE;
- STDMETHOD_(HRESULT, SetFilterParameters)(THIS, const XAUDIO2_FILTER_PARAMETERS *pParameters,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetFilterParameters)(THIS, XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
- STDMETHOD_(HRESULT, SetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
- XAUDIO2_FILTER_PARAMETERS *pParameters,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetOutputFilterParameters)(THIS, IXAudio2Voice *pDestinationVoice,
- XAUDIO2_FILTER_PARAMETERS *pParameters) PURE;
- STDMETHOD_(HRESULT, SetVolume)(THIS, float Volume,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetVolume)(THIS, float *pVolume) PURE;
- STDMETHOD_(HRESULT, SetChannelVolumes)(THIS, UINT32 Channels,
- const float *pVolumes,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetChannelVolumes)(THIS, UINT32 Channels,
- float *pVolumes) PURE;
- STDMETHOD_(HRESULT, SetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
- UINT32 SourceChannels,
- UINT32 DestinationChannels,
- const float *pLevelMatrix,
- UINT32 OperationSet) PURE;
- STDMETHOD_(VOID, GetOutputMatrix)(THIS, IXAudio2Voice *pDestinationVoice,
- UINT32 SourceChannels,
- UINT32 DestinationChannels,
- float *pLevelMatrix) PURE;
- STDMETHOD_(VOID, DestroyVoice)(THIS) PURE;
-
- /* IXAudio2SourceVoice */
- STDMETHOD_(VOID, GetChannelMask)(THIS, DWORD *pChannelMask) PURE;
-};
-
-#define IXAudio2MasteringVoice_DestroyVoice(A) ((A)->lpVtbl->DestroyVoice(A))
-
-
-#undef INTERFACE
-#define INTERFACE IXAudio2VoiceCallback
-typedef interface IXAudio2VoiceCallback {
- const struct IXAudio2VoiceCallbackVtbl FAR* lpVtbl;
-} IXAudio2VoiceCallback;
-typedef const struct IXAudio2VoiceCallbackVtbl IXAudio2VoiceCallbackVtbl;
-const struct IXAudio2VoiceCallbackVtbl
-{
- /* MSDN says that IXAudio2VoiceCallback inherits from IXAudio2, but SDL's
- * own code says otherwise, and that IXAudio2VoiceCallback doesn't inherit
- * from any other interface!
- */
-
- /* IXAudio2VoiceCallback */
- STDMETHOD_(VOID, OnVoiceProcessingPassStart)(THIS, UINT32 BytesRequired) PURE;
- STDMETHOD_(VOID, OnVoiceProcessingPassEnd)(THIS) PURE;
- STDMETHOD_(VOID, OnStreamEnd)(THIS) PURE;
- STDMETHOD_(VOID, OnBufferStart)(THIS, void *pBufferContext) PURE;
- STDMETHOD_(VOID, OnBufferEnd)(THIS, void *pBufferContext) PURE;
- STDMETHOD_(VOID, OnLoopEnd)(THIS, void *pBufferContext) PURE;
- STDMETHOD_(VOID, OnVoiceError)(THIS, void *pBufferContext, HRESULT Error) PURE;
-};
-
-#pragma pack(pop) /* Undo pragma push */
-
-#endif /* _SDL_XAUDIO2_H */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp b/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp
deleted file mode 100644
index b2d67c7fb0..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#include
-#include "SDL_xaudio2_winrthelpers.h"
-
-#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
-using Windows::Devices::Enumeration::DeviceClass;
-using Windows::Devices::Enumeration::DeviceInformation;
-using Windows::Devices::Enumeration::DeviceInformationCollection;
-#endif
-
-extern "C" HRESULT __cdecl IXAudio2_GetDeviceCount(IXAudio2 * ixa2, UINT32 * devcount)
-{
-#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
- // There doesn't seem to be any audio device enumeration on Windows Phone.
- // In lieu of this, just treat things as if there is one and only one
- // audio device.
- *devcount = 1;
- return S_OK;
-#else
- // TODO, WinRT: make xaudio2 device enumeration only happen once, and in the background
- auto operation = DeviceInformation::FindAllAsync(DeviceClass::AudioRender);
- while (operation->Status != Windows::Foundation::AsyncStatus::Completed)
- {
- }
-
- DeviceInformationCollection^ devices = operation->GetResults();
- *devcount = devices->Size;
- return S_OK;
-#endif
-}
-
-extern "C" HRESULT IXAudio2_GetDeviceDetails(IXAudio2 * unused, UINT32 index, XAUDIO2_DEVICE_DETAILS * details)
-{
-#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
- // Windows Phone doesn't seem to have the same device enumeration APIs that
- // Windows 8/RT has, or it doesn't have them at all. In lieu of this,
- // just treat things as if there is one, and only one, default device.
- if (index != 0)
- {
- return XAUDIO2_E_INVALID_CALL;
- }
-
- if (details)
- {
- wcsncpy_s(details->DeviceID, ARRAYSIZE(details->DeviceID), L"default", _TRUNCATE);
- wcsncpy_s(details->DisplayName, ARRAYSIZE(details->DisplayName), L"default", _TRUNCATE);
- }
- return S_OK;
-#else
- auto operation = DeviceInformation::FindAllAsync(DeviceClass::AudioRender);
- while (operation->Status != Windows::Foundation::AsyncStatus::Completed)
- {
- }
-
- DeviceInformationCollection^ devices = operation->GetResults();
- if (index >= devices->Size)
- {
- return XAUDIO2_E_INVALID_CALL;
- }
-
- DeviceInformation^ d = devices->GetAt(index);
- if (details)
- {
- wcsncpy_s(details->DeviceID, ARRAYSIZE(details->DeviceID), d->Id->Data(), _TRUNCATE);
- wcsncpy_s(details->DisplayName, ARRAYSIZE(details->DisplayName), d->Name->Data(), _TRUNCATE);
- }
- return S_OK;
-#endif
-}
diff --git a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h b/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h
deleted file mode 100644
index aa6486f91c..0000000000
--- a/3rdparty/sdl2-2.0.4/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-//
-// Re-implementation of methods removed from XAudio2 (in WinRT):
-//
-
-typedef struct XAUDIO2_DEVICE_DETAILS
-{
- WCHAR DeviceID[256];
- WCHAR DisplayName[256];
- /* Other fields exist in the pre-Windows 8 version of this struct, however
- they weren't used by SDL, so they weren't added.
- */
-} XAUDIO2_DEVICE_DETAILS;
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HRESULT IXAudio2_GetDeviceCount(IXAudio2 * unused, UINT32 * devcount);
-HRESULT IXAudio2_GetDeviceDetails(IXAudio2 * unused, UINT32 index, XAUDIO2_DEVICE_DETAILS * details);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//
-// C-style macros to call XAudio2's methods in C++:
-//
-#ifdef __cplusplus
-/*
-#define IXAudio2_CreateMasteringVoice(A, B, C, D, E, F, G) (A)->CreateMasteringVoice((B), (C), (D), (E), (F), (G))
-#define IXAudio2_CreateSourceVoice(A, B, C, D, E, F, G, H) (A)->CreateSourceVoice((B), (C), (D), (E), (F), (G), (H))
-#define IXAudio2_QueryInterface(A, B, C) (A)->QueryInterface((B), (C))
-#define IXAudio2_Release(A) (A)->Release()
-#define IXAudio2_StartEngine(A) (A)->StartEngine()
-#define IXAudio2_StopEngine(A) (A)->StopEngine()
-
-#define IXAudio2MasteringVoice_DestroyVoice(A) (A)->DestroyVoice()
-
-#define IXAudio2SourceVoice_DestroyVoice(A) (A)->DestroyVoice()
-#define IXAudio2SourceVoice_Discontinuity(A) (A)->Discontinuity()
-#define IXAudio2SourceVoice_FlushSourceBuffers(A) (A)->FlushSourceBuffers()
-#define IXAudio2SourceVoice_GetState(A, B) (A)->GetState((B))
-#define IXAudio2SourceVoice_Start(A, B, C) (A)->Start((B), (C))
-#define IXAudio2SourceVoice_Stop(A, B, C) (A)->Stop((B), (C))
-#define IXAudio2SourceVoice_SubmitSourceBuffer(A, B, C) (A)->SubmitSourceBuffer((B), (C))
-*/
-#endif // ifdef __cplusplus
diff --git a/3rdparty/sdl2-2.0.4/src/core/linux/SDL_dbus.c b/3rdparty/sdl2-2.0.4/src/core/linux/SDL_dbus.c
deleted file mode 100644
index 5d0df050c8..0000000000
--- a/3rdparty/sdl2-2.0.4/src/core/linux/SDL_dbus.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-#include "SDL_dbus.h"
-
-#if SDL_USE_LIBDBUS
-/* we never link directly to libdbus. */
-#include "SDL_loadso.h"
-static const char *dbus_library = "libdbus-1.so.3";
-static void *dbus_handle = NULL;
-static unsigned int screensaver_cookie = 0;
-static SDL_DBusContext dbus = {0};
-
-static int
-LoadDBUSSyms(void)
-{
- #define SDL_DBUS_SYM2(x, y) \
- if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1
-
- #define SDL_DBUS_SYM(x) \
- SDL_DBUS_SYM2(x, dbus_##x)
-
- SDL_DBUS_SYM(bus_get_private);
- SDL_DBUS_SYM(bus_register);
- SDL_DBUS_SYM(bus_add_match);
- SDL_DBUS_SYM(connection_open_private);
- SDL_DBUS_SYM(connection_set_exit_on_disconnect);
- SDL_DBUS_SYM(connection_get_is_connected);
- SDL_DBUS_SYM(connection_add_filter);
- SDL_DBUS_SYM(connection_try_register_object_path);
- SDL_DBUS_SYM(connection_send);
- SDL_DBUS_SYM(connection_send_with_reply_and_block);
- SDL_DBUS_SYM(connection_close);
- SDL_DBUS_SYM(connection_unref);
- SDL_DBUS_SYM(connection_flush);
- SDL_DBUS_SYM(connection_read_write);
- SDL_DBUS_SYM(connection_dispatch);
- SDL_DBUS_SYM(message_is_signal);
- SDL_DBUS_SYM(message_new_method_call);
- SDL_DBUS_SYM(message_append_args);
- SDL_DBUS_SYM(message_get_args);
- SDL_DBUS_SYM(message_iter_init);
- SDL_DBUS_SYM(message_iter_next);
- SDL_DBUS_SYM(message_iter_get_basic);
- SDL_DBUS_SYM(message_iter_get_arg_type);
- SDL_DBUS_SYM(message_iter_recurse);
- SDL_DBUS_SYM(message_unref);
- SDL_DBUS_SYM(error_init);
- SDL_DBUS_SYM(error_is_set);
- SDL_DBUS_SYM(error_free);
- SDL_DBUS_SYM(get_local_machine_id);
- SDL_DBUS_SYM(free);
- SDL_DBUS_SYM(shutdown);
-
- #undef SDL_DBUS_SYM
- #undef SDL_DBUS_SYM2
-
- return 0;
-}
-
-static void
-UnloadDBUSLibrary(void)
-{
- if (dbus_handle != NULL) {
- SDL_UnloadObject(dbus_handle);
- dbus_handle = NULL;
- }
-}
-
-static int
-LoadDBUSLibrary(void)
-{
- int retval = 0;
- if (dbus_handle == NULL) {
- dbus_handle = SDL_LoadObject(dbus_library);
- if (dbus_handle == NULL) {
- retval = -1;
- /* Don't call SDL_SetError(): SDL_LoadObject already did. */
- } else {
- retval = LoadDBUSSyms();
- if (retval < 0) {
- UnloadDBUSLibrary();
- }
- }
- }
-
- return retval;
-}
-
-void
-SDL_DBus_Init(void)
-{
- if (!dbus.session_conn && LoadDBUSLibrary() != -1) {
- DBusError err;
- dbus.error_init(&err);
- dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
- if (dbus.error_is_set(&err)) {
- dbus.error_free(&err);
- if (dbus.session_conn) {
- dbus.connection_unref(dbus.session_conn);
- dbus.session_conn = NULL;
- }
- return; /* oh well */
- }
- dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0);
- }
-}
-
-void
-SDL_DBus_Quit(void)
-{
- if (dbus.session_conn) {
- dbus.connection_close(dbus.session_conn);
- dbus.connection_unref(dbus.session_conn);
- dbus.shutdown();
- SDL_memset(&dbus, 0, sizeof(dbus));
- }
- UnloadDBUSLibrary();
-}
-
-SDL_DBusContext *
-SDL_DBus_GetContext(void)
-{
- if(!dbus_handle || !dbus.session_conn){
- SDL_DBus_Init();
- }
-
- if(dbus_handle && dbus.session_conn){
- return &dbus;
- } else {
- return NULL;
- }
-}
-
-void
-SDL_DBus_ScreensaverTickle(void)
-{
- DBusConnection *conn = dbus.session_conn;
- if (conn != NULL) {
- DBusMessage *msg = dbus.message_new_method_call("org.gnome.ScreenSaver",
- "/org/gnome/ScreenSaver",
- "org.gnome.ScreenSaver",
- "SimulateUserActivity");
- if (msg != NULL) {
- if (dbus.connection_send(conn, msg, NULL)) {
- dbus.connection_flush(conn);
- }
- dbus.message_unref(msg);
- }
- }
-}
-
-SDL_bool
-SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
-{
- DBusConnection *conn = dbus.session_conn;
-
- if (conn == NULL)
- return SDL_FALSE;
-
- if (inhibit &&
- screensaver_cookie != 0)
- return SDL_TRUE;
- if (!inhibit &&
- screensaver_cookie == 0)
- return SDL_TRUE;
-
- if (inhibit) {
- const char *app = "My SDL application";
- const char *reason = "Playing a game";
-
- DBusMessage *msg = dbus.message_new_method_call("org.freedesktop.ScreenSaver",
- "/org/freedesktop/ScreenSaver",
- "org.freedesktop.ScreenSaver",
- "Inhibit");
- if (msg != NULL) {
- dbus.message_append_args (msg,
- DBUS_TYPE_STRING, &app,
- DBUS_TYPE_STRING, &reason,
- DBUS_TYPE_INVALID);
- }
-
- if (msg != NULL) {
- DBusMessage *reply;
-
- reply = dbus.connection_send_with_reply_and_block(conn, msg, 300, NULL);
- if (reply) {
- if (!dbus.message_get_args(reply, NULL,
- DBUS_TYPE_UINT32, &screensaver_cookie,
- DBUS_TYPE_INVALID))
- screensaver_cookie = 0;
- dbus.message_unref(reply);
- }
-
- dbus.message_unref(msg);
- }
-
- if (screensaver_cookie == 0) {
- return SDL_FALSE;
- }
- return SDL_TRUE;
- } else {
- DBusMessage *msg = dbus.message_new_method_call("org.freedesktop.ScreenSaver",
- "/org/freedesktop/ScreenSaver",
- "org.freedesktop.ScreenSaver",
- "UnInhibit");
- dbus.message_append_args (msg,
- DBUS_TYPE_UINT32, &screensaver_cookie,
- DBUS_TYPE_INVALID);
- if (msg != NULL) {
- if (dbus.connection_send(conn, msg, NULL)) {
- dbus.connection_flush(conn);
- }
- dbus.message_unref(msg);
- }
-
- screensaver_cookie = 0;
- return SDL_TRUE;
- }
-}
-#endif
diff --git a/3rdparty/sdl2-2.0.4/src/core/linux/SDL_evdev.c b/3rdparty/sdl2-2.0.4/src/core/linux/SDL_evdev.c
deleted file mode 100644
index a8f2b138e5..0000000000
--- a/3rdparty/sdl2-2.0.4/src/core/linux/SDL_evdev.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#ifdef SDL_INPUT_LINUXEV
-
-/* This is based on the linux joystick driver */
-/* References: https://www.kernel.org/doc/Documentation/input/input.txt
- * https://www.kernel.org/doc/Documentation/input/event-codes.txt
- * /usr/include/linux/input.h
- * The evtest application is also useful to debug the protocol
- */
-
-
-#include "SDL_evdev.h"
-#define _THIS SDL_EVDEV_PrivateData *_this
-static _THIS = NULL;
-
-#include
-#include
-#include
-#include
-#include /* For the definition of PATH_MAX */
-#include
-#ifdef SDL_INPUT_LINUXKD
-#include
-#include
-#endif
-
-
-/* We need this to prevent keystrokes from appear in the console */
-#ifndef KDSKBMUTE
-#define KDSKBMUTE 0x4B51
-#endif
-#ifndef KDSKBMODE
-#define KDSKBMODE 0x4B45
-#endif
-#ifndef K_OFF
-#define K_OFF 0x04
-#endif
-
-#include "SDL.h"
-#include "SDL_assert.h"
-#include "SDL_endian.h"
-#include "../../core/linux/SDL_udev.h"
-#include "SDL_scancode.h"
-#include "../../events/SDL_events_c.h"
-
-/* This isn't defined in older Linux kernel headers */
-#ifndef SYN_DROPPED
-#define SYN_DROPPED 3
-#endif
-
-static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
-static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);
-static int SDL_EVDEV_device_removed(const char *devpath);
-
-#if SDL_USE_LIBUDEV
-static int SDL_EVDEV_device_added(const char *devpath);
-void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
-#endif /* SDL_USE_LIBUDEV */
-
-static SDL_Scancode EVDEV_Keycodes[] = {
- SDL_SCANCODE_UNKNOWN, /* KEY_RESERVED 0 */
- SDL_SCANCODE_ESCAPE, /* KEY_ESC 1 */
- SDL_SCANCODE_1, /* KEY_1 2 */
- SDL_SCANCODE_2, /* KEY_2 3 */
- SDL_SCANCODE_3, /* KEY_3 4 */
- SDL_SCANCODE_4, /* KEY_4 5 */
- SDL_SCANCODE_5, /* KEY_5 6 */
- SDL_SCANCODE_6, /* KEY_6 7 */
- SDL_SCANCODE_7, /* KEY_7 8 */
- SDL_SCANCODE_8, /* KEY_8 9 */
- SDL_SCANCODE_9, /* KEY_9 10 */
- SDL_SCANCODE_0, /* KEY_0 11 */
- SDL_SCANCODE_MINUS, /* KEY_MINUS 12 */
- SDL_SCANCODE_EQUALS, /* KEY_EQUAL 13 */
- SDL_SCANCODE_BACKSPACE, /* KEY_BACKSPACE 14 */
- SDL_SCANCODE_TAB, /* KEY_TAB 15 */
- SDL_SCANCODE_Q, /* KEY_Q 16 */
- SDL_SCANCODE_W, /* KEY_W 17 */
- SDL_SCANCODE_E, /* KEY_E 18 */
- SDL_SCANCODE_R, /* KEY_R 19 */
- SDL_SCANCODE_T, /* KEY_T 20 */
- SDL_SCANCODE_Y, /* KEY_Y 21 */
- SDL_SCANCODE_U, /* KEY_U 22 */
- SDL_SCANCODE_I, /* KEY_I 23 */
- SDL_SCANCODE_O, /* KEY_O 24 */
- SDL_SCANCODE_P, /* KEY_P 25 */
- SDL_SCANCODE_LEFTBRACKET, /* KEY_LEFTBRACE 26 */
- SDL_SCANCODE_RIGHTBRACKET, /* KEY_RIGHTBRACE 27 */
- SDL_SCANCODE_RETURN, /* KEY_ENTER 28 */
- SDL_SCANCODE_LCTRL, /* KEY_LEFTCTRL 29 */
- SDL_SCANCODE_A, /* KEY_A 30 */
- SDL_SCANCODE_S, /* KEY_S 31 */
- SDL_SCANCODE_D, /* KEY_D 32 */
- SDL_SCANCODE_F, /* KEY_F 33 */
- SDL_SCANCODE_G, /* KEY_G 34 */
- SDL_SCANCODE_H, /* KEY_H 35 */
- SDL_SCANCODE_J, /* KEY_J 36 */
- SDL_SCANCODE_K, /* KEY_K 37 */
- SDL_SCANCODE_L, /* KEY_L 38 */
- SDL_SCANCODE_SEMICOLON, /* KEY_SEMICOLON 39 */
- SDL_SCANCODE_APOSTROPHE, /* KEY_APOSTROPHE 40 */
- SDL_SCANCODE_GRAVE, /* KEY_GRAVE 41 */
- SDL_SCANCODE_LSHIFT, /* KEY_LEFTSHIFT 42 */
- SDL_SCANCODE_BACKSLASH, /* KEY_BACKSLASH 43 */
- SDL_SCANCODE_Z, /* KEY_Z 44 */
- SDL_SCANCODE_X, /* KEY_X 45 */
- SDL_SCANCODE_C, /* KEY_C 46 */
- SDL_SCANCODE_V, /* KEY_V 47 */
- SDL_SCANCODE_B, /* KEY_B 48 */
- SDL_SCANCODE_N, /* KEY_N 49 */
- SDL_SCANCODE_M, /* KEY_M 50 */
- SDL_SCANCODE_COMMA, /* KEY_COMMA 51 */
- SDL_SCANCODE_PERIOD, /* KEY_DOT 52 */
- SDL_SCANCODE_SLASH, /* KEY_SLASH 53 */
- SDL_SCANCODE_RSHIFT, /* KEY_RIGHTSHIFT 54 */
- SDL_SCANCODE_KP_MULTIPLY, /* KEY_KPASTERISK 55 */
- SDL_SCANCODE_LALT, /* KEY_LEFTALT 56 */
- SDL_SCANCODE_SPACE, /* KEY_SPACE 57 */
- SDL_SCANCODE_CAPSLOCK, /* KEY_CAPSLOCK 58 */
- SDL_SCANCODE_F1, /* KEY_F1 59 */
- SDL_SCANCODE_F2, /* KEY_F2 60 */
- SDL_SCANCODE_F3, /* KEY_F3 61 */
- SDL_SCANCODE_F4, /* KEY_F4 62 */
- SDL_SCANCODE_F5, /* KEY_F5 63 */
- SDL_SCANCODE_F6, /* KEY_F6 64 */
- SDL_SCANCODE_F7, /* KEY_F7 65 */
- SDL_SCANCODE_F8, /* KEY_F8 66 */
- SDL_SCANCODE_F9, /* KEY_F9 67 */
- SDL_SCANCODE_F10, /* KEY_F10 68 */
- SDL_SCANCODE_NUMLOCKCLEAR, /* KEY_NUMLOCK 69 */
- SDL_SCANCODE_SCROLLLOCK, /* KEY_SCROLLLOCK 70 */
- SDL_SCANCODE_KP_7, /* KEY_KP7 71 */
- SDL_SCANCODE_KP_8, /* KEY_KP8 72 */
- SDL_SCANCODE_KP_9, /* KEY_KP9 73 */
- SDL_SCANCODE_KP_MINUS, /* KEY_KPMINUS 74 */
- SDL_SCANCODE_KP_4, /* KEY_KP4 75 */
- SDL_SCANCODE_KP_5, /* KEY_KP5 76 */
- SDL_SCANCODE_KP_6, /* KEY_KP6 77 */
- SDL_SCANCODE_KP_PLUS, /* KEY_KPPLUS 78 */
- SDL_SCANCODE_KP_1, /* KEY_KP1 79 */
- SDL_SCANCODE_KP_2, /* KEY_KP2 80 */
- SDL_SCANCODE_KP_3, /* KEY_KP3 81 */
- SDL_SCANCODE_KP_0, /* KEY_KP0 82 */
- SDL_SCANCODE_KP_PERIOD, /* KEY_KPDOT 83 */
- SDL_SCANCODE_UNKNOWN, /* 84 */
- SDL_SCANCODE_LANG5, /* KEY_ZENKAKUHANKAKU 85 */
- SDL_SCANCODE_UNKNOWN, /* KEY_102ND 86 */
- SDL_SCANCODE_F11, /* KEY_F11 87 */
- SDL_SCANCODE_F12, /* KEY_F12 88 */
- SDL_SCANCODE_UNKNOWN, /* KEY_RO 89 */
- SDL_SCANCODE_LANG3, /* KEY_KATAKANA 90 */
- SDL_SCANCODE_LANG4, /* KEY_HIRAGANA 91 */
- SDL_SCANCODE_UNKNOWN, /* KEY_HENKAN 92 */
- SDL_SCANCODE_LANG3, /* KEY_KATAKANAHIRAGANA 93 */
- SDL_SCANCODE_UNKNOWN, /* KEY_MUHENKAN 94 */
- SDL_SCANCODE_KP_COMMA, /* KEY_KPJPCOMMA 95 */
- SDL_SCANCODE_KP_ENTER, /* KEY_KPENTER 96 */
- SDL_SCANCODE_RCTRL, /* KEY_RIGHTCTRL 97 */
- SDL_SCANCODE_KP_DIVIDE, /* KEY_KPSLASH 98 */
- SDL_SCANCODE_SYSREQ, /* KEY_SYSRQ 99 */
- SDL_SCANCODE_RALT, /* KEY_RIGHTALT 100 */
- SDL_SCANCODE_UNKNOWN, /* KEY_LINEFEED 101 */
- SDL_SCANCODE_HOME, /* KEY_HOME 102 */
- SDL_SCANCODE_UP, /* KEY_UP 103 */
- SDL_SCANCODE_PAGEUP, /* KEY_PAGEUP 104 */
- SDL_SCANCODE_LEFT, /* KEY_LEFT 105 */
- SDL_SCANCODE_RIGHT, /* KEY_RIGHT 106 */
- SDL_SCANCODE_END, /* KEY_END 107 */
- SDL_SCANCODE_DOWN, /* KEY_DOWN 108 */
- SDL_SCANCODE_PAGEDOWN, /* KEY_PAGEDOWN 109 */
- SDL_SCANCODE_INSERT, /* KEY_INSERT 110 */
- SDL_SCANCODE_DELETE, /* KEY_DELETE 111 */
- SDL_SCANCODE_UNKNOWN, /* KEY_MACRO 112 */
- SDL_SCANCODE_MUTE, /* KEY_MUTE 113 */
- SDL_SCANCODE_VOLUMEDOWN, /* KEY_VOLUMEDOWN 114 */
- SDL_SCANCODE_VOLUMEUP, /* KEY_VOLUMEUP 115 */
- SDL_SCANCODE_POWER, /* KEY_POWER 116 SC System Power Down */
- SDL_SCANCODE_KP_EQUALS, /* KEY_KPEQUAL 117 */
- SDL_SCANCODE_KP_MINUS, /* KEY_KPPLUSMINUS 118 */
- SDL_SCANCODE_PAUSE, /* KEY_PAUSE 119 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SCALE 120 AL Compiz Scale (Expose) */
- SDL_SCANCODE_KP_COMMA, /* KEY_KPCOMMA 121 */
- SDL_SCANCODE_LANG1, /* KEY_HANGEUL,KEY_HANGUEL 122 */
- SDL_SCANCODE_LANG2, /* KEY_HANJA 123 */
- SDL_SCANCODE_INTERNATIONAL3,/* KEY_YEN 124 */
- SDL_SCANCODE_LGUI, /* KEY_LEFTMETA 125 */
- SDL_SCANCODE_RGUI, /* KEY_RIGHTMETA 126 */
- SDL_SCANCODE_APPLICATION, /* KEY_COMPOSE 127 */
- SDL_SCANCODE_STOP, /* KEY_STOP 128 AC Stop */
- SDL_SCANCODE_AGAIN, /* KEY_AGAIN 129 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PROPS 130 AC Properties */
- SDL_SCANCODE_UNDO, /* KEY_UNDO 131 AC Undo */
- SDL_SCANCODE_UNKNOWN, /* KEY_FRONT 132 */
- SDL_SCANCODE_COPY, /* KEY_COPY 133 AC Copy */
- SDL_SCANCODE_UNKNOWN, /* KEY_OPEN 134 AC Open */
- SDL_SCANCODE_PASTE, /* KEY_PASTE 135 AC Paste */
- SDL_SCANCODE_FIND, /* KEY_FIND 136 AC Search */
- SDL_SCANCODE_CUT, /* KEY_CUT 137 AC Cut */
- SDL_SCANCODE_HELP, /* KEY_HELP 138 AL Integrated Help Center */
- SDL_SCANCODE_MENU, /* KEY_MENU 139 Menu (show menu) */
- SDL_SCANCODE_CALCULATOR, /* KEY_CALC 140 AL Calculator */
- SDL_SCANCODE_UNKNOWN, /* KEY_SETUP 141 */
- SDL_SCANCODE_SLEEP, /* KEY_SLEEP 142 SC System Sleep */
- SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP 143 System Wake Up */
- SDL_SCANCODE_UNKNOWN, /* KEY_FILE 144 AL Local Machine Browser */
- SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE 145 */
- SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE 146 */
- SDL_SCANCODE_UNKNOWN, /* KEY_XFER 147 */
- SDL_SCANCODE_APP1, /* KEY_PROG1 148 */
- SDL_SCANCODE_APP1, /* KEY_PROG2 149 */
- SDL_SCANCODE_WWW, /* KEY_WWW 150 AL Internet Browser */
- SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS 151 */
- SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE,KEY_SCREENLOCK 152 AL Terminal Lock/Screensaver */
- SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION 153 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS 154 */
- SDL_SCANCODE_MAIL, /* KEY_MAIL 155 */
- SDL_SCANCODE_AC_BOOKMARKS, /* KEY_BOOKMARKS 156 AC Bookmarks */
- SDL_SCANCODE_COMPUTER, /* KEY_COMPUTER 157 */
- SDL_SCANCODE_AC_BACK, /* KEY_BACK 158 AC Back */
- SDL_SCANCODE_AC_FORWARD, /* KEY_FORWARD 159 AC Forward */
- SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD 160 */
- SDL_SCANCODE_EJECT, /* KEY_EJECTCD 161 */
- SDL_SCANCODE_UNKNOWN, /* KEY_EJECTCLOSECD 162 */
- SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG 163 */
- SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE 164 */
- SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG 165 */
- SDL_SCANCODE_AUDIOSTOP, /* KEY_STOPCD 166 */
- SDL_SCANCODE_UNKNOWN, /* KEY_RECORD 167 */
- SDL_SCANCODE_UNKNOWN, /* KEY_REWIND 168 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PHONE 169 Media Select Telephone */
- SDL_SCANCODE_UNKNOWN, /* KEY_ISO 170 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG 171 AL Consumer Control Configuration */
- SDL_SCANCODE_AC_HOME, /* KEY_HOMEPAGE 172 AC Home */
- SDL_SCANCODE_AC_REFRESH, /* KEY_REFRESH 173 AC Refresh */
- SDL_SCANCODE_UNKNOWN, /* KEY_EXIT 174 AC Exit */
- SDL_SCANCODE_UNKNOWN, /* KEY_MOVE 175 */
- SDL_SCANCODE_UNKNOWN, /* KEY_EDIT 176 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP 177 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN 178 */
- SDL_SCANCODE_KP_LEFTPAREN, /* KEY_KPLEFTPAREN 179 */
- SDL_SCANCODE_KP_RIGHTPAREN, /* KEY_KPRIGHTPAREN 180 */
- SDL_SCANCODE_UNKNOWN, /* KEY_NEW 181 AC New */
- SDL_SCANCODE_AGAIN, /* KEY_REDO 182 AC Redo/Repeat */
- SDL_SCANCODE_F13, /* KEY_F13 183 */
- SDL_SCANCODE_F14, /* KEY_F14 184 */
- SDL_SCANCODE_F15, /* KEY_F15 185 */
- SDL_SCANCODE_F16, /* KEY_F16 186 */
- SDL_SCANCODE_F17, /* KEY_F17 187 */
- SDL_SCANCODE_F18, /* KEY_F18 188 */
- SDL_SCANCODE_F19, /* KEY_F19 189 */
- SDL_SCANCODE_F20, /* KEY_F20 190 */
- SDL_SCANCODE_F21, /* KEY_F21 191 */
- SDL_SCANCODE_F22, /* KEY_F22 192 */
- SDL_SCANCODE_F23, /* KEY_F23 193 */
- SDL_SCANCODE_F24, /* KEY_F24 194 */
- SDL_SCANCODE_UNKNOWN, /* 195 */
- SDL_SCANCODE_UNKNOWN, /* 196 */
- SDL_SCANCODE_UNKNOWN, /* 197 */
- SDL_SCANCODE_UNKNOWN, /* 198 */
- SDL_SCANCODE_UNKNOWN, /* 199 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD 200 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD 201 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 202 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 203 */
- SDL_SCANCODE_UNKNOWN, /* KEY_DASHBOARD 204 AL Dashboard */
- SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND 205 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE 206 AC Close */
- SDL_SCANCODE_UNKNOWN, /* KEY_PLAY 207 */
- SDL_SCANCODE_UNKNOWN, /* KEY_FASTFORWARD 208 */
- SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST 209 */
- SDL_SCANCODE_UNKNOWN, /* KEY_PRINT 210 AC Print */
- SDL_SCANCODE_UNKNOWN, /* KEY_HP 211 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA 212 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SOUND 213 */
- SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION 214 */
- SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL 215 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CHAT 216 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SEARCH 217 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT 218 */
- SDL_SCANCODE_UNKNOWN, /* KEY_FINANCE 219 AL Checkbook/Finance */
- SDL_SCANCODE_UNKNOWN, /* KEY_SPORT 220 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SHOP 221 */
- SDL_SCANCODE_UNKNOWN, /* KEY_ALTERASE 222 */
- SDL_SCANCODE_UNKNOWN, /* KEY_CANCEL 223 AC Cancel */
- SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESSDOWN 224 */
- SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESSUP 225 */
- SDL_SCANCODE_UNKNOWN, /* KEY_MEDIA 226 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SWITCHVIDEOMODE 227 Cycle between available video outputs (Monitor/LCD/TV-out/etc) */
- SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMTOGGLE 228 */
- SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMDOWN 229 */
- SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMUP 230 */
- SDL_SCANCODE_UNKNOWN, /* KEY_SEND 231 AC Send */
- SDL_SCANCODE_UNKNOWN, /* KEY_REPLY 232 AC Reply */
- SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL 233 AC Forward Msg */
- SDL_SCANCODE_UNKNOWN, /* KEY_SAVE 234 AC Save */
- SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS 235 */
- SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY 236 */
- SDL_SCANCODE_UNKNOWN, /* KEY_BLUETOOTH 237 */
- SDL_SCANCODE_UNKNOWN, /* KEY_WLAN 238 */
- SDL_SCANCODE_UNKNOWN, /* KEY_UWB 239 */
- SDL_SCANCODE_UNKNOWN, /* KEY_UNKNOWN 240 */
- SDL_SCANCODE_UNKNOWN, /* KEY_VIDEO_NEXT 241 drive next video source */
- SDL_SCANCODE_UNKNOWN, /* KEY_VIDEO_PREV 242 drive previous video source */
- SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESS_CYCLE 243 brightness up, after max is min */
- SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESS_ZERO 244 brightness off, use ambient */
- SDL_SCANCODE_UNKNOWN, /* KEY_DISPLAY_OFF 245 display device to off state */
- SDL_SCANCODE_UNKNOWN, /* KEY_WIMAX 246 */
- SDL_SCANCODE_UNKNOWN, /* KEY_RFKILL 247 Key that controls all radios */
- SDL_SCANCODE_UNKNOWN, /* KEY_MICMUTE 248 Mute / unmute the microphone */
-};
-
-static Uint8 EVDEV_MouseButtons[] = {
- SDL_BUTTON_LEFT, /* BTN_LEFT 0x110 */
- SDL_BUTTON_RIGHT, /* BTN_RIGHT 0x111 */
- SDL_BUTTON_MIDDLE, /* BTN_MIDDLE 0x112 */
- SDL_BUTTON_X1, /* BTN_SIDE 0x113 */
- SDL_BUTTON_X2, /* BTN_EXTRA 0x114 */
- SDL_BUTTON_X2 + 1, /* BTN_FORWARD 0x115 */
- SDL_BUTTON_X2 + 2, /* BTN_BACK 0x116 */
- SDL_BUTTON_X2 + 3 /* BTN_TASK 0x117 */
-};
-
-static const char* EVDEV_consoles[] = {
- "/proc/self/fd/0",
- "/dev/tty",
- "/dev/tty0",
- "/dev/tty1",
- "/dev/tty2",
- "/dev/tty3",
- "/dev/tty4",
- "/dev/tty5",
- "/dev/tty6",
- "/dev/vc/0",
- "/dev/console"
-};
-
-#define IS_CONSOLE(fd) isatty (fd) && ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))
-
-static int SDL_EVDEV_get_console_fd(void)
-{
- int fd, i;
- char arg = 0;
-
- /* Try a few consoles to see which one we have read access to */
-
- for(i = 0; i < SDL_arraysize(EVDEV_consoles); i++) {
- fd = open(EVDEV_consoles[i], O_RDONLY);
- if (fd >= 0) {
- if (IS_CONSOLE(fd)) return fd;
- close(fd);
- }
- }
-
- /* Try stdin, stdout, stderr */
-
- for(fd = 0; fd < 3; fd++) {
- if (IS_CONSOLE(fd)) return fd;
- }
-
- /* We won't be able to send SDL_TEXTINPUT events */
- return -1;
-}
-
-/* Prevent keystrokes from reaching the tty */
-static int SDL_EVDEV_mute_keyboard(int tty, int *kb_mode)
-{
- char arg;
-
- *kb_mode = 0; /* FIXME: Is this a sane default in case KDGKBMODE fails? */
- if (!IS_CONSOLE(tty)) {
- return SDL_SetError("Tried to mute an invalid tty");
- }
- ioctl(tty, KDGKBMODE, kb_mode); /* It's not fatal if this fails */
- if (ioctl(tty, KDSKBMUTE, 1) && ioctl(tty, KDSKBMODE, K_OFF)) {
- return SDL_SetError("EVDEV: Failed muting keyboard");
- }
-
- return 0;
-}
-
-/* Restore the keyboard mode for given tty */
-static void SDL_EVDEV_unmute_keyboard(int tty, int kb_mode)
-{
- if (ioctl(tty, KDSKBMUTE, 0) && ioctl(tty, KDSKBMODE, kb_mode)) {
- SDL_Log("EVDEV: Failed restoring keyboard mode");
- }
-}
-
-/* Read /sys/class/tty/tty0/active and open the tty */
-static int SDL_EVDEV_get_active_tty()
-{
- int fd, len;
- char ttyname[NAME_MAX + 1];
- char ttypath[PATH_MAX+1] = "/dev/";
- char arg;
-
- fd = open("/sys/class/tty/tty0/active", O_RDONLY);
- if (fd < 0) {
- return SDL_SetError("Could not determine which tty is active");
- }
-
- len = read(fd, ttyname, NAME_MAX);
- close(fd);
-
- if (len <= 0) {
- return SDL_SetError("Could not read which tty is active");
- }
-
- if (ttyname[len-1] == '\n') {
- ttyname[len-1] = '\0';
- }
- else {
- ttyname[len] = '\0';
- }
-
- SDL_strlcat(ttypath, ttyname, PATH_MAX);
- fd = open(ttypath, O_RDWR | O_NOCTTY);
- if (fd < 0) {
- return SDL_SetError("Could not open tty: %s", ttypath);
- }
-
- if (!IS_CONSOLE(fd)) {
- close(fd);
- return SDL_SetError("Invalid tty obtained: %s", ttypath);
- }
-
- return fd;
-}
-
-int
-SDL_EVDEV_Init(void)
-{
- int retval = 0;
-
- if (_this == NULL) {
-
- _this = (SDL_EVDEV_PrivateData *) SDL_calloc(1, sizeof(*_this));
- if(_this == NULL) {
- return SDL_OutOfMemory();
- }
-
-#if SDL_USE_LIBUDEV
- if (SDL_UDEV_Init() < 0) {
- SDL_free(_this);
- _this = NULL;
- return -1;
- }
-
- /* Set up the udev callback */
- if (SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) {
- SDL_EVDEV_Quit();
- return -1;
- }
-
- /* Force a scan to build the initial device list */
- SDL_UDEV_Scan();
-#else
- /* TODO: Scan the devices manually, like a caveman */
-#endif /* SDL_USE_LIBUDEV */
-
- /* We need a physical terminal (not PTS) to be able to translate key code to symbols via the kernel tables */
- _this->console_fd = SDL_EVDEV_get_console_fd();
-
- /* Mute the keyboard so keystrokes only generate evdev events and do not leak through to the console */
- _this->tty = STDIN_FILENO;
- if (SDL_EVDEV_mute_keyboard(_this->tty, &_this->kb_mode) < 0) {
- /* stdin is not a tty, probably we were launched remotely, so we try to disable the active tty */
- _this->tty = SDL_EVDEV_get_active_tty();
- if (_this->tty >= 0) {
- if (SDL_EVDEV_mute_keyboard(_this->tty, &_this->kb_mode) < 0) {
- close(_this->tty);
- _this->tty = -1;
- }
- }
- }
- }
-
- _this->ref_count += 1;
-
- return retval;
-}
-
-void
-SDL_EVDEV_Quit(void)
-{
- if (_this == NULL) {
- return;
- }
-
- _this->ref_count -= 1;
-
- if (_this->ref_count < 1) {
-
-#if SDL_USE_LIBUDEV
- SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback);
- SDL_UDEV_Quit();
-#endif /* SDL_USE_LIBUDEV */
-
- if (_this->console_fd >= 0) {
- close(_this->console_fd);
- }
-
- if (_this->tty >= 0) {
- SDL_EVDEV_unmute_keyboard(_this->tty, _this->kb_mode);
- close(_this->tty);
- }
-
- /* Remove existing devices */
- while(_this->first != NULL) {
- SDL_EVDEV_device_removed(_this->first->path);
- }
-
- SDL_assert(_this->first == NULL);
- SDL_assert(_this->last == NULL);
- SDL_assert(_this->numdevices == 0);
-
- SDL_free(_this);
- _this = NULL;
- }
-}
-
-#if SDL_USE_LIBUDEV
-void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath)
-{
- if (devpath == NULL) {
- return;
- }
-
- switch(udev_type) {
- case SDL_UDEV_DEVICEADDED:
- if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE|SDL_UDEV_DEVICE_KEYBOARD))) {
- return;
- }
- SDL_EVDEV_device_added(devpath);
- break;
-
- case SDL_UDEV_DEVICEREMOVED:
- SDL_EVDEV_device_removed(devpath);
- break;
-
- default:
- break;
- }
-}
-
-#endif /* SDL_USE_LIBUDEV */
-
-void
-SDL_EVDEV_Poll(void)
-{
- struct input_event events[32];
- int i, len;
- SDL_evdevlist_item *item;
- SDL_Scancode scan_code;
- int mouse_button;
- SDL_Mouse *mouse;
-#ifdef SDL_INPUT_LINUXKD
- Uint16 modstate;
- struct kbentry kbe;
- static char keysym[8];
- char *end;
- Uint32 kval;
-#endif
-
- if (!_this) {
- return;
- }
-
-#if SDL_USE_LIBUDEV
- SDL_UDEV_Poll();
-#endif
-
- mouse = SDL_GetMouse();
-
- for (item = _this->first; item != NULL; item = item->next) {
- while ((len = read(item->fd, events, (sizeof events))) > 0) {
- len /= sizeof(events[0]);
- for (i = 0; i < len; ++i) {
- switch (events[i].type) {
- case EV_KEY:
- if (events[i].code >= BTN_MOUSE && events[i].code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {
- mouse_button = events[i].code - BTN_MOUSE;
- if (events[i].value == 0) {
- SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, EVDEV_MouseButtons[mouse_button]);
- } else if (events[i].value == 1) {
- SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, EVDEV_MouseButtons[mouse_button]);
- }
- break;
- }
-
- /* Probably keyboard */
- scan_code = SDL_EVDEV_translate_keycode(events[i].code);
- if (scan_code != SDL_SCANCODE_UNKNOWN) {
- if (events[i].value == 0) {
- SDL_SendKeyboardKey(SDL_RELEASED, scan_code);
- } else if (events[i].value == 1 || events[i].value == 2 /* Key repeated */) {
- SDL_SendKeyboardKey(SDL_PRESSED, scan_code);
-#ifdef SDL_INPUT_LINUXKD
- if (_this->console_fd >= 0) {
- kbe.kb_index = events[i].code;
- /* Convert the key to an UTF-8 char */
- /* Ref: http://www.linuxjournal.com/article/2783 */
- modstate = SDL_GetModState();
- kbe.kb_table = 0;
-
- /* Ref: http://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching */
- kbe.kb_table |= -((modstate & KMOD_LCTRL) != 0) & (1 << KG_CTRLL | 1 << KG_CTRL);
- kbe.kb_table |= -((modstate & KMOD_RCTRL) != 0) & (1 << KG_CTRLR | 1 << KG_CTRL);
- kbe.kb_table |= -((modstate & KMOD_LSHIFT) != 0) & (1 << KG_SHIFTL | 1 << KG_SHIFT);
- kbe.kb_table |= -((modstate & KMOD_RSHIFT) != 0) & (1 << KG_SHIFTR | 1 << KG_SHIFT);
- kbe.kb_table |= -((modstate & KMOD_LALT) != 0) & (1 << KG_ALT);
- kbe.kb_table |= -((modstate & KMOD_RALT) != 0) & (1 << KG_ALTGR);
-
- if (ioctl(_this->console_fd, KDGKBENT, (unsigned long)&kbe) == 0 &&
- ((KTYP(kbe.kb_value) == KT_LATIN) || (KTYP(kbe.kb_value) == KT_ASCII) || (KTYP(kbe.kb_value) == KT_LETTER)))
- {
- kval = KVAL(kbe.kb_value);
-
- /* While there's a KG_CAPSSHIFT symbol, it's not useful to build the table index with it
- * because 1 << KG_CAPSSHIFT overflows the 8 bits of kb_table
- * So, we do the CAPS LOCK logic here. Note that isalpha depends on the locale!
- */
- if (modstate & KMOD_CAPS && isalpha(kval)) {
- if (isupper(kval)) {
- kval = tolower(kval);
- } else {
- kval = toupper(kval);
- }
- }
-
- /* Convert to UTF-8 and send */
- end = SDL_UCS4ToUTF8(kval, keysym);
- *end = '\0';
- SDL_SendKeyboardText(keysym);
- }
- }
-#endif /* SDL_INPUT_LINUXKD */
- }
- }
- break;
- case EV_ABS:
- switch(events[i].code) {
- case ABS_X:
- SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_FALSE, events[i].value, mouse->y);
- break;
- case ABS_Y:
- SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_FALSE, mouse->x, events[i].value);
- break;
- default:
- break;
- }
- break;
- case EV_REL:
- switch(events[i].code) {
- case REL_X:
- SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_TRUE, events[i].value, 0);
- break;
- case REL_Y:
- SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_TRUE, 0, events[i].value);
- break;
- case REL_WHEEL:
- SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, events[i].value, SDL_MOUSEWHEEL_NORMAL);
- break;
- case REL_HWHEEL:
- SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0, SDL_MOUSEWHEEL_NORMAL);
- break;
- default:
- break;
- }
- break;
- case EV_SYN:
- switch (events[i].code) {
- case SYN_DROPPED:
- SDL_EVDEV_sync_device(item);
- break;
- default:
- break;
- }
- break;
- }
- }
- }
- }
-}
-
-static SDL_Scancode
-SDL_EVDEV_translate_keycode(int keycode)
-{
- SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
-
- if (keycode < SDL_arraysize(EVDEV_Keycodes)) {
- scancode = EVDEV_Keycodes[keycode];
- }
- if (scancode == SDL_SCANCODE_UNKNOWN) {
- SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list EVDEV KeyCode %d \n", keycode);
- }
- return scancode;
-}
-
-static void
-SDL_EVDEV_sync_device(SDL_evdevlist_item *item)
-{
- /* TODO: get full state of device and report whatever is required */
-}
-
-#if SDL_USE_LIBUDEV
-static int
-SDL_EVDEV_device_added(const char *devpath)
-{
- SDL_evdevlist_item *item;
-
- /* Check to make sure it's not already in list. */
- for (item = _this->first; item != NULL; item = item->next) {
- if (SDL_strcmp(devpath, item->path) == 0) {
- return -1; /* already have this one */
- }
- }
-
- item = (SDL_evdevlist_item *) SDL_calloc(1, sizeof (SDL_evdevlist_item));
- if (item == NULL) {
- return SDL_OutOfMemory();
- }
-
- item->fd = open(devpath, O_RDONLY, 0);
- if (item->fd < 0) {
- SDL_free(item);
- return SDL_SetError("Unable to open %s", devpath);
- }
-
- item->path = SDL_strdup(devpath);
- if (item->path == NULL) {
- close(item->fd);
- SDL_free(item);
- return SDL_OutOfMemory();
- }
-
- /* Non blocking read mode */
- fcntl(item->fd, F_SETFL, O_NONBLOCK);
-
- if (_this->last == NULL) {
- _this->first = _this->last = item;
- } else {
- _this->last->next = item;
- _this->last = item;
- }
-
- SDL_EVDEV_sync_device(item);
-
- return _this->numdevices++;
-}
-#endif /* SDL_USE_LIBUDEV */
-
-static int
-SDL_EVDEV_device_removed(const char *devpath)
-{
- SDL_evdevlist_item *item;
- SDL_evdevlist_item *prev = NULL;
-
- for (item = _this->first; item != NULL; item = item->next) {
- /* found it, remove it. */
- if (SDL_strcmp(devpath, item->path) == 0) {
- if (prev != NULL) {
- prev->next = item->next;
- } else {
- SDL_assert(_this->first == item);
- _this->first = item->next;
- }
- if (item == _this->last) {
- _this->last = prev;
- }
- close(item->fd);
- SDL_free(item->path);
- SDL_free(item);
- _this->numdevices--;
- return 0;
- }
- prev = item;
- }
-
- return -1;
-}
-
-
-#endif /* SDL_INPUT_LINUXEV */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/3rdparty/sdl2-2.0.4/src/dynapi/SDL_dynapi.h b/3rdparty/sdl2-2.0.4/src/dynapi/SDL_dynapi.h
deleted file mode 100644
index 5faac2194e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/dynapi/SDL_dynapi.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_dynapi_h
-#define _SDL_dynapi_h
-
-/* IMPORTANT:
- This is the master switch to disabling the dynamic API. We made it so you
- have to hand-edit an internal source file in SDL to turn it off; you
- can do it if you want it badly enough, but hopefully you won't want to.
- You should understand the ramifications of turning this off: it makes it
- hard to update your SDL in the field, and impossible if you've statically
- linked SDL into your app. Understand that platforms change, and if we can't
- drop in an updated SDL, your application can definitely break some time
- in the future, even if it's fine today.
- To be sure, as new system-level video and audio APIs are introduced, an
- updated SDL can transparently take advantage of them, but your program will
- not without this feature. Think hard before turning it off.
-*/
-#ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */
-#error Nope, you have to edit this file to force this off.
-#endif
-
-#ifdef __APPLE__
-#include "TargetConditionals.h"
-#endif
-
-#if TARGET_OS_IPHONE || __native_client__ || __EMSCRIPTEN__ /* probably not useful on iOS, NACL or Emscripten. */
-#define SDL_DYNAMIC_API 0
-#elif SDL_BUILDING_WINRT /* probaly not useful on WinRT, given current .dll loading restrictions */
-#define SDL_DYNAMIC_API 0
-#elif defined(__clang_analyzer__)
-#define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */
-#endif
-
-/* everyone else. This is where we turn on the API if nothing forced it off. */
-#ifndef SDL_DYNAMIC_API
-#define SDL_DYNAMIC_API 1
-#endif
-
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/events/SDL_events.c b/3rdparty/sdl2-2.0.4/src/events/SDL_events.c
deleted file mode 100644
index ffd1038249..0000000000
--- a/3rdparty/sdl2-2.0.4/src/events/SDL_events.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* General event handling code for SDL */
-
-#include "SDL.h"
-#include "SDL_events.h"
-#include "SDL_syswm.h"
-#include "SDL_thread.h"
-#include "SDL_events_c.h"
-#include "../timer/SDL_timer_c.h"
-#if !SDL_JOYSTICK_DISABLED
-#include "../joystick/SDL_joystick_c.h"
-#endif
-#include "../video/SDL_sysvideo.h"
-
-/* An arbitrary limit so we don't have unbounded growth */
-#define SDL_MAX_QUEUED_EVENTS 65535
-
-/* Public data -- the event filter */
-SDL_EventFilter SDL_EventOK = NULL;
-void *SDL_EventOKParam;
-
-typedef struct SDL_EventWatcher {
- SDL_EventFilter callback;
- void *userdata;
- struct SDL_EventWatcher *next;
-} SDL_EventWatcher;
-
-static SDL_EventWatcher *SDL_event_watchers = NULL;
-
-typedef struct {
- Uint32 bits[8];
-} SDL_DisabledEventBlock;
-
-static SDL_DisabledEventBlock *SDL_disabled_events[256];
-static Uint32 SDL_userevents = SDL_USEREVENT;
-
-/* Private data -- event queue */
-typedef struct _SDL_EventEntry
-{
- SDL_Event event;
- SDL_SysWMmsg msg;
- struct _SDL_EventEntry *prev;
- struct _SDL_EventEntry *next;
-} SDL_EventEntry;
-
-typedef struct _SDL_SysWMEntry
-{
- SDL_SysWMmsg msg;
- struct _SDL_SysWMEntry *next;
-} SDL_SysWMEntry;
-
-static struct
-{
- SDL_mutex *lock;
- volatile SDL_bool active;
- volatile int count;
- volatile int max_events_seen;
- SDL_EventEntry *head;
- SDL_EventEntry *tail;
- SDL_EventEntry *free;
- SDL_SysWMEntry *wmmsg_used;
- SDL_SysWMEntry *wmmsg_free;
-} SDL_EventQ = { NULL, SDL_TRUE, 0, 0, NULL, NULL, NULL, NULL, NULL };
-
-
-/* Public functions */
-
-void
-SDL_StopEventLoop(void)
-{
- const char *report = SDL_GetHint("SDL_EVENT_QUEUE_STATISTICS");
- int i;
- SDL_EventEntry *entry;
- SDL_SysWMEntry *wmmsg;
-
- if (SDL_EventQ.lock) {
- SDL_LockMutex(SDL_EventQ.lock);
- }
-
- SDL_EventQ.active = SDL_FALSE;
-
- if (report && SDL_atoi(report)) {
- SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d\n",
- SDL_EventQ.max_events_seen);
- }
-
- /* Clean out EventQ */
- for (entry = SDL_EventQ.head; entry; ) {
- SDL_EventEntry *next = entry->next;
- SDL_free(entry);
- entry = next;
- }
- for (entry = SDL_EventQ.free; entry; ) {
- SDL_EventEntry *next = entry->next;
- SDL_free(entry);
- entry = next;
- }
- for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; ) {
- SDL_SysWMEntry *next = wmmsg->next;
- SDL_free(wmmsg);
- wmmsg = next;
- }
- for (wmmsg = SDL_EventQ.wmmsg_free; wmmsg; ) {
- SDL_SysWMEntry *next = wmmsg->next;
- SDL_free(wmmsg);
- wmmsg = next;
- }
-
- SDL_EventQ.count = 0;
- SDL_EventQ.max_events_seen = 0;
- SDL_EventQ.head = NULL;
- SDL_EventQ.tail = NULL;
- SDL_EventQ.free = NULL;
- SDL_EventQ.wmmsg_used = NULL;
- SDL_EventQ.wmmsg_free = NULL;
-
- /* Clear disabled event state */
- for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) {
- SDL_free(SDL_disabled_events[i]);
- SDL_disabled_events[i] = NULL;
- }
-
- while (SDL_event_watchers) {
- SDL_EventWatcher *tmp = SDL_event_watchers;
- SDL_event_watchers = tmp->next;
- SDL_free(tmp);
- }
- SDL_EventOK = NULL;
-
- if (SDL_EventQ.lock) {
- SDL_UnlockMutex(SDL_EventQ.lock);
- SDL_DestroyMutex(SDL_EventQ.lock);
- SDL_EventQ.lock = NULL;
- }
-}
-
-/* This function (and associated calls) may be called more than once */
-int
-SDL_StartEventLoop(void)
-{
- /* We'll leave the event queue alone, since we might have gotten
- some important events at launch (like SDL_DROPFILE)
-
- FIXME: Does this introduce any other bugs with events at startup?
- */
-
- /* Create the lock and set ourselves active */
-#if !SDL_THREADS_DISABLED
- if (!SDL_EventQ.lock) {
- SDL_EventQ.lock = SDL_CreateMutex();
- }
- if (SDL_EventQ.lock == NULL) {
- return (-1);
- }
-#endif /* !SDL_THREADS_DISABLED */
-
- /* Process most event types */
- SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
- SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
- SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
-
- SDL_EventQ.active = SDL_TRUE;
-
- return (0);
-}
-
-
-/* Add an event to the event queue -- called with the queue locked */
-static int
-SDL_AddEvent(SDL_Event * event)
-{
- SDL_EventEntry *entry;
-
- if (SDL_EventQ.count >= SDL_MAX_QUEUED_EVENTS) {
- SDL_SetError("Event queue is full (%d events)", SDL_EventQ.count);
- return 0;
- }
-
- if (SDL_EventQ.free == NULL) {
- entry = (SDL_EventEntry *)SDL_malloc(sizeof(*entry));
- if (!entry) {
- return 0;
- }
- } else {
- entry = SDL_EventQ.free;
- SDL_EventQ.free = entry->next;
- }
-
- entry->event = *event;
- if (event->type == SDL_SYSWMEVENT) {
- entry->msg = *event->syswm.msg;
- entry->event.syswm.msg = &entry->msg;
- }
-
- if (SDL_EventQ.tail) {
- SDL_EventQ.tail->next = entry;
- entry->prev = SDL_EventQ.tail;
- SDL_EventQ.tail = entry;
- entry->next = NULL;
- } else {
- SDL_assert(!SDL_EventQ.head);
- SDL_EventQ.head = entry;
- SDL_EventQ.tail = entry;
- entry->prev = NULL;
- entry->next = NULL;
- }
- ++SDL_EventQ.count;
-
- if (SDL_EventQ.count > SDL_EventQ.max_events_seen) {
- SDL_EventQ.max_events_seen = SDL_EventQ.count;
- }
-
- return 1;
-}
-
-/* Remove an event from the queue -- called with the queue locked */
-static void
-SDL_CutEvent(SDL_EventEntry *entry)
-{
- if (entry->prev) {
- entry->prev->next = entry->next;
- }
- if (entry->next) {
- entry->next->prev = entry->prev;
- }
-
- if (entry == SDL_EventQ.head) {
- SDL_assert(entry->prev == NULL);
- SDL_EventQ.head = entry->next;
- }
- if (entry == SDL_EventQ.tail) {
- SDL_assert(entry->next == NULL);
- SDL_EventQ.tail = entry->prev;
- }
-
- entry->next = SDL_EventQ.free;
- SDL_EventQ.free = entry;
- SDL_assert(SDL_EventQ.count > 0);
- --SDL_EventQ.count;
-}
-
-/* Lock the event queue, take a peep at it, and unlock it */
-int
-SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action,
- Uint32 minType, Uint32 maxType)
-{
- int i, used;
-
- /* Don't look after we've quit */
- if (!SDL_EventQ.active) {
- /* We get a few spurious events at shutdown, so don't warn then */
- if (action != SDL_ADDEVENT) {
- SDL_SetError("The event system has been shut down");
- }
- return (-1);
- }
- /* Lock the event queue */
- used = 0;
- if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) {
- if (action == SDL_ADDEVENT) {
- for (i = 0; i < numevents; ++i) {
- used += SDL_AddEvent(&events[i]);
- }
- } else {
- SDL_EventEntry *entry, *next;
- SDL_SysWMEntry *wmmsg, *wmmsg_next;
- SDL_Event tmpevent;
- Uint32 type;
-
- /* If 'events' is NULL, just see if they exist */
- if (events == NULL) {
- action = SDL_PEEKEVENT;
- numevents = 1;
- events = &tmpevent;
- }
-
- /* Clean out any used wmmsg data
- FIXME: Do we want to retain the data for some period of time?
- */
- for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; wmmsg = wmmsg_next) {
- wmmsg_next = wmmsg->next;
- wmmsg->next = SDL_EventQ.wmmsg_free;
- SDL_EventQ.wmmsg_free = wmmsg;
- }
- SDL_EventQ.wmmsg_used = NULL;
-
- for (entry = SDL_EventQ.head; entry && used < numevents; entry = next) {
- next = entry->next;
- type = entry->event.type;
- if (minType <= type && type <= maxType) {
- events[used] = entry->event;
- if (entry->event.type == SDL_SYSWMEVENT) {
- /* We need to copy the wmmsg somewhere safe.
- For now we'll guarantee it's valid at least until
- the next call to SDL_PeepEvents()
- */
- if (SDL_EventQ.wmmsg_free) {
- wmmsg = SDL_EventQ.wmmsg_free;
- SDL_EventQ.wmmsg_free = wmmsg->next;
- } else {
- wmmsg = (SDL_SysWMEntry *)SDL_malloc(sizeof(*wmmsg));
- }
- wmmsg->msg = *entry->event.syswm.msg;
- wmmsg->next = SDL_EventQ.wmmsg_used;
- SDL_EventQ.wmmsg_used = wmmsg;
- events[used].syswm.msg = &wmmsg->msg;
- }
- ++used;
-
- if (action == SDL_GETEVENT) {
- SDL_CutEvent(entry);
- }
- }
- }
- }
- SDL_UnlockMutex(SDL_EventQ.lock);
- } else {
- return SDL_SetError("Couldn't lock event queue");
- }
- return (used);
-}
-
-SDL_bool
-SDL_HasEvent(Uint32 type)
-{
- return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0);
-}
-
-SDL_bool
-SDL_HasEvents(Uint32 minType, Uint32 maxType)
-{
- return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0);
-}
-
-void
-SDL_FlushEvent(Uint32 type)
-{
- SDL_FlushEvents(type, type);
-}
-
-void
-SDL_FlushEvents(Uint32 minType, Uint32 maxType)
-{
- /* Don't look after we've quit */
- if (!SDL_EventQ.active) {
- return;
- }
-
- /* Make sure the events are current */
-#if 0
- /* Actually, we can't do this since we might be flushing while processing
- a resize event, and calling this might trigger further resize events.
- */
- SDL_PumpEvents();
-#endif
-
- /* Lock the event queue */
- if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
- SDL_EventEntry *entry, *next;
- Uint32 type;
- for (entry = SDL_EventQ.head; entry; entry = next) {
- next = entry->next;
- type = entry->event.type;
- if (minType <= type && type <= maxType) {
- SDL_CutEvent(entry);
- }
- }
- SDL_UnlockMutex(SDL_EventQ.lock);
- }
-}
-
-/* Run the system dependent event loops */
-void
-SDL_PumpEvents(void)
-{
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
- /* Get events from the video subsystem */
- if (_this) {
- _this->PumpEvents(_this);
- }
-#if !SDL_JOYSTICK_DISABLED
- /* Check for joystick state change */
- if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) {
- SDL_JoystickUpdate();
- }
-#endif
-
- SDL_SendPendingQuit(); /* in case we had a signal handler fire, etc. */
-}
-
-/* Public functions */
-
-int
-SDL_PollEvent(SDL_Event * event)
-{
- return SDL_WaitEventTimeout(event, 0);
-}
-
-int
-SDL_WaitEvent(SDL_Event * event)
-{
- return SDL_WaitEventTimeout(event, -1);
-}
-
-int
-SDL_WaitEventTimeout(SDL_Event * event, int timeout)
-{
- Uint32 expiration = 0;
-
- if (timeout > 0)
- expiration = SDL_GetTicks() + timeout;
-
- for (;;) {
- SDL_PumpEvents();
- switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
- case -1:
- return 0;
- case 1:
- return 1;
- case 0:
- if (timeout == 0) {
- /* Polling and no events, just return */
- return 0;
- }
- if (timeout > 0 && SDL_TICKS_PASSED(SDL_GetTicks(), expiration)) {
- /* Timeout expired and no events */
- return 0;
- }
- SDL_Delay(10);
- break;
- }
- }
-}
-
-int
-SDL_PushEvent(SDL_Event * event)
-{
- SDL_EventWatcher *curr;
-
- event->common.timestamp = SDL_GetTicks();
-
- if (SDL_EventOK && !SDL_EventOK(SDL_EventOKParam, event)) {
- return 0;
- }
-
- for (curr = SDL_event_watchers; curr; curr = curr->next) {
- curr->callback(curr->userdata, event);
- }
-
- if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0, 0) <= 0) {
- return -1;
- }
-
- SDL_GestureProcessEvent(event);
-
- return 1;
-}
-
-void
-SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
-{
- /* Set filter and discard pending events */
- SDL_EventOK = NULL;
- SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
- SDL_EventOKParam = userdata;
- SDL_EventOK = filter;
-}
-
-SDL_bool
-SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
-{
- if (filter) {
- *filter = SDL_EventOK;
- }
- if (userdata) {
- *userdata = SDL_EventOKParam;
- }
- return SDL_EventOK ? SDL_TRUE : SDL_FALSE;
-}
-
-/* FIXME: This is not thread-safe yet */
-void
-SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
-{
- SDL_EventWatcher *watcher, *tail;
-
- watcher = (SDL_EventWatcher *)SDL_malloc(sizeof(*watcher));
- if (!watcher) {
- /* Uh oh... */
- return;
- }
-
- /* create the watcher */
- watcher->callback = filter;
- watcher->userdata = userdata;
- watcher->next = NULL;
-
- /* add the watcher to the end of the list */
- if (SDL_event_watchers) {
- for (tail = SDL_event_watchers; tail->next; tail = tail->next) {
- continue;
- }
- tail->next = watcher;
- } else {
- SDL_event_watchers = watcher;
- }
-}
-
-/* FIXME: This is not thread-safe yet */
-void
-SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
-{
- SDL_EventWatcher *prev = NULL;
- SDL_EventWatcher *curr;
-
- for (curr = SDL_event_watchers; curr; prev = curr, curr = curr->next) {
- if (curr->callback == filter && curr->userdata == userdata) {
- if (prev) {
- prev->next = curr->next;
- } else {
- SDL_event_watchers = curr->next;
- }
- SDL_free(curr);
- break;
- }
- }
-}
-
-void
-SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
-{
- if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
- SDL_EventEntry *entry, *next;
- for (entry = SDL_EventQ.head; entry; entry = next) {
- next = entry->next;
- if (!filter(userdata, &entry->event)) {
- SDL_CutEvent(entry);
- }
- }
- SDL_UnlockMutex(SDL_EventQ.lock);
- }
-}
-
-Uint8
-SDL_EventState(Uint32 type, int state)
-{
- Uint8 current_state;
- Uint8 hi = ((type >> 8) & 0xff);
- Uint8 lo = (type & 0xff);
-
- if (SDL_disabled_events[hi] &&
- (SDL_disabled_events[hi]->bits[lo/32] & (1 << (lo&31)))) {
- current_state = SDL_DISABLE;
- } else {
- current_state = SDL_ENABLE;
- }
-
- if (state != current_state)
- {
- switch (state) {
- case SDL_DISABLE:
- /* Disable this event type and discard pending events */
- if (!SDL_disabled_events[hi]) {
- SDL_disabled_events[hi] = (SDL_DisabledEventBlock*) SDL_calloc(1, sizeof(SDL_DisabledEventBlock));
- if (!SDL_disabled_events[hi]) {
- /* Out of memory, nothing we can do... */
- break;
- }
- }
- SDL_disabled_events[hi]->bits[lo/32] |= (1 << (lo&31));
- SDL_FlushEvent(type);
- break;
- case SDL_ENABLE:
- SDL_disabled_events[hi]->bits[lo/32] &= ~(1 << (lo&31));
- break;
- default:
- /* Querying state... */
- break;
- }
- }
-
- return current_state;
-}
-
-Uint32
-SDL_RegisterEvents(int numevents)
-{
- Uint32 event_base;
-
- if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) {
- event_base = SDL_userevents;
- SDL_userevents += numevents;
- } else {
- event_base = (Uint32)-1;
- }
- return event_base;
-}
-
-int
-SDL_SendAppEvent(SDL_EventType eventType)
-{
- int posted;
-
- posted = 0;
- if (SDL_GetEventState(eventType) == SDL_ENABLE) {
- SDL_Event event;
- event.type = eventType;
- posted = (SDL_PushEvent(&event) > 0);
- }
- return (posted);
-}
-
-int
-SDL_SendSysWMEvent(SDL_SysWMmsg * message)
-{
- int posted;
-
- posted = 0;
- if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
- SDL_Event event;
- SDL_memset(&event, 0, sizeof(event));
- event.type = SDL_SYSWMEVENT;
- event.syswm.msg = message;
- posted = (SDL_PushEvent(&event) > 0);
- }
- /* Update internal event state */
- return (posted);
-}
-
-int
-SDL_SendKeymapChangedEvent(void)
-{
- return SDL_SendAppEvent(SDL_KEYMAPCHANGED);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontroller.c b/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontroller.c
deleted file mode 100644
index 0fd1ef4a7a..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontroller.c
+++ /dev/null
@@ -1,1318 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* This is the game controller API for Simple DirectMedia Layer */
-
-#include "SDL_events.h"
-#include "SDL_assert.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_hints.h"
-#include "SDL_gamecontrollerdb.h"
-
-#if !SDL_EVENTS_DISABLED
-#include "../events/SDL_events_c.h"
-#endif
-#define ABS(_x) ((_x) < 0 ? -(_x) : (_x))
-
-#define SDL_CONTROLLER_PLATFORM_FIELD "platform:"
-
-/* a list of currently opened game controllers */
-static SDL_GameController *SDL_gamecontrollers = NULL;
-
-/* keep track of the hat and mask value that transforms this hat movement into a button/axis press */
-struct _SDL_HatMapping
-{
- int hat;
- Uint8 mask;
-};
-
-#define k_nMaxReverseEntries 20
-
-/**
- * We are encoding the "HAT" as 0xhm. where h == hat ID and m == mask
- * MAX 4 hats supported
- */
-#define k_nMaxHatEntries 0x3f + 1
-
-/* our in memory mapping db between joystick objects and controller mappings */
-struct _SDL_ControllerMapping
-{
- SDL_JoystickGUID guid;
- const char *name;
-
- /* mapping of axis/button id to controller version */
- int axes[SDL_CONTROLLER_AXIS_MAX];
- int buttonasaxis[SDL_CONTROLLER_AXIS_MAX];
-
- int buttons[SDL_CONTROLLER_BUTTON_MAX];
- int axesasbutton[SDL_CONTROLLER_BUTTON_MAX];
- struct _SDL_HatMapping hatasbutton[SDL_CONTROLLER_BUTTON_MAX];
-
- /* reverse mapping, joystick indices to buttons */
- SDL_GameControllerAxis raxes[k_nMaxReverseEntries];
- SDL_GameControllerAxis rbuttonasaxis[k_nMaxReverseEntries];
-
- SDL_GameControllerButton rbuttons[k_nMaxReverseEntries];
- SDL_GameControllerButton raxesasbutton[k_nMaxReverseEntries];
- SDL_GameControllerButton rhatasbutton[k_nMaxHatEntries];
-
-};
-
-
-/* our hard coded list of mapping support */
-typedef struct _ControllerMapping_t
-{
- SDL_JoystickGUID guid;
- char *name;
- char *mapping;
- struct _ControllerMapping_t *next;
-} ControllerMapping_t;
-
-static ControllerMapping_t *s_pSupportedControllers = NULL;
-static ControllerMapping_t *s_pXInputMapping = NULL;
-static ControllerMapping_t *s_pEmscriptenMapping = NULL;
-
-/* The SDL game controller structure */
-struct _SDL_GameController
-{
- SDL_Joystick *joystick; /* underlying joystick device */
- int ref_count;
- Uint8 hatState[4]; /* the current hat state for this controller */
- struct _SDL_ControllerMapping mapping; /* the mapping object for this controller */
- struct _SDL_GameController *next; /* pointer to next game controller we have allocated */
-};
-
-
-int SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value);
-int SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state);
-
-/*
- * Event filter to fire controller events from joystick ones
- */
-int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
-{
- switch(event->type) {
- case SDL_JOYAXISMOTION:
- {
- SDL_GameController *controllerlist;
-
- if (event->jaxis.axis >= k_nMaxReverseEntries) break;
-
- controllerlist = SDL_gamecontrollers;
- while (controllerlist) {
- if (controllerlist->joystick->instance_id == event->jaxis.which) {
- if (controllerlist->mapping.raxes[event->jaxis.axis] >= 0) /* simple axis to axis, send it through */ {
- SDL_GameControllerAxis axis = controllerlist->mapping.raxes[event->jaxis.axis];
- Sint16 value = event->jaxis.value;
- switch (axis) {
- case SDL_CONTROLLER_AXIS_TRIGGERLEFT:
- case SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
- /* Shift it to be 0 - 32767. */
- value = value / 2 + 16384;
- default:
- break;
- }
- SDL_PrivateGameControllerAxis(controllerlist, axis, value);
- } else if (controllerlist->mapping.raxesasbutton[event->jaxis.axis] >= 0) { /* simulate an axis as a button */
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.raxesasbutton[event->jaxis.axis], ABS(event->jaxis.value) > 32768/2 ? SDL_PRESSED : SDL_RELEASED);
- }
- break;
- }
- controllerlist = controllerlist->next;
- }
- }
- break;
- case SDL_JOYBUTTONDOWN:
- case SDL_JOYBUTTONUP:
- {
- SDL_GameController *controllerlist;
-
- if (event->jbutton.button >= k_nMaxReverseEntries) break;
-
- controllerlist = SDL_gamecontrollers;
- while (controllerlist) {
- if (controllerlist->joystick->instance_id == event->jbutton.which) {
- if (controllerlist->mapping.rbuttons[event->jbutton.button] >= 0) { /* simple button as button */
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rbuttons[event->jbutton.button], event->jbutton.state);
- } else if (controllerlist->mapping.rbuttonasaxis[event->jbutton.button] >= 0) { /* an button pretending to be an axis */
- SDL_PrivateGameControllerAxis(controllerlist, controllerlist->mapping.rbuttonasaxis[event->jbutton.button], event->jbutton.state > 0 ? 32767 : 0);
- }
- break;
- }
- controllerlist = controllerlist->next;
- }
- }
- break;
- case SDL_JOYHATMOTION:
- {
- SDL_GameController *controllerlist;
-
- if (event->jhat.hat >= 4) break;
-
- controllerlist = SDL_gamecontrollers;
- while (controllerlist) {
- if (controllerlist->joystick->instance_id == event->jhat.which) {
- Uint8 bSame = controllerlist->hatState[event->jhat.hat] & event->jhat.value;
- /* Get list of removed bits (button release) */
- Uint8 bChanged = controllerlist->hatState[event->jhat.hat] ^ bSame;
- /* the hat idx in the high nibble */
- int bHighHat = event->jhat.hat << 4;
-
- if (bChanged & SDL_HAT_DOWN)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_RELEASED);
- if (bChanged & SDL_HAT_UP)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_RELEASED);
- if (bChanged & SDL_HAT_LEFT)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_RELEASED);
- if (bChanged & SDL_HAT_RIGHT)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_RELEASED);
-
- /* Get list of added bits (button press) */
- bChanged = event->jhat.value ^ bSame;
-
- if (bChanged & SDL_HAT_DOWN)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_PRESSED);
- if (bChanged & SDL_HAT_UP)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_PRESSED);
- if (bChanged & SDL_HAT_LEFT)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_PRESSED);
- if (bChanged & SDL_HAT_RIGHT)
- SDL_PrivateGameControllerButton(controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_PRESSED);
-
- /* update our state cache */
- controllerlist->hatState[event->jhat.hat] = event->jhat.value;
-
- break;
- }
- controllerlist = controllerlist->next;
- }
- }
- break;
- case SDL_JOYDEVICEADDED:
- {
- if (SDL_IsGameController(event->jdevice.which)) {
- SDL_Event deviceevent;
- deviceevent.type = SDL_CONTROLLERDEVICEADDED;
- deviceevent.cdevice.which = event->jdevice.which;
- SDL_PushEvent(&deviceevent);
- }
- }
- break;
- case SDL_JOYDEVICEREMOVED:
- {
- SDL_GameController *controllerlist = SDL_gamecontrollers;
- while (controllerlist) {
- if (controllerlist->joystick->instance_id == event->jdevice.which) {
- SDL_Event deviceevent;
- deviceevent.type = SDL_CONTROLLERDEVICEREMOVED;
- deviceevent.cdevice.which = event->jdevice.which;
- SDL_PushEvent(&deviceevent);
- break;
- }
- controllerlist = controllerlist->next;
- }
- }
- break;
- default:
- break;
- }
-
- return 1;
-}
-
-/*
- * Helper function to scan the mappings database for a controller with the specified GUID
- */
-ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid)
-{
- ControllerMapping_t *pSupportedController = s_pSupportedControllers;
- while (pSupportedController) {
- if (SDL_memcmp(guid, &pSupportedController->guid, sizeof(*guid)) == 0) {
- return pSupportedController;
- }
- pSupportedController = pSupportedController->next;
- }
- return NULL;
-}
-
-static const char* map_StringForControllerAxis[] = {
- "leftx",
- "lefty",
- "rightx",
- "righty",
- "lefttrigger",
- "righttrigger",
- NULL
-};
-
-/*
- * convert a string to its enum equivalent
- */
-SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString)
-{
- int entry;
- if (!pchString || !pchString[0])
- return SDL_CONTROLLER_AXIS_INVALID;
-
- for (entry = 0; map_StringForControllerAxis[entry]; ++entry) {
- if (!SDL_strcasecmp(pchString, map_StringForControllerAxis[entry]))
- return entry;
- }
- return SDL_CONTROLLER_AXIS_INVALID;
-}
-
-/*
- * convert an enum to its string equivalent
- */
-const char* SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
-{
- if (axis > SDL_CONTROLLER_AXIS_INVALID && axis < SDL_CONTROLLER_AXIS_MAX) {
- return map_StringForControllerAxis[axis];
- }
- return NULL;
-}
-
-static const char* map_StringForControllerButton[] = {
- "a",
- "b",
- "x",
- "y",
- "back",
- "guide",
- "start",
- "leftstick",
- "rightstick",
- "leftshoulder",
- "rightshoulder",
- "dpup",
- "dpdown",
- "dpleft",
- "dpright",
- NULL
-};
-
-/*
- * convert a string to its enum equivalent
- */
-SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchString)
-{
- int entry;
- if (!pchString || !pchString[0])
- return SDL_CONTROLLER_BUTTON_INVALID;
-
- for (entry = 0; map_StringForControllerButton[entry]; ++entry) {
- if (SDL_strcasecmp(pchString, map_StringForControllerButton[entry]) == 0)
- return entry;
- }
- return SDL_CONTROLLER_BUTTON_INVALID;
-}
-
-/*
- * convert an enum to its string equivalent
- */
-const char* SDL_GameControllerGetStringForButton(SDL_GameControllerButton axis)
-{
- if (axis > SDL_CONTROLLER_BUTTON_INVALID && axis < SDL_CONTROLLER_BUTTON_MAX) {
- return map_StringForControllerButton[axis];
- }
- return NULL;
-}
-
-/*
- * given a controller button name and a joystick name update our mapping structure with it
- */
-void SDL_PrivateGameControllerParseButton(const char *szGameButton, const char *szJoystickButton, struct _SDL_ControllerMapping *pMapping)
-{
- int iSDLButton = 0;
- SDL_GameControllerButton button;
- SDL_GameControllerAxis axis;
- button = SDL_GameControllerGetButtonFromString(szGameButton);
- axis = SDL_GameControllerGetAxisFromString(szGameButton);
- iSDLButton = SDL_atoi(&szJoystickButton[1]);
-
- if (szJoystickButton[0] == 'a') {
- if (iSDLButton >= k_nMaxReverseEntries) {
- SDL_SetError("Axis index too large: %d", iSDLButton);
- return;
- }
- if (axis != SDL_CONTROLLER_AXIS_INVALID) {
- pMapping->axes[ axis ] = iSDLButton;
- pMapping->raxes[ iSDLButton ] = axis;
- } else if (button != SDL_CONTROLLER_BUTTON_INVALID) {
- pMapping->axesasbutton[ button ] = iSDLButton;
- pMapping->raxesasbutton[ iSDLButton ] = button;
- } else {
- SDL_assert(!"How did we get here?");
- }
-
- } else if (szJoystickButton[0] == 'b') {
- if (iSDLButton >= k_nMaxReverseEntries) {
- SDL_SetError("Button index too large: %d", iSDLButton);
- return;
- }
- if (button != SDL_CONTROLLER_BUTTON_INVALID) {
- pMapping->buttons[ button ] = iSDLButton;
- pMapping->rbuttons[ iSDLButton ] = button;
- } else if (axis != SDL_CONTROLLER_AXIS_INVALID) {
- pMapping->buttonasaxis[ axis ] = iSDLButton;
- pMapping->rbuttonasaxis[ iSDLButton ] = axis;
- } else {
- SDL_assert(!"How did we get here?");
- }
- } else if (szJoystickButton[0] == 'h') {
- int hat = SDL_atoi(&szJoystickButton[1]);
- int mask = SDL_atoi(&szJoystickButton[3]);
- if (hat >= 4) {
- SDL_SetError("Hat index too large: %d", iSDLButton);
- }
-
- if (button != SDL_CONTROLLER_BUTTON_INVALID) {
- int ridx;
- pMapping->hatasbutton[ button ].hat = hat;
- pMapping->hatasbutton[ button ].mask = mask;
- ridx = (hat << 4) | mask;
- pMapping->rhatasbutton[ ridx ] = button;
- } else if (axis != SDL_CONTROLLER_AXIS_INVALID) {
- SDL_assert(!"Support hat as axis");
- } else {
- SDL_assert(!"How did we get here?");
- }
- }
-}
-
-
-/*
- * given a controller mapping string update our mapping object
- */
-static void
-SDL_PrivateGameControllerParseControllerConfigString(struct _SDL_ControllerMapping *pMapping, const char *pchString)
-{
- char szGameButton[20];
- char szJoystickButton[20];
- SDL_bool bGameButton = SDL_TRUE;
- int i = 0;
- const char *pchPos = pchString;
-
- SDL_memset(szGameButton, 0x0, sizeof(szGameButton));
- SDL_memset(szJoystickButton, 0x0, sizeof(szJoystickButton));
-
- while (pchPos && *pchPos) {
- if (*pchPos == ':') {
- i = 0;
- bGameButton = SDL_FALSE;
- } else if (*pchPos == ' ') {
-
- } else if (*pchPos == ',') {
- i = 0;
- bGameButton = SDL_TRUE;
- SDL_PrivateGameControllerParseButton(szGameButton, szJoystickButton, pMapping);
- SDL_memset(szGameButton, 0x0, sizeof(szGameButton));
- SDL_memset(szJoystickButton, 0x0, sizeof(szJoystickButton));
-
- } else if (bGameButton) {
- if (i >= sizeof(szGameButton)) {
- SDL_SetError("Button name too large: %s", szGameButton);
- return;
- }
- szGameButton[i] = *pchPos;
- i++;
- } else {
- if (i >= sizeof(szJoystickButton)) {
- SDL_SetError("Joystick button name too large: %s", szJoystickButton);
- return;
- }
- szJoystickButton[i] = *pchPos;
- i++;
- }
- pchPos++;
- }
-
- SDL_PrivateGameControllerParseButton(szGameButton, szJoystickButton, pMapping);
-
-}
-
-/*
- * Make a new button mapping struct
- */
-void SDL_PrivateLoadButtonMapping(struct _SDL_ControllerMapping *pMapping, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping)
-{
- int j;
-
- pMapping->guid = guid;
- pMapping->name = pchName;
-
- /* set all the button mappings to non defaults */
- for (j = 0; j < SDL_CONTROLLER_AXIS_MAX; j++) {
- pMapping->axes[j] = -1;
- pMapping->buttonasaxis[j] = -1;
- }
- for (j = 0; j < SDL_CONTROLLER_BUTTON_MAX; j++) {
- pMapping->buttons[j] = -1;
- pMapping->axesasbutton[j] = -1;
- pMapping->hatasbutton[j].hat = -1;
- }
-
- for (j = 0; j < k_nMaxReverseEntries; j++) {
- pMapping->raxes[j] = SDL_CONTROLLER_AXIS_INVALID;
- pMapping->rbuttonasaxis[j] = SDL_CONTROLLER_AXIS_INVALID;
- pMapping->rbuttons[j] = SDL_CONTROLLER_BUTTON_INVALID;
- pMapping->raxesasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID;
- }
-
- for (j = 0; j < k_nMaxHatEntries; j++) {
- pMapping->rhatasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID;
- }
-
- SDL_PrivateGameControllerParseControllerConfigString(pMapping, pchMapping);
-}
-
-
-/*
- * grab the guid string from a mapping string
- */
-char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
-{
- const char *pFirstComma = SDL_strchr(pMapping, ',');
- if (pFirstComma) {
- char *pchGUID = SDL_malloc(pFirstComma - pMapping + 1);
- if (!pchGUID) {
- SDL_OutOfMemory();
- return NULL;
- }
- SDL_memcpy(pchGUID, pMapping, pFirstComma - pMapping);
- pchGUID[ pFirstComma - pMapping ] = 0;
- return pchGUID;
- }
- return NULL;
-}
-
-
-/*
- * grab the name string from a mapping string
- */
-char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping)
-{
- const char *pFirstComma, *pSecondComma;
- char *pchName;
-
- pFirstComma = SDL_strchr(pMapping, ',');
- if (!pFirstComma)
- return NULL;
-
- pSecondComma = SDL_strchr(pFirstComma + 1, ',');
- if (!pSecondComma)
- return NULL;
-
- pchName = SDL_malloc(pSecondComma - pFirstComma);
- if (!pchName) {
- SDL_OutOfMemory();
- return NULL;
- }
- SDL_memcpy(pchName, pFirstComma + 1, pSecondComma - pFirstComma);
- pchName[ pSecondComma - pFirstComma - 1 ] = 0;
- return pchName;
-}
-
-
-/*
- * grab the button mapping string from a mapping string
- */
-char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMapping)
-{
- const char *pFirstComma, *pSecondComma;
-
- pFirstComma = SDL_strchr(pMapping, ',');
- if (!pFirstComma)
- return NULL;
-
- pSecondComma = SDL_strchr(pFirstComma + 1, ',');
- if (!pSecondComma)
- return NULL;
-
- return SDL_strdup(pSecondComma + 1); /* mapping is everything after the 3rd comma */
-}
-
-/*
- * Helper function to refresh a mapping
- */
-void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping)
-{
- SDL_GameController *gamecontrollerlist = SDL_gamecontrollers;
- while (gamecontrollerlist) {
- if (!SDL_memcmp(&gamecontrollerlist->mapping.guid, &pControllerMapping->guid, sizeof(pControllerMapping->guid))) {
- SDL_Event event;
- event.type = SDL_CONTROLLERDEVICEREMAPPED;
- event.cdevice.which = gamecontrollerlist->joystick->instance_id;
- SDL_PushEvent(&event);
-
- /* Not really threadsafe. Should this lock access within SDL_GameControllerEventWatcher? */
- SDL_PrivateLoadButtonMapping(&gamecontrollerlist->mapping, pControllerMapping->guid, pControllerMapping->name, pControllerMapping->mapping);
- }
-
- gamecontrollerlist = gamecontrollerlist->next;
- }
-}
-
-/*
- * Helper function to add a mapping for a guid
- */
-static ControllerMapping_t *
-SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing)
-{
- char *pchName;
- char *pchMapping;
- ControllerMapping_t *pControllerMapping;
-
- pchName = SDL_PrivateGetControllerNameFromMappingString(mappingString);
- if (!pchName) {
- SDL_SetError("Couldn't parse name from %s", mappingString);
- return NULL;
- }
-
- pchMapping = SDL_PrivateGetControllerMappingFromMappingString(mappingString);
- if (!pchMapping) {
- SDL_free(pchName);
- SDL_SetError("Couldn't parse %s", mappingString);
- return NULL;
- }
-
- pControllerMapping = SDL_PrivateGetControllerMappingForGUID(&jGUID);
- if (pControllerMapping) {
- /* Update existing mapping */
- SDL_free(pControllerMapping->name);
- pControllerMapping->name = pchName;
- SDL_free(pControllerMapping->mapping);
- pControllerMapping->mapping = pchMapping;
- /* refresh open controllers */
- SDL_PrivateGameControllerRefreshMapping(pControllerMapping);
- *existing = SDL_TRUE;
- } else {
- pControllerMapping = SDL_malloc(sizeof(*pControllerMapping));
- if (!pControllerMapping) {
- SDL_free(pchName);
- SDL_free(pchMapping);
- SDL_OutOfMemory();
- return NULL;
- }
- pControllerMapping->guid = jGUID;
- pControllerMapping->name = pchName;
- pControllerMapping->mapping = pchMapping;
- pControllerMapping->next = s_pSupportedControllers;
- s_pSupportedControllers = pControllerMapping;
- *existing = SDL_FALSE;
- }
- return pControllerMapping;
-}
-
-/*
- * Helper function to determine pre-calculated offset to certain joystick mappings
- */
-ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
-{
- SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index);
- ControllerMapping_t *mapping;
-
- mapping = SDL_PrivateGetControllerMappingForGUID(&jGUID);
-#if SDL_JOYSTICK_XINPUT
- if (!mapping && SDL_SYS_IsXInputGamepad_DeviceIndex(device_index)) {
- mapping = s_pXInputMapping;
- }
-#endif
-#if defined(SDL_JOYSTICK_EMSCRIPTEN)
- if (!mapping && s_pEmscriptenMapping) {
- mapping = s_pEmscriptenMapping;
- }
-#endif
-#ifdef __LINUX__
- if (!mapping) {
- const char *name = SDL_JoystickNameForIndex(device_index);
- if (name) {
- if (SDL_strstr(name, "Xbox 360 Wireless Receiver")) {
- /* The Linux driver xpad.c maps the wireless dpad to buttons */
- SDL_bool existing;
- mapping = SDL_PrivateAddMappingForGUID(jGUID,
-"none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- &existing);
- }
- }
- }
-#endif /* __LINUX__ */
-
- if (!mapping) {
- const char *name = SDL_JoystickNameForIndex(device_index);
- if (name) {
- if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box")) {
- mapping = s_pXInputMapping;
- }
- }
- }
- return mapping;
-}
-
-/*
- * Add or update an entry into the Mappings Database
- */
-int
-SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw)
-{
- const char *platform = SDL_GetPlatform();
- int controllers = 0;
- char *buf, *line, *line_end, *tmp, *comma, line_platform[64];
- size_t db_size, platform_len;
-
- if (rw == NULL) {
- return SDL_SetError("Invalid RWops");
- }
- db_size = (size_t)SDL_RWsize(rw);
-
- buf = (char *)SDL_malloc(db_size + 1);
- if (buf == NULL) {
- if (freerw) {
- SDL_RWclose(rw);
- }
- return SDL_SetError("Could not allocate space to read DB into memory");
- }
-
- if (SDL_RWread(rw, buf, db_size, 1) != 1) {
- if (freerw) {
- SDL_RWclose(rw);
- }
- SDL_free(buf);
- return SDL_SetError("Could not read DB");
- }
-
- if (freerw) {
- SDL_RWclose(rw);
- }
-
- buf[db_size] = '\0';
- line = buf;
-
- while (line < buf + db_size) {
- line_end = SDL_strchr(line, '\n');
- if (line_end != NULL) {
- *line_end = '\0';
- } else {
- line_end = buf + db_size;
- }
-
- /* Extract and verify the platform */
- tmp = SDL_strstr(line, SDL_CONTROLLER_PLATFORM_FIELD);
- if (tmp != NULL) {
- tmp += SDL_strlen(SDL_CONTROLLER_PLATFORM_FIELD);
- comma = SDL_strchr(tmp, ',');
- if (comma != NULL) {
- platform_len = comma - tmp + 1;
- if (platform_len + 1 < SDL_arraysize(line_platform)) {
- SDL_strlcpy(line_platform, tmp, platform_len);
- if (SDL_strncasecmp(line_platform, platform, platform_len) == 0 &&
- SDL_GameControllerAddMapping(line) > 0) {
- controllers++;
- }
- }
- }
- }
-
- line = line_end + 1;
- }
-
- SDL_free(buf);
- return controllers;
-}
-
-/*
- * Add or update an entry into the Mappings Database
- */
-int
-SDL_GameControllerAddMapping(const char *mappingString)
-{
- char *pchGUID;
- SDL_JoystickGUID jGUID;
- SDL_bool is_xinput_mapping = SDL_FALSE;
- SDL_bool is_emscripten_mapping = SDL_FALSE;
- SDL_bool existing = SDL_FALSE;
- ControllerMapping_t *pControllerMapping;
-
- if (!mappingString) {
- return SDL_InvalidParamError("mappingString");
- }
-
- pchGUID = SDL_PrivateGetControllerGUIDFromMappingString(mappingString);
- if (!pchGUID) {
- return SDL_SetError("Couldn't parse GUID from %s", mappingString);
- }
- if (!SDL_strcasecmp(pchGUID, "xinput")) {
- is_xinput_mapping = SDL_TRUE;
- }
- if (!SDL_strcasecmp(pchGUID, "emscripten")) {
- is_emscripten_mapping = SDL_TRUE;
- }
- jGUID = SDL_JoystickGetGUIDFromString(pchGUID);
- SDL_free(pchGUID);
-
- pControllerMapping = SDL_PrivateAddMappingForGUID(jGUID, mappingString, &existing);
- if (!pControllerMapping) {
- return -1;
- }
-
- if (existing) {
- return 0;
- } else {
- if (is_xinput_mapping) {
- s_pXInputMapping = pControllerMapping;
- }
- if (is_emscripten_mapping) {
- s_pEmscriptenMapping = pControllerMapping;
- }
- return 1;
- }
-}
-
-/*
- * Get the mapping string for this GUID
- */
-char *
-SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
-{
- char *pMappingString = NULL;
- ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(&guid);
- if (mapping) {
- char pchGUID[33];
- size_t needed;
- SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID));
- /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
- needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1;
- pMappingString = SDL_malloc(needed);
- if (!pMappingString) {
- SDL_OutOfMemory();
- return NULL;
- }
- SDL_snprintf(pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping);
- }
- return pMappingString;
-}
-
-/*
- * Get the mapping string for this device
- */
-char *
-SDL_GameControllerMapping(SDL_GameController * gamecontroller)
-{
- if (!gamecontroller) {
- return NULL;
- }
-
- return SDL_GameControllerMappingForGUID(gamecontroller->mapping.guid);
-}
-
-static void
-SDL_GameControllerLoadHints()
-{
- const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG);
- if (hint && hint[0]) {
- size_t nchHints = SDL_strlen(hint);
- char *pUserMappings = SDL_malloc(nchHints + 1);
- char *pTempMappings = pUserMappings;
- SDL_memcpy(pUserMappings, hint, nchHints);
- pUserMappings[nchHints] = '\0';
- while (pUserMappings) {
- char *pchNewLine = NULL;
-
- pchNewLine = SDL_strchr(pUserMappings, '\n');
- if (pchNewLine)
- *pchNewLine = '\0';
-
- SDL_GameControllerAddMapping(pUserMappings);
-
- if (pchNewLine) {
- pUserMappings = pchNewLine + 1;
- } else {
- pUserMappings = NULL;
- }
- }
- SDL_free(pTempMappings);
- }
-}
-
-/*
- * Initialize the game controller system, mostly load our DB of controller config mappings
- */
-int
-SDL_GameControllerInit(void)
-{
- int i = 0;
- const char *pMappingString = NULL;
- s_pSupportedControllers = NULL;
- pMappingString = s_ControllerMappings[i];
- while (pMappingString) {
- SDL_GameControllerAddMapping(pMappingString);
-
- i++;
- pMappingString = s_ControllerMappings[i];
- }
-
- /* load in any user supplied config */
- SDL_GameControllerLoadHints();
-
- /* watch for joy events and fire controller ones if needed */
- SDL_AddEventWatch(SDL_GameControllerEventWatcher, NULL);
-
- /* Send added events for controllers currently attached */
- for (i = 0; i < SDL_NumJoysticks(); ++i) {
- if (SDL_IsGameController(i)) {
- SDL_Event deviceevent;
- deviceevent.type = SDL_CONTROLLERDEVICEADDED;
- deviceevent.cdevice.which = i;
- SDL_PushEvent(&deviceevent);
- }
- }
-
- return (0);
-}
-
-
-/*
- * Get the implementation dependent name of a controller
- */
-const char *
-SDL_GameControllerNameForIndex(int device_index)
-{
- ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index);
- if (pSupportedController) {
- return pSupportedController->name;
- }
- return NULL;
-}
-
-
-/*
- * Return 1 if the joystick at this device index is a supported controller
- */
-SDL_bool
-SDL_IsGameController(int device_index)
-{
- ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index);
- if (pSupportedController) {
- return SDL_TRUE;
- }
-
- return SDL_FALSE;
-}
-
-/*
- * Open a controller for use - the index passed as an argument refers to
- * the N'th controller on the system. This index is the value which will
- * identify this controller in future controller events.
- *
- * This function returns a controller identifier, or NULL if an error occurred.
- */
-SDL_GameController *
-SDL_GameControllerOpen(int device_index)
-{
- SDL_GameController *gamecontroller;
- SDL_GameController *gamecontrollerlist;
- ControllerMapping_t *pSupportedController = NULL;
-
- if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
- SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
- return (NULL);
- }
-
- gamecontrollerlist = SDL_gamecontrollers;
- /* If the controller is already open, return it */
- while (gamecontrollerlist) {
- if (SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == gamecontrollerlist->joystick->instance_id) {
- gamecontroller = gamecontrollerlist;
- ++gamecontroller->ref_count;
- return (gamecontroller);
- }
- gamecontrollerlist = gamecontrollerlist->next;
- }
-
- /* Find a controller mapping */
- pSupportedController = SDL_PrivateGetControllerMapping(device_index);
- if (!pSupportedController) {
- SDL_SetError("Couldn't find mapping for device (%d)", device_index);
- return (NULL);
- }
-
- /* Create and initialize the joystick */
- gamecontroller = (SDL_GameController *) SDL_malloc((sizeof *gamecontroller));
- if (gamecontroller == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- SDL_memset(gamecontroller, 0, (sizeof *gamecontroller));
- gamecontroller->joystick = SDL_JoystickOpen(device_index);
- if (!gamecontroller->joystick) {
- SDL_free(gamecontroller);
- return NULL;
- }
-
- SDL_PrivateLoadButtonMapping(&gamecontroller->mapping, pSupportedController->guid, pSupportedController->name, pSupportedController->mapping);
-
- /* Add joystick to list */
- ++gamecontroller->ref_count;
- /* Link the joystick in the list */
- gamecontroller->next = SDL_gamecontrollers;
- SDL_gamecontrollers = gamecontroller;
-
- SDL_SYS_JoystickUpdate(gamecontroller->joystick);
-
- return (gamecontroller);
-}
-
-/*
- * Manually pump for controller updates.
- */
-void
-SDL_GameControllerUpdate(void)
-{
- /* Just for API completeness; the joystick API does all the work. */
- SDL_JoystickUpdate();
-}
-
-
-/*
- * Get the current state of an axis control on a controller
- */
-Sint16
-SDL_GameControllerGetAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis)
-{
- if (!gamecontroller)
- return 0;
-
- if (gamecontroller->mapping.axes[axis] >= 0) {
- Sint16 value = (SDL_JoystickGetAxis(gamecontroller->joystick, gamecontroller->mapping.axes[axis]));
- switch (axis) {
- case SDL_CONTROLLER_AXIS_TRIGGERLEFT:
- case SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
- /* Shift it to be 0 - 32767. */
- value = value / 2 + 16384;
- default:
- break;
- }
- return value;
- } else if (gamecontroller->mapping.buttonasaxis[axis] >= 0) {
- Uint8 value;
- value = SDL_JoystickGetButton(gamecontroller->joystick, gamecontroller->mapping.buttonasaxis[axis]);
- if (value > 0)
- return 32767;
- return 0;
- }
- return 0;
-}
-
-
-/*
- * Get the current state of a button on a controller
- */
-Uint8
-SDL_GameControllerGetButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button)
-{
- if (!gamecontroller)
- return 0;
-
- if (gamecontroller->mapping.buttons[button] >= 0) {
- return (SDL_JoystickGetButton(gamecontroller->joystick, gamecontroller->mapping.buttons[button]));
- } else if (gamecontroller->mapping.axesasbutton[button] >= 0) {
- Sint16 value;
- value = SDL_JoystickGetAxis(gamecontroller->joystick, gamecontroller->mapping.axesasbutton[button]);
- if (ABS(value) > 32768/2)
- return 1;
- return 0;
- } else if (gamecontroller->mapping.hatasbutton[button].hat >= 0) {
- Uint8 value;
- value = SDL_JoystickGetHat(gamecontroller->joystick, gamecontroller->mapping.hatasbutton[button].hat);
-
- if (value & gamecontroller->mapping.hatasbutton[button].mask)
- return 1;
- return 0;
- }
-
- return 0;
-}
-
-/*
- * Return if the joystick in question is currently attached to the system,
- * \return 0 if not plugged in, 1 if still present.
- */
-SDL_bool
-SDL_GameControllerGetAttached(SDL_GameController * gamecontroller)
-{
- if (!gamecontroller)
- return SDL_FALSE;
-
- return SDL_JoystickGetAttached(gamecontroller->joystick);
-}
-
-
-const char *
-SDL_GameControllerName(SDL_GameController * gamecontroller)
-{
- if (!gamecontroller)
- return NULL;
-
- return (gamecontroller->mapping.name);
-}
-
-
-/*
- * Get the joystick for this controller
- */
-SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController * gamecontroller)
-{
- if (!gamecontroller)
- return NULL;
-
- return gamecontroller->joystick;
-}
-
-
-/*
- * Find the SDL_GameController that owns this instance id
- */
-SDL_GameController *
-SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)
-{
- SDL_GameController *gamecontroller = SDL_gamecontrollers;
- while (gamecontroller) {
- if (gamecontroller->joystick->instance_id == joyid) {
- return gamecontroller;
- }
- gamecontroller = gamecontroller->next;
- }
-
- return NULL;
-}
-
-
-/**
- * Get the SDL joystick layer binding for this controller axis mapping
- */
-SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis)
-{
- SDL_GameControllerButtonBind bind;
- SDL_memset(&bind, 0x0, sizeof(bind));
-
- if (!gamecontroller || axis == SDL_CONTROLLER_AXIS_INVALID)
- return bind;
-
- if (gamecontroller->mapping.axes[axis] >= 0) {
- bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
- bind.value.button = gamecontroller->mapping.axes[axis];
- } else if (gamecontroller->mapping.buttonasaxis[axis] >= 0) {
- bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
- bind.value.button = gamecontroller->mapping.buttonasaxis[axis];
- }
-
- return bind;
-}
-
-
-/**
- * Get the SDL joystick layer binding for this controller button mapping
- */
-SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button)
-{
- SDL_GameControllerButtonBind bind;
- SDL_memset(&bind, 0x0, sizeof(bind));
-
- if (!gamecontroller || button == SDL_CONTROLLER_BUTTON_INVALID)
- return bind;
-
- if (gamecontroller->mapping.buttons[button] >= 0) {
- bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
- bind.value.button = gamecontroller->mapping.buttons[button];
- } else if (gamecontroller->mapping.axesasbutton[button] >= 0) {
- bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
- bind.value.axis = gamecontroller->mapping.axesasbutton[button];
- } else if (gamecontroller->mapping.hatasbutton[button].hat >= 0) {
- bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT;
- bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
- bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
- }
-
- return bind;
-}
-
-
-void
-SDL_GameControllerClose(SDL_GameController * gamecontroller)
-{
- SDL_GameController *gamecontrollerlist, *gamecontrollerlistprev;
-
- if (!gamecontroller)
- return;
-
- /* First decrement ref count */
- if (--gamecontroller->ref_count > 0) {
- return;
- }
-
- SDL_JoystickClose(gamecontroller->joystick);
-
- gamecontrollerlist = SDL_gamecontrollers;
- gamecontrollerlistprev = NULL;
- while (gamecontrollerlist) {
- if (gamecontroller == gamecontrollerlist) {
- if (gamecontrollerlistprev) {
- /* unlink this entry */
- gamecontrollerlistprev->next = gamecontrollerlist->next;
- } else {
- SDL_gamecontrollers = gamecontroller->next;
- }
-
- break;
- }
- gamecontrollerlistprev = gamecontrollerlist;
- gamecontrollerlist = gamecontrollerlist->next;
- }
-
- SDL_free(gamecontroller);
-}
-
-
-/*
- * Quit the controller subsystem
- */
-void
-SDL_GameControllerQuit(void)
-{
- ControllerMapping_t *pControllerMap;
- while (SDL_gamecontrollers) {
- SDL_gamecontrollers->ref_count = 1;
- SDL_GameControllerClose(SDL_gamecontrollers);
- }
-
- while (s_pSupportedControllers) {
- pControllerMap = s_pSupportedControllers;
- s_pSupportedControllers = s_pSupportedControllers->next;
- SDL_free(pControllerMap->name);
- SDL_free(pControllerMap->mapping);
- SDL_free(pControllerMap);
- }
-
- SDL_DelEventWatch(SDL_GameControllerEventWatcher, NULL);
-
-}
-
-/*
- * Event filter to transform joystick events into appropriate game controller ones
- */
-int
-SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value)
-{
- int posted;
-
- /* translate the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(SDL_CONTROLLERAXISMOTION) == SDL_ENABLE) {
- SDL_Event event;
- event.type = SDL_CONTROLLERAXISMOTION;
- event.caxis.which = gamecontroller->joystick->instance_id;
- event.caxis.axis = axis;
- event.caxis.value = value;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-
-/*
- * Event filter to transform joystick events into appropriate game controller ones
- */
-int
-SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state)
-{
- int posted;
-#if !SDL_EVENTS_DISABLED
- SDL_Event event;
-
- if (button == SDL_CONTROLLER_BUTTON_INVALID)
- return (0);
-
- switch (state) {
- case SDL_PRESSED:
- event.type = SDL_CONTROLLERBUTTONDOWN;
- break;
- case SDL_RELEASED:
- event.type = SDL_CONTROLLERBUTTONUP;
- break;
- default:
- /* Invalid state -- bail */
- return (0);
- }
-#endif /* !SDL_EVENTS_DISABLED */
-
- /* translate the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(event.type) == SDL_ENABLE) {
- event.cbutton.which = gamecontroller->joystick->instance_id;
- event.cbutton.button = button;
- event.cbutton.state = state;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-/*
- * Turn off controller events
- */
-int
-SDL_GameControllerEventState(int state)
-{
-#if SDL_EVENTS_DISABLED
- return SDL_IGNORE;
-#else
- const Uint32 event_list[] = {
- SDL_CONTROLLERAXISMOTION, SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP,
- SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED,
- };
- unsigned int i;
-
- switch (state) {
- case SDL_QUERY:
- state = SDL_IGNORE;
- for (i = 0; i < SDL_arraysize(event_list); ++i) {
- state = SDL_EventState(event_list[i], SDL_QUERY);
- if (state == SDL_ENABLE) {
- break;
- }
- }
- break;
- default:
- for (i = 0; i < SDL_arraysize(event_list); ++i) {
- SDL_EventState(event_list[i], state);
- }
- break;
- }
- return (state);
-#endif /* SDL_EVENTS_DISABLED */
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontrollerdb.h b/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontrollerdb.h
deleted file mode 100644
index 211d00d01e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/SDL_gamecontrollerdb.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-
-/* Default mappings we support
-
- The easiest way to generate a new mapping is to start Steam in Big Picture
- mode, configure your joystick and then look in config/config.vdf in your
- Steam installation directory for the "SDL_GamepadBind" entry.
-
- Alternatively, you can use the app located in test/controllermap
- */
-static const char *s_ControllerMappings [] =
-{
-#if SDL_JOYSTICK_XINPUT
- "xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-#endif
-#if SDL_JOYSTICK_DINPUT
- "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "e8206058000000000000504944564944,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
- "ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
- "6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "6d0418c2000000000000504944564944,Logitech F510 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
- "4d6963726f736f66742050432d6a6f79,OUYA Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a5,righty:a4,x:b1,y:b2,",
- "88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,",
- "4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
- "25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,",
- "4c05c405000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
-#endif
-#if defined(__MACOSX__)
- "830500000000000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
- "6d0400000000000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
- "6d0400000000000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "6d040000000000001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
- "6d0400000000000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. */
- "4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
- "4c05000000000000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
- "11010000000000002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,",
- "11010000000000001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,",
- "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
-#endif
-#if defined(__LINUX__)
- "03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
- "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
- "030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
- "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
- "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
- "050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b1,b:b0,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
- "050000003620000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
- "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
- "03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
- "030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
- "050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
- "03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
- "050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
- "03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "03000000de280000ff11000001000000,Valve Streaming Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
- "030000005e040000d102000001010000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-#endif
-#if defined(__ANDROID__)
- "4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
-#endif
-#if defined(SDL_JOYSTICK_MFI)
- "4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,",
- "4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,",
-#endif
-#if defined(SDL_JOYSTICK_EMSCRIPTEN)
- "emscripten,Standard Gamepad,a:b0,b:b1,back:b8,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b16,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
-#endif
- NULL
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick.c b/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick.c
deleted file mode 100644
index dc910a82b1..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick.c
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* This is the joystick API for Simple DirectMedia Layer */
-
-#include "SDL.h"
-#include "SDL_events.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-
-#if !SDL_EVENTS_DISABLED
-#include "../events/SDL_events_c.h"
-#endif
-
-static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE;
-static SDL_Joystick *SDL_joysticks = NULL;
-static SDL_Joystick *SDL_updating_joystick = NULL;
-
-static void
-SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
-{
- if (hint && *hint == '1') {
- SDL_joystick_allows_background_events = SDL_TRUE;
- } else {
- SDL_joystick_allows_background_events = SDL_FALSE;
- }
-}
-
-int
-SDL_JoystickInit(void)
-{
- int status;
-
- /* See if we should allow joystick events while in the background */
- SDL_AddHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
- SDL_JoystickAllowBackgroundEventsChanged, NULL);
-
-#if !SDL_EVENTS_DISABLED
- if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) {
- return -1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
-
- status = SDL_SYS_JoystickInit();
- if (status >= 0) {
- status = 0;
- }
- return (status);
-}
-
-/*
- * Count the number of joysticks attached to the system
- */
-int
-SDL_NumJoysticks(void)
-{
- return SDL_SYS_NumJoysticks();
-}
-
-/*
- * Get the implementation dependent name of a joystick
- */
-const char *
-SDL_JoystickNameForIndex(int device_index)
-{
- if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
- SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
- return (NULL);
- }
- return (SDL_SYS_JoystickNameForDeviceIndex(device_index));
-}
-
-/*
- * Open a joystick for use - the index passed as an argument refers to
- * the N'th joystick on the system. This index is the value which will
- * identify this joystick in future joystick events.
- *
- * This function returns a joystick identifier, or NULL if an error occurred.
- */
-SDL_Joystick *
-SDL_JoystickOpen(int device_index)
-{
- SDL_Joystick *joystick;
- SDL_Joystick *joysticklist;
- const char *joystickname = NULL;
-
- if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
- SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
- return (NULL);
- }
-
- joysticklist = SDL_joysticks;
- /* If the joystick is already open, return it
- * it is important that we have a single joystick * for each instance id
- */
- while (joysticklist) {
- if (SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == joysticklist->instance_id) {
- joystick = joysticklist;
- ++joystick->ref_count;
- return (joystick);
- }
- joysticklist = joysticklist->next;
- }
-
- /* Create and initialize the joystick */
- joystick = (SDL_Joystick *) SDL_malloc((sizeof *joystick));
- if (joystick == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- SDL_memset(joystick, 0, (sizeof *joystick));
- if (SDL_SYS_JoystickOpen(joystick, device_index) < 0) {
- SDL_free(joystick);
- return NULL;
- }
-
- joystickname = SDL_SYS_JoystickNameForDeviceIndex(device_index);
- if (joystickname)
- joystick->name = SDL_strdup(joystickname);
- else
- joystick->name = NULL;
-
- if (joystick->naxes > 0) {
- joystick->axes = (Sint16 *) SDL_malloc
- (joystick->naxes * sizeof(Sint16));
- }
- if (joystick->nhats > 0) {
- joystick->hats = (Uint8 *) SDL_malloc
- (joystick->nhats * sizeof(Uint8));
- }
- if (joystick->nballs > 0) {
- joystick->balls = (struct balldelta *) SDL_malloc
- (joystick->nballs * sizeof(*joystick->balls));
- }
- if (joystick->nbuttons > 0) {
- joystick->buttons = (Uint8 *) SDL_malloc
- (joystick->nbuttons * sizeof(Uint8));
- }
- if (((joystick->naxes > 0) && !joystick->axes)
- || ((joystick->nhats > 0) && !joystick->hats)
- || ((joystick->nballs > 0) && !joystick->balls)
- || ((joystick->nbuttons > 0) && !joystick->buttons)) {
- SDL_OutOfMemory();
- SDL_JoystickClose(joystick);
- return NULL;
- }
- if (joystick->axes) {
- SDL_memset(joystick->axes, 0, joystick->naxes * sizeof(Sint16));
- }
- if (joystick->hats) {
- SDL_memset(joystick->hats, 0, joystick->nhats * sizeof(Uint8));
- }
- if (joystick->balls) {
- SDL_memset(joystick->balls, 0,
- joystick->nballs * sizeof(*joystick->balls));
- }
- if (joystick->buttons) {
- SDL_memset(joystick->buttons, 0, joystick->nbuttons * sizeof(Uint8));
- }
- joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
-
- /* Add joystick to list */
- ++joystick->ref_count;
- /* Link the joystick in the list */
- joystick->next = SDL_joysticks;
- SDL_joysticks = joystick;
-
- SDL_SYS_JoystickUpdate(joystick);
-
- return (joystick);
-}
-
-
-/*
- * Checks to make sure the joystick is valid.
- */
-int
-SDL_PrivateJoystickValid(SDL_Joystick * joystick)
-{
- int valid;
-
- if (joystick == NULL) {
- SDL_SetError("Joystick hasn't been opened yet");
- valid = 0;
- } else {
- valid = 1;
- }
-
- return valid;
-}
-
-/*
- * Get the number of multi-dimensional axis controls on a joystick
- */
-int
-SDL_JoystickNumAxes(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
- return (joystick->naxes);
-}
-
-/*
- * Get the number of hats on a joystick
- */
-int
-SDL_JoystickNumHats(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
- return (joystick->nhats);
-}
-
-/*
- * Get the number of trackballs on a joystick
- */
-int
-SDL_JoystickNumBalls(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
- return (joystick->nballs);
-}
-
-/*
- * Get the number of buttons on a joystick
- */
-int
-SDL_JoystickNumButtons(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
- return (joystick->nbuttons);
-}
-
-/*
- * Get the current state of an axis control on a joystick
- */
-Sint16
-SDL_JoystickGetAxis(SDL_Joystick * joystick, int axis)
-{
- Sint16 state;
-
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (0);
- }
- if (axis < joystick->naxes) {
- state = joystick->axes[axis];
- } else {
- SDL_SetError("Joystick only has %d axes", joystick->naxes);
- state = 0;
- }
- return (state);
-}
-
-/*
- * Get the current state of a hat on a joystick
- */
-Uint8
-SDL_JoystickGetHat(SDL_Joystick * joystick, int hat)
-{
- Uint8 state;
-
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (0);
- }
- if (hat < joystick->nhats) {
- state = joystick->hats[hat];
- } else {
- SDL_SetError("Joystick only has %d hats", joystick->nhats);
- state = 0;
- }
- return (state);
-}
-
-/*
- * Get the ball axis change since the last poll
- */
-int
-SDL_JoystickGetBall(SDL_Joystick * joystick, int ball, int *dx, int *dy)
-{
- int retval;
-
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
-
- retval = 0;
- if (ball < joystick->nballs) {
- if (dx) {
- *dx = joystick->balls[ball].dx;
- }
- if (dy) {
- *dy = joystick->balls[ball].dy;
- }
- joystick->balls[ball].dx = 0;
- joystick->balls[ball].dy = 0;
- } else {
- return SDL_SetError("Joystick only has %d balls", joystick->nballs);
- }
- return (retval);
-}
-
-/*
- * Get the current state of a button on a joystick
- */
-Uint8
-SDL_JoystickGetButton(SDL_Joystick * joystick, int button)
-{
- Uint8 state;
-
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (0);
- }
- if (button < joystick->nbuttons) {
- state = joystick->buttons[button];
- } else {
- SDL_SetError("Joystick only has %d buttons", joystick->nbuttons);
- state = 0;
- }
- return (state);
-}
-
-/*
- * Return if the joystick in question is currently attached to the system,
- * \return SDL_FALSE if not plugged in, SDL_TRUE if still present.
- */
-SDL_bool
-SDL_JoystickGetAttached(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return SDL_FALSE;
- }
-
- return SDL_SYS_JoystickAttached(joystick);
-}
-
-/*
- * Get the instance id for this opened joystick
- */
-SDL_JoystickID
-SDL_JoystickInstanceID(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (-1);
- }
-
- return (joystick->instance_id);
-}
-
-/*
- * Find the SDL_Joystick that owns this instance id
- */
-SDL_Joystick *
-SDL_JoystickFromInstanceID(SDL_JoystickID joyid)
-{
- SDL_Joystick *joystick = SDL_joysticks;
- while (joystick) {
- if (joystick->instance_id == joyid) {
- return joystick;
- }
- joystick = joystick->next;
- }
-
- return NULL;
-}
-
-/*
- * Get the friendly name of this joystick
- */
-const char *
-SDL_JoystickName(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (NULL);
- }
-
- return (joystick->name);
-}
-
-/*
- * Close a joystick previously opened with SDL_JoystickOpen()
- */
-void
-SDL_JoystickClose(SDL_Joystick * joystick)
-{
- SDL_Joystick *joysticklist;
- SDL_Joystick *joysticklistprev;
-
- if (!joystick) {
- return;
- }
-
- /* First decrement ref count */
- if (--joystick->ref_count > 0) {
- return;
- }
-
- if (joystick == SDL_updating_joystick) {
- return;
- }
-
- SDL_SYS_JoystickClose(joystick);
- joystick->hwdata = NULL;
-
- joysticklist = SDL_joysticks;
- joysticklistprev = NULL;
- while (joysticklist) {
- if (joystick == joysticklist) {
- if (joysticklistprev) {
- /* unlink this entry */
- joysticklistprev->next = joysticklist->next;
- } else {
- SDL_joysticks = joystick->next;
- }
- break;
- }
- joysticklistprev = joysticklist;
- joysticklist = joysticklist->next;
- }
-
- SDL_free(joystick->name);
-
- /* Free the data associated with this joystick */
- SDL_free(joystick->axes);
- SDL_free(joystick->hats);
- SDL_free(joystick->balls);
- SDL_free(joystick->buttons);
- SDL_free(joystick);
-}
-
-void
-SDL_JoystickQuit(void)
-{
- /* Make sure we're not getting called in the middle of updating joysticks */
- SDL_assert(!SDL_updating_joystick);
-
- /* Stop the event polling */
- while (SDL_joysticks) {
- SDL_joysticks->ref_count = 1;
- SDL_JoystickClose(SDL_joysticks);
- }
-
- /* Quit the joystick setup */
- SDL_SYS_JoystickQuit();
-
-#if !SDL_EVENTS_DISABLED
- SDL_QuitSubSystem(SDL_INIT_EVENTS);
-#endif
-}
-
-
-static SDL_bool
-SDL_PrivateJoystickShouldIgnoreEvent()
-{
- if (SDL_joystick_allows_background_events) {
- return SDL_FALSE;
- }
-
- if (SDL_WasInit(SDL_INIT_VIDEO)) {
- if (SDL_GetKeyboardFocus() == NULL) {
- /* Video is initialized and we don't have focus, ignore the event. */
- return SDL_TRUE;
- } else {
- return SDL_FALSE;
- }
- }
-
- /* Video subsystem wasn't initialized, always allow the event */
- return SDL_FALSE;
-}
-
-/* These are global for SDL_sysjoystick.c and SDL_events.c */
-
-int
-SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value)
-{
- int posted;
-
- /* Make sure we're not getting garbage or duplicate events */
- if (axis >= joystick->naxes) {
- return 0;
- }
- if (value == joystick->axes[axis]) {
- return 0;
- }
-
- /* We ignore events if we don't have keyboard focus, except for centering
- * events.
- */
- if (SDL_PrivateJoystickShouldIgnoreEvent()) {
- if ((value > 0 && value >= joystick->axes[axis]) ||
- (value < 0 && value <= joystick->axes[axis])) {
- return 0;
- }
- }
-
- /* Update internal joystick state */
- joystick->axes[axis] = value;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) {
- SDL_Event event;
- event.type = SDL_JOYAXISMOTION;
- event.jaxis.which = joystick->instance_id;
- event.jaxis.axis = axis;
- event.jaxis.value = value;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-int
-SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value)
-{
- int posted;
-
- /* Make sure we're not getting garbage or duplicate events */
- if (hat >= joystick->nhats) {
- return 0;
- }
- if (value == joystick->hats[hat]) {
- return 0;
- }
-
- /* We ignore events if we don't have keyboard focus, except for centering
- * events.
- */
- if (SDL_PrivateJoystickShouldIgnoreEvent()) {
- if (value != SDL_HAT_CENTERED) {
- return 0;
- }
- }
-
- /* Update internal joystick state */
- joystick->hats[hat] = value;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(SDL_JOYHATMOTION) == SDL_ENABLE) {
- SDL_Event event;
- event.jhat.type = SDL_JOYHATMOTION;
- event.jhat.which = joystick->instance_id;
- event.jhat.hat = hat;
- event.jhat.value = value;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-int
-SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball,
- Sint16 xrel, Sint16 yrel)
-{
- int posted;
-
- /* Make sure we're not getting garbage events */
- if (ball >= joystick->nballs) {
- return 0;
- }
-
- /* We ignore events if we don't have keyboard focus. */
- if (SDL_PrivateJoystickShouldIgnoreEvent()) {
- return 0;
- }
-
- /* Update internal mouse state */
- joystick->balls[ball].dx += xrel;
- joystick->balls[ball].dy += yrel;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(SDL_JOYBALLMOTION) == SDL_ENABLE) {
- SDL_Event event;
- event.jball.type = SDL_JOYBALLMOTION;
- event.jball.which = joystick->instance_id;
- event.jball.ball = ball;
- event.jball.xrel = xrel;
- event.jball.yrel = yrel;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-int
-SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state)
-{
- int posted;
-#if !SDL_EVENTS_DISABLED
- SDL_Event event;
-
- switch (state) {
- case SDL_PRESSED:
- event.type = SDL_JOYBUTTONDOWN;
- break;
- case SDL_RELEASED:
- event.type = SDL_JOYBUTTONUP;
- break;
- default:
- /* Invalid state -- bail */
- return (0);
- }
-#endif /* !SDL_EVENTS_DISABLED */
-
- /* Make sure we're not getting garbage or duplicate events */
- if (button >= joystick->nbuttons) {
- return 0;
- }
- if (state == joystick->buttons[button]) {
- return 0;
- }
-
- /* We ignore events if we don't have keyboard focus, except for button
- * release. */
- if (SDL_PrivateJoystickShouldIgnoreEvent()) {
- if (state == SDL_PRESSED) {
- return 0;
- }
- }
-
- /* Update internal joystick state */
- joystick->buttons[button] = state;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if (SDL_GetEventState(event.type) == SDL_ENABLE) {
- event.jbutton.which = joystick->instance_id;
- event.jbutton.button = button;
- event.jbutton.state = state;
- posted = SDL_PushEvent(&event) == 1;
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return (posted);
-}
-
-void
-SDL_JoystickUpdate(void)
-{
- SDL_Joystick *joystick;
-
- joystick = SDL_joysticks;
- while (joystick) {
- SDL_Joystick *joysticknext;
- /* save off the next pointer, the Update call may cause a joystick removed event
- * and cause our joystick pointer to be freed
- */
- joysticknext = joystick->next;
-
- SDL_updating_joystick = joystick;
-
- SDL_SYS_JoystickUpdate(joystick);
-
- if (joystick->force_recentering) {
- int i;
-
- /* Tell the app that everything is centered/unpressed... */
- for (i = 0; i < joystick->naxes; i++) {
- SDL_PrivateJoystickAxis(joystick, i, 0);
- }
-
- for (i = 0; i < joystick->nbuttons; i++) {
- SDL_PrivateJoystickButton(joystick, i, 0);
- }
-
- for (i = 0; i < joystick->nhats; i++) {
- SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED);
- }
-
- joystick->force_recentering = SDL_FALSE;
- }
-
- SDL_updating_joystick = NULL;
-
- /* If the joystick was closed while updating, free it here */
- if (joystick->ref_count <= 0) {
- SDL_JoystickClose(joystick);
- }
-
- joystick = joysticknext;
- }
-
- /* this needs to happen AFTER walking the joystick list above, so that any
- dangling hardware data from removed devices can be free'd
- */
- SDL_SYS_JoystickDetect();
-}
-
-int
-SDL_JoystickEventState(int state)
-{
-#if SDL_EVENTS_DISABLED
- return SDL_DISABLE;
-#else
- const Uint32 event_list[] = {
- SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION,
- SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP, SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED
- };
- unsigned int i;
-
- switch (state) {
- case SDL_QUERY:
- state = SDL_DISABLE;
- for (i = 0; i < SDL_arraysize(event_list); ++i) {
- state = SDL_EventState(event_list[i], SDL_QUERY);
- if (state == SDL_ENABLE) {
- break;
- }
- }
- break;
- default:
- for (i = 0; i < SDL_arraysize(event_list); ++i) {
- SDL_EventState(event_list[i], state);
- }
- break;
- }
- return (state);
-#endif /* SDL_EVENTS_DISABLED */
-}
-
-/* return the guid for this index */
-SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
-{
- if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
- SDL_JoystickGUID emptyGUID;
- SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
- SDL_zero(emptyGUID);
- return emptyGUID;
- }
- return SDL_SYS_JoystickGetDeviceGUID(device_index);
-}
-
-/* return the guid for this opened device */
-SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- SDL_JoystickGUID emptyGUID;
- SDL_zero(emptyGUID);
- return emptyGUID;
- }
- return SDL_SYS_JoystickGetGUID(joystick);
-}
-
-/* convert the guid to a printable string */
-void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID)
-{
- static const char k_rgchHexToASCII[] = "0123456789abcdef";
- int i;
-
- if ((pszGUID == NULL) || (cbGUID <= 0)) {
- return;
- }
-
- for (i = 0; i < sizeof(guid.data) && i < (cbGUID-1)/2; i++) {
- /* each input byte writes 2 ascii chars, and might write a null byte. */
- /* If we don't have room for next input byte, stop */
- unsigned char c = guid.data[i];
-
- *pszGUID++ = k_rgchHexToASCII[c >> 4];
- *pszGUID++ = k_rgchHexToASCII[c & 0x0F];
- }
- *pszGUID = '\0';
-}
-
-
-/*-----------------------------------------------------------------------------
- * Purpose: Returns the 4 bit nibble for a hex character
- * Input : c -
- * Output : unsigned char
- *-----------------------------------------------------------------------------*/
-static unsigned char nibble(char c)
-{
- if ((c >= '0') && (c <= '9')) {
- return (unsigned char)(c - '0');
- }
-
- if ((c >= 'A') && (c <= 'F')) {
- return (unsigned char)(c - 'A' + 0x0a);
- }
-
- if ((c >= 'a') && (c <= 'f')) {
- return (unsigned char)(c - 'a' + 0x0a);
- }
-
- /* received an invalid character, and no real way to return an error */
- /* AssertMsg1(false, "Q_nibble invalid hex character '%c' ", c); */
- return 0;
-}
-
-
-/* convert the string version of a joystick guid to the struct */
-SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID)
-{
- SDL_JoystickGUID guid;
- int maxoutputbytes= sizeof(guid);
- size_t len = SDL_strlen(pchGUID);
- Uint8 *p;
- size_t i;
-
- /* Make sure it's even */
- len = (len) & ~0x1;
-
- SDL_memset(&guid, 0x00, sizeof(guid));
-
- p = (Uint8 *)&guid;
- for (i = 0; (i < len) && ((p - (Uint8 *)&guid) < maxoutputbytes); i+=2, p++) {
- *p = (nibble(pchGUID[i]) << 4) | nibble(pchGUID[i+1]);
- }
-
- return guid;
-}
-
-
-/* update the power level for this joystick */
-void SDL_PrivateJoystickBatteryLevel(SDL_Joystick * joystick, SDL_JoystickPowerLevel ePowerLevel)
-{
- joystick->epowerlevel = ePowerLevel;
-}
-
-
-/* return its power level */
-SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick)
-{
- if (!SDL_PrivateJoystickValid(joystick)) {
- return (SDL_JOYSTICK_POWER_UNKNOWN);
- }
- return joystick->epowerlevel;
-}
-
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick_c.h b/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick_c.h
deleted file mode 100644
index 4a076f6d66..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/SDL_joystick_c.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* Useful functions and variables from SDL_joystick.c */
-#include "SDL_joystick.h"
-
-/* Initialization and shutdown functions */
-extern int SDL_JoystickInit(void);
-extern void SDL_JoystickQuit(void);
-
-/* Initialization and shutdown functions */
-extern int SDL_GameControllerInit(void);
-extern void SDL_GameControllerQuit(void);
-
-
-/* Internal event queueing functions */
-extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
- Uint8 axis, Sint16 value);
-extern int SDL_PrivateJoystickBall(SDL_Joystick * joystick,
- Uint8 ball, Sint16 xrel, Sint16 yrel);
-extern int SDL_PrivateJoystickHat(SDL_Joystick * joystick,
- Uint8 hat, Uint8 value);
-extern int SDL_PrivateJoystickButton(SDL_Joystick * joystick,
- Uint8 button, Uint8 state);
-extern void SDL_PrivateJoystickBatteryLevel( SDL_Joystick * joystick,
- SDL_JoystickPowerLevel ePowerLevel );
-
-/* Internal sanity checking functions */
-extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/SDL_sysjoystick.h b/3rdparty/sdl2-2.0.4/src/joystick/SDL_sysjoystick.h
deleted file mode 100644
index 1015840aff..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/SDL_sysjoystick.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-#ifndef _SDL_sysjoystick_h
-#define _SDL_sysjoystick_h
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "SDL_joystick_c.h"
-
-/* The SDL joystick structure */
-struct _SDL_Joystick
-{
- SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */
- char *name; /* Joystick name - system dependent */
-
- int naxes; /* Number of axis controls on the joystick */
- Sint16 *axes; /* Current axis states */
-
- int nhats; /* Number of hats on the joystick */
- Uint8 *hats; /* Current hat states */
-
- int nballs; /* Number of trackballs on the joystick */
- struct balldelta {
- int dx;
- int dy;
- } *balls; /* Current ball motion deltas */
-
- int nbuttons; /* Number of buttons on the joystick */
- Uint8 *buttons; /* Current button states */
-
- struct joystick_hwdata *hwdata; /* Driver dependent information */
-
- int ref_count; /* Reference count for multiple opens */
-
- SDL_bool force_recentering; /* SDL_TRUE if this device needs to have its state reset to 0 */
- SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */
- struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */
-};
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-extern int SDL_SYS_JoystickInit(void);
-
-/* Function to return the number of joystick devices plugged in right now */
-extern int SDL_SYS_NumJoysticks();
-
-/* Function to cause any queued joystick insertions to be processed */
-extern void SDL_SYS_JoystickDetect();
-
-/* Function to get the device-dependent name of a joystick */
-extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index);
-
-/* Function to get the current instance id of the joystick located at device_index */
-extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index);
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the device index.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index);
-
-/* Function to query if the joystick is currently attached
- * It returns SDL_TRUE if attached, SDL_FALSE otherwise.
- */
-extern SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick);
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-extern void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick);
-
-/* Function to close a joystick after use */
-extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick);
-
-/* Function to perform any system-specific joystick related cleanup */
-extern void SDL_SYS_JoystickQuit(void);
-
-/* Function to return the stable GUID for a plugged in device */
-extern SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID(int device_index);
-
-/* Function to return the stable GUID for a opened joystick */
-extern SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick);
-
-#if SDL_JOYSTICK_XINPUT
-/* Function returns SDL_TRUE if this device is an XInput gamepad */
-extern SDL_bool SDL_SYS_IsXInputGamepad_DeviceIndex(int device_index);
-#endif
-
-#endif /* _SDL_sysjoystick_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/android/SDL_sysjoystick_c.h b/3rdparty/sdl2-2.0.4/src/joystick/android/SDL_sysjoystick_c.h
deleted file mode 100644
index 49b494c547..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/android/SDL_sysjoystick_c.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
- */
-
-#include "../../SDL_internal.h"
-
-#ifdef SDL_JOYSTICK_ANDROID
-#include "../SDL_sysjoystick.h"
-
-extern int Android_OnPadDown(int device_id, int keycode);
-extern int Android_OnPadUp(int device_id, int keycode);
-extern int Android_OnJoy(int device_id, int axisnum, float value);
-extern int Android_OnHat(int device_id, int hat_id, int x, int y);
-extern int Android_AddJoystick(int device_id, const char *name, SDL_bool is_accelerometer, int nbuttons, int naxes, int nhats, int nballs);
-extern int Android_RemoveJoystick(int device_id);
-
-/* A linked list of available joysticks */
-typedef struct SDL_joylist_item
-{
- int device_instance;
- int device_id; /* Android's device id */
- char *name; /* "SideWinder 3D Pro" or whatever */
- SDL_JoystickGUID guid;
- SDL_bool is_accelerometer;
- SDL_Joystick *joystick;
- int nbuttons, naxes, nhats, nballs;
-
- struct SDL_joylist_item *next;
-} SDL_joylist_item;
-
-typedef SDL_joylist_item joystick_hwdata;
-
-#endif /* SDL_JOYSTICK_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/dummy/SDL_sysjoystick.c b/3rdparty/sdl2-2.0.4/src/joystick/dummy/SDL_sysjoystick.c
deleted file mode 100644
index 10fda10da2..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/dummy/SDL_sysjoystick.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
-
-/* This is the dummy implementation of the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-/* Function to scan the system for joysticks.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
- return 0;
-}
-
-int SDL_SYS_NumJoysticks()
-{
- return 0;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
- SDL_SetError("Logic error: No joysticks available");
- return (NULL);
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
- return device_index;
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the device index.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
- return SDL_SetError("Logic error: No joysticks available");
-}
-
-/* Function to determine if this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
- return SDL_TRUE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
- SDL_JoystickGUID guid;
- /* the GUID is just the first 16 chars of the name for now */
- const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
- SDL_zero( guid );
- SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
- return guid;
-}
-
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
- SDL_JoystickGUID guid;
- /* the GUID is just the first 16 chars of the name for now */
- const char *name = joystick->name;
- SDL_zero( guid );
- SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
- return guid;
-}
-
-#endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/emscripten/SDL_sysjoystick_c.h b/3rdparty/sdl2-2.0.4/src/joystick/emscripten/SDL_sysjoystick_c.h
deleted file mode 100644
index c7103c56af..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/emscripten/SDL_sysjoystick_c.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
- */
-
-#include "../../SDL_internal.h"
-
-#ifdef SDL_JOYSTICK_EMSCRIPTEN
-#include "../SDL_sysjoystick.h"
-
-
-#include
-
-/* A linked list of available joysticks */
-typedef struct SDL_joylist_item
-{
- int index;
- char *name;
- char *mapping;
- SDL_JoystickID device_instance;
- SDL_Joystick *joystick;
- int nbuttons;
- int naxes;
- double timestamp;
- double axis[64];
- double analogButton[64];
- EM_BOOL digitalButton[64];
-
- struct SDL_joylist_item *next;
-} SDL_joylist_item;
-
-typedef SDL_joylist_item joystick_hwdata;
-
-#endif /* SDL_JOYSTICK_EMSCRIPTEN */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/joystick/windows/SDL_dinputjoystick.c b/3rdparty/sdl2-2.0.4/src/joystick/windows/SDL_dinputjoystick.c
deleted file mode 100644
index f6b0cc88d4..0000000000
--- a/3rdparty/sdl2-2.0.4/src/joystick/windows/SDL_dinputjoystick.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#include "../SDL_sysjoystick.h"
-
-#if SDL_JOYSTICK_DINPUT
-
-#include "SDL_windowsjoystick_c.h"
-#include "SDL_dinputjoystick_c.h"
-#include "SDL_xinputjoystick_c.h"
-
-#ifndef DIDFT_OPTIONAL
-#define DIDFT_OPTIONAL 0x80000000
-#endif
-
-#define INPUT_QSIZE 32 /* Buffer up to 32 input messages */
-#define AXIS_MIN -32768 /* minimum value for axis coordinate */
-#define AXIS_MAX 32767 /* maximum value for axis coordinate */
-#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/100) /* 1% motion */
-
-/* external variables referenced. */
-extern HWND SDL_HelperWindow;
-
-/* local variables */
-static SDL_bool coinitialized = SDL_FALSE;
-static LPDIRECTINPUT8 dinput = NULL;
-static PRAWINPUTDEVICELIST SDL_RawDevList = NULL;
-static UINT SDL_RawDevListCount = 0;
-
-/* Taken from Wine - Thanks! */
-static DIOBJECTDATAFORMAT dfDIJoystick2[] = {
- { &GUID_XAxis, DIJOFS_X, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_YAxis, DIJOFS_Y, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_ZAxis, DIJOFS_Z, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RxAxis, DIJOFS_RX, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RyAxis, DIJOFS_RY, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RzAxis, DIJOFS_RZ, DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, DIJOFS_SLIDER(0), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, DIJOFS_SLIDER(1), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_POV, DIJOFS_POV(0), DIDFT_OPTIONAL | DIDFT_POV | DIDFT_ANYINSTANCE, 0 },
- { &GUID_POV, DIJOFS_POV(1), DIDFT_OPTIONAL | DIDFT_POV | DIDFT_ANYINSTANCE, 0 },
- { &GUID_POV, DIJOFS_POV(2), DIDFT_OPTIONAL | DIDFT_POV | DIDFT_ANYINSTANCE, 0 },
- { &GUID_POV, DIJOFS_POV(3), DIDFT_OPTIONAL | DIDFT_POV | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(0), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(1), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(2), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(3), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(4), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(5), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(6), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(7), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(8), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(9), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(10), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(11), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(12), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(13), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(14), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(15), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(16), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(17), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(18), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(19), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(20), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(21), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(22), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(23), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(24), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(25), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(26), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(27), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(28), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(29), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(30), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(31), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(32), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(33), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(34), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(35), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(36), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(37), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(38), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(39), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(40), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(41), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(42), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(43), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(44), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(45), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(46), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(47), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(48), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(49), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(50), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(51), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(52), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(53), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(54), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(55), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(56), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(57), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(58), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(59), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(60), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(61), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(62), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(63), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(64), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(65), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(66), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(67), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(68), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(69), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(70), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(71), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(72), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(73), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(74), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(75), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(76), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(77), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(78), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(79), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(80), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(81), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(82), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(83), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(84), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(85), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(86), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(87), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(88), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(89), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(90), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(91), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(92), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(93), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(94), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(95), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(96), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(97), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(98), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(99), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(100), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(101), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(102), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(103), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(104), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(105), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(106), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(107), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(108), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(109), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(110), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(111), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(112), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(113), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(114), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(115), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(116), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(117), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(118), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(119), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(120), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(121), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(122), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(123), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(124), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(125), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(126), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { NULL, DIJOFS_BUTTON(127), DIDFT_OPTIONAL | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0 },
- { &GUID_XAxis, FIELD_OFFSET(DIJOYSTATE2, lVX), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_YAxis, FIELD_OFFSET(DIJOYSTATE2, lVY), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_ZAxis, FIELD_OFFSET(DIJOYSTATE2, lVZ), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RxAxis, FIELD_OFFSET(DIJOYSTATE2, lVRx), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RyAxis, FIELD_OFFSET(DIJOYSTATE2, lVRy), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RzAxis, FIELD_OFFSET(DIJOYSTATE2, lVRz), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglVSlider[0]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglVSlider[1]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_XAxis, FIELD_OFFSET(DIJOYSTATE2, lAX), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_YAxis, FIELD_OFFSET(DIJOYSTATE2, lAY), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_ZAxis, FIELD_OFFSET(DIJOYSTATE2, lAZ), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RxAxis, FIELD_OFFSET(DIJOYSTATE2, lARx), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RyAxis, FIELD_OFFSET(DIJOYSTATE2, lARy), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RzAxis, FIELD_OFFSET(DIJOYSTATE2, lARz), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglASlider[0]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglASlider[1]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_XAxis, FIELD_OFFSET(DIJOYSTATE2, lFX), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_YAxis, FIELD_OFFSET(DIJOYSTATE2, lFY), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_ZAxis, FIELD_OFFSET(DIJOYSTATE2, lFZ), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RxAxis, FIELD_OFFSET(DIJOYSTATE2, lFRx), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RyAxis, FIELD_OFFSET(DIJOYSTATE2, lFRy), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_RzAxis, FIELD_OFFSET(DIJOYSTATE2, lFRz), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglFSlider[0]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
- { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglFSlider[1]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 },
-};
-
-const DIDATAFORMAT c_dfDIJoystick2 = {
- sizeof(DIDATAFORMAT),
- sizeof(DIOBJECTDATAFORMAT),
- DIDF_ABSAXIS,
- sizeof(DIJOYSTATE2),
- SDL_arraysize(dfDIJoystick2),
- dfDIJoystick2
-};
-
-/* Convert a DirectInput return code to a text message */
-static int
-SetDIerror(const char *function, HRESULT code)
-{
- /*
- return SDL_SetError("%s() [%s]: %s", function,
- DXGetErrorString9A(code), DXGetErrorDescription9A(code));
- */
- return SDL_SetError("%s() DirectX error 0x%8.8lx", function, code);
-}
-
-static SDL_bool
-SDL_IsXInputDevice(const GUID* pGuidProductFromDirectInput)
-{
- static GUID IID_ValveStreamingGamepad = { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
- static GUID IID_X360WiredGamepad = { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
- static GUID IID_X360WirelessGamepad = { MAKELONG(0x045E, 0x028E), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
-
- static const GUID *s_XInputProductGUID[] = {
- &IID_ValveStreamingGamepad,
- &IID_X360WiredGamepad, /* Microsoft's wired X360 controller for Windows. */
- &IID_X360WirelessGamepad /* Microsoft's wireless X360 controller for Windows. */
- };
-
- size_t iDevice;
- UINT i;
-
- if (!SDL_XINPUT_Enabled()) {
- return SDL_FALSE;
- }
-
- /* Check for well known XInput device GUIDs */
- /* This lets us skip RAWINPUT for popular devices. Also, we need to do this for the Valve Streaming Gamepad because it's virtualized and doesn't show up in the device list. */
- for (iDevice = 0; iDevice < SDL_arraysize(s_XInputProductGUID); ++iDevice) {
- if (SDL_memcmp(pGuidProductFromDirectInput, s_XInputProductGUID[iDevice], sizeof(GUID)) == 0) {
- return SDL_TRUE;
- }
- }
-
- /* Go through RAWINPUT (WinXP and later) to find HID devices. */
- /* Cache this if we end up using it. */
- if (SDL_RawDevList == NULL) {
- if ((GetRawInputDeviceList(NULL, &SDL_RawDevListCount, sizeof(RAWINPUTDEVICELIST)) == -1) || (!SDL_RawDevListCount)) {
- return SDL_FALSE; /* oh well. */
- }
-
- SDL_RawDevList = (PRAWINPUTDEVICELIST)SDL_malloc(sizeof(RAWINPUTDEVICELIST) * SDL_RawDevListCount);
- if (SDL_RawDevList == NULL) {
- SDL_OutOfMemory();
- return SDL_FALSE;
- }
-
- if (GetRawInputDeviceList(SDL_RawDevList, &SDL_RawDevListCount, sizeof(RAWINPUTDEVICELIST)) == -1) {
- SDL_free(SDL_RawDevList);
- SDL_RawDevList = NULL;
- return SDL_FALSE; /* oh well. */
- }
- }
-
- for (i = 0; i < SDL_RawDevListCount; i++) {
- RID_DEVICE_INFO rdi;
- char devName[128];
- UINT rdiSize = sizeof(rdi);
- UINT nameSize = SDL_arraysize(devName);
-
- rdi.cbSize = sizeof(rdi);
- if ((SDL_RawDevList[i].dwType == RIM_TYPEHID) &&
- (GetRawInputDeviceInfoA(SDL_RawDevList[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) &&
- (MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == ((LONG)pGuidProductFromDirectInput->Data1)) &&
- (GetRawInputDeviceInfoA(SDL_RawDevList[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) &&
- (SDL_strstr(devName, "IG_") != NULL)) {
- return SDL_TRUE;
- }
- }
-
- return SDL_FALSE;
-}
-
-int
-SDL_DINPUT_JoystickInit(void)
-{
- HRESULT result;
- HINSTANCE instance;
-
- result = WIN_CoInitialize();
- if (FAILED(result)) {
- return SetDIerror("CoInitialize", result);
- }
-
- coinitialized = SDL_TRUE;
-
- result = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
- &IID_IDirectInput8, (LPVOID)&dinput);
-
- if (FAILED(result)) {
- return SetDIerror("CoCreateInstance", result);
- }
-
- /* Because we used CoCreateInstance, we need to Initialize it, first. */
- instance = GetModuleHandle(NULL);
- if (instance == NULL) {
- return SDL_SetError("GetModuleHandle() failed with error code %lu.", GetLastError());
- }
- result = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
-
- if (FAILED(result)) {
- return SetDIerror("IDirectInput::Initialize", result);
- }
- return 0;
-}
-
-/* helper function for direct input, gets called for each connected joystick */
-static BOOL CALLBACK
-EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
-{
- JoyStick_DeviceData *pNewJoystick;
- JoyStick_DeviceData *pPrevJoystick = NULL;
- const DWORD devtype = (pdidInstance->dwDevType & 0xFF);
-
- if (devtype == DI8DEVTYPE_SUPPLEMENTAL) {
- return DIENUM_CONTINUE; /* Ignore touchpads, etc. */
- }
-
- if (SDL_IsXInputDevice(&pdidInstance->guidProduct)) {
- return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */
- }
-
- pNewJoystick = *(JoyStick_DeviceData **)pContext;
- while (pNewJoystick) {
- if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {
- /* if we are replacing the front of the list then update it */
- if (pNewJoystick == *(JoyStick_DeviceData **)pContext) {
- *(JoyStick_DeviceData **)pContext = pNewJoystick->pNext;
- } else if (pPrevJoystick) {
- pPrevJoystick->pNext = pNewJoystick->pNext;
- }
-
- pNewJoystick->pNext = SYS_Joystick;
- SYS_Joystick = pNewJoystick;
-
- return DIENUM_CONTINUE; /* already have this joystick loaded, just keep going */
- }
-
- pPrevJoystick = pNewJoystick;
- pNewJoystick = pNewJoystick->pNext;
- }
-
- pNewJoystick = (JoyStick_DeviceData *)SDL_malloc(sizeof(JoyStick_DeviceData));
- if (!pNewJoystick) {
- return DIENUM_CONTINUE; /* better luck next time? */
- }
-
- SDL_zerop(pNewJoystick);
- pNewJoystick->joystickname = WIN_StringToUTF8(pdidInstance->tszProductName);
- if (!pNewJoystick->joystickname) {
- SDL_free(pNewJoystick);
- return DIENUM_CONTINUE; /* better luck next time? */
- }
-
- SDL_memcpy(&(pNewJoystick->dxdevice), pdidInstance,
- sizeof(DIDEVICEINSTANCE));
-
- SDL_memcpy(&pNewJoystick->guid, &pdidInstance->guidProduct, sizeof(pNewJoystick->guid));
- SDL_SYS_AddJoystickDevice(pNewJoystick);
-
- return DIENUM_CONTINUE; /* get next device, please */
-}
-
-void
-SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
-{
- IDirectInput8_EnumDevices(dinput, DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback, pContext, DIEDFL_ATTACHEDONLY);
-
- if (SDL_RawDevList) {
- SDL_free(SDL_RawDevList); /* in case we used this in DirectInput detection */
- SDL_RawDevList = NULL;
- }
- SDL_RawDevListCount = 0;
-}
-
-static BOOL CALLBACK
-EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef)
-{
- SDL_Joystick *joystick = (SDL_Joystick *)pvRef;
- HRESULT result;
- input_t *in = &joystick->hwdata->Inputs[joystick->hwdata->NumInputs];
-
- if (dev->dwType & DIDFT_BUTTON) {
- in->type = BUTTON;
- in->num = joystick->nbuttons;
- in->ofs = DIJOFS_BUTTON(in->num);
- joystick->nbuttons++;
- } else if (dev->dwType & DIDFT_POV) {
- in->type = HAT;
- in->num = joystick->nhats;
- in->ofs = DIJOFS_POV(in->num);
- joystick->nhats++;
- } else if (dev->dwType & DIDFT_AXIS) {
- DIPROPRANGE diprg;
- DIPROPDWORD dilong;
-
- in->type = AXIS;
- in->num = joystick->naxes;
- if (!SDL_memcmp(&dev->guidType, &GUID_XAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_X;
- else if (!SDL_memcmp(&dev->guidType, &GUID_YAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_Y;
- else if (!SDL_memcmp(&dev->guidType, &GUID_ZAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_Z;
- else if (!SDL_memcmp(&dev->guidType, &GUID_RxAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_RX;
- else if (!SDL_memcmp(&dev->guidType, &GUID_RyAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_RY;
- else if (!SDL_memcmp(&dev->guidType, &GUID_RzAxis, sizeof(dev->guidType)))
- in->ofs = DIJOFS_RZ;
- else if (!SDL_memcmp(&dev->guidType, &GUID_Slider, sizeof(dev->guidType))) {
- in->ofs = DIJOFS_SLIDER(joystick->hwdata->NumSliders);
- ++joystick->hwdata->NumSliders;
- } else {
- return DIENUM_CONTINUE; /* not an axis we can grok */
- }
-
- diprg.diph.dwSize = sizeof(diprg);
- diprg.diph.dwHeaderSize = sizeof(diprg.diph);
- diprg.diph.dwObj = dev->dwType;
- diprg.diph.dwHow = DIPH_BYID;
- diprg.lMin = AXIS_MIN;
- diprg.lMax = AXIS_MAX;
-
- result =
- IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
- DIPROP_RANGE, &diprg.diph);
- if (FAILED(result)) {
- return DIENUM_CONTINUE; /* don't use this axis */
- }
-
- /* Set dead zone to 0. */
- dilong.diph.dwSize = sizeof(dilong);
- dilong.diph.dwHeaderSize = sizeof(dilong.diph);
- dilong.diph.dwObj = dev->dwType;
- dilong.diph.dwHow = DIPH_BYID;
- dilong.dwData = 0;
- result =
- IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
- DIPROP_DEADZONE, &dilong.diph);
- if (FAILED(result)) {
- return DIENUM_CONTINUE; /* don't use this axis */
- }
-
- joystick->naxes++;
- } else {
- /* not supported at this time */
- return DIENUM_CONTINUE;
- }
-
- joystick->hwdata->NumInputs++;
-
- if (joystick->hwdata->NumInputs == MAX_INPUTS) {
- return DIENUM_STOP; /* too many */
- }
-
- return DIENUM_CONTINUE;
-}
-
-/* Sort using the data offset into the DInput struct.
- * This gives a reasonable ordering for the inputs.
- */
-static int
-SortDevFunc(const void *a, const void *b)
-{
- const input_t *inputA = (const input_t*)a;
- const input_t *inputB = (const input_t*)b;
-
- if (inputA->ofs < inputB->ofs)
- return -1;
- if (inputA->ofs > inputB->ofs)
- return 1;
- return 0;
-}
-
-/* Sort the input objects and recalculate the indices for each input. */
-static void
-SortDevObjects(SDL_Joystick *joystick)
-{
- input_t *inputs = joystick->hwdata->Inputs;
- int nButtons = 0;
- int nHats = 0;
- int nAxis = 0;
- int n;
-
- SDL_qsort(inputs, joystick->hwdata->NumInputs, sizeof(input_t), SortDevFunc);
-
- for (n = 0; n < joystick->hwdata->NumInputs; n++) {
- switch (inputs[n].type) {
- case BUTTON:
- inputs[n].num = nButtons;
- nButtons++;
- break;
-
- case HAT:
- inputs[n].num = nHats;
- nHats++;
- break;
-
- case AXIS:
- inputs[n].num = nAxis;
- nAxis++;
- break;
- }
- }
-}
-
-int
-SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice)
-{
- HRESULT result;
- LPDIRECTINPUTDEVICE8 device;
- DIPROPDWORD dipdw;
-
- joystick->hwdata->buffered = SDL_TRUE;
- joystick->hwdata->Capabilities.dwSize = sizeof(DIDEVCAPS);
-
- SDL_zero(dipdw);
- dipdw.diph.dwSize = sizeof(DIPROPDWORD);
- dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
-
- result =
- IDirectInput8_CreateDevice(dinput,
- &(joystickdevice->dxdevice.guidInstance), &device, NULL);
- if (FAILED(result)) {
- return SetDIerror("IDirectInput::CreateDevice", result);
- }
-
- /* Now get the IDirectInputDevice8 interface, instead. */
- result = IDirectInputDevice8_QueryInterface(device,
- &IID_IDirectInputDevice8,
- (LPVOID *)& joystick->
- hwdata->InputDevice);
- /* We are done with this object. Use the stored one from now on. */
- IDirectInputDevice8_Release(device);
-
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::QueryInterface", result);
- }
-
- /* Acquire shared access. Exclusive access is required for forces,
- * though. */
- result =
- IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata->
- InputDevice, SDL_HelperWindow,
- DISCL_EXCLUSIVE |
- DISCL_BACKGROUND);
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
- }
-
- /* Use the extended data structure: DIJOYSTATE2. */
- result =
- IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice,
- &c_dfDIJoystick2);
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::SetDataFormat", result);
- }
-
- /* Get device capabilities */
- result =
- IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice,
- &joystick->hwdata->Capabilities);
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::GetCapabilities", result);
- }
-
- /* Force capable? */
- if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
-
- result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::Acquire", result);
- }
-
- /* reset all actuators. */
- result =
- IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata->
- InputDevice,
- DISFFC_RESET);
-
- /* Not necessarily supported, ignore if not supported.
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand", result);
- }
- */
-
- result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
-
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::Unacquire", result);
- }
-
- /* Turn on auto-centering for a ForceFeedback device (until told
- * otherwise). */
- dipdw.diph.dwObj = 0;
- dipdw.diph.dwHow = DIPH_DEVICE;
- dipdw.dwData = DIPROPAUTOCENTER_ON;
-
- result =
- IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
- DIPROP_AUTOCENTER, &dipdw.diph);
-
- /* Not necessarily supported, ignore if not supported.
- if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::SetProperty", result);
- }
- */
- }
-
- /* What buttons and axes does it have? */
- IDirectInputDevice8_EnumObjects(joystick->hwdata->InputDevice,
- EnumDevObjectsCallback, joystick,
- DIDFT_BUTTON | DIDFT_AXIS | DIDFT_POV);
-
- /* Reorder the input objects. Some devices do not report the X axis as
- * the first axis, for example. */
- SortDevObjects(joystick);
-
- dipdw.diph.dwObj = 0;
- dipdw.diph.dwHow = DIPH_DEVICE;
- dipdw.dwData = INPUT_QSIZE;
-
- /* Set the buffer size */
- result =
- IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
- DIPROP_BUFFERSIZE, &dipdw.diph);
-
- if (result == DI_POLLEDDEVICE) {
- /* This device doesn't support buffering, so we're forced
- * to use less reliable polling. */
- joystick->hwdata->buffered = SDL_FALSE;
- } else if (FAILED(result)) {
- return SetDIerror("IDirectInputDevice8::SetProperty", result);
- }
- return 0;
-}
-
-static Uint8
-TranslatePOV(DWORD value)
-{
- const int HAT_VALS[] = {
- SDL_HAT_UP,
- SDL_HAT_UP | SDL_HAT_RIGHT,
- SDL_HAT_RIGHT,
- SDL_HAT_DOWN | SDL_HAT_RIGHT,
- SDL_HAT_DOWN,
- SDL_HAT_DOWN | SDL_HAT_LEFT,
- SDL_HAT_LEFT,
- SDL_HAT_UP | SDL_HAT_LEFT
- };
-
- if (LOWORD(value) == 0xFFFF)
- return SDL_HAT_CENTERED;
-
- /* Round the value up: */
- value += 4500 / 2;
- value %= 36000;
- value /= 4500;
-
- if (value >= 8)
- return SDL_HAT_CENTERED; /* shouldn't happen */
-
- return HAT_VALS[value];
-}
-
-static void
-UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick)
-{
- int i;
- HRESULT result;
- DWORD numevents;
- DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
-
- numevents = INPUT_QSIZE;
- result =
- IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice,
- sizeof(DIDEVICEOBJECTDATA), evtbuf,
- &numevents, 0);
- if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
- IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
- result =
- IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice,
- sizeof(DIDEVICEOBJECTDATA),
- evtbuf, &numevents, 0);
- }
-
- /* Handle the events or punt */
- if (FAILED(result)) {
- joystick->hwdata->send_remove_event = SDL_TRUE;
- joystick->hwdata->removed = SDL_TRUE;
- return;
- }
-
- for (i = 0; i < (int)numevents; ++i) {
- int j;
-
- for (j = 0; j < joystick->hwdata->NumInputs; ++j) {
- const input_t *in = &joystick->hwdata->Inputs[j];
-
- if (evtbuf[i].dwOfs != in->ofs)
- continue;
-
- switch (in->type) {
- case AXIS:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)evtbuf[i].dwData);
- break;
- case BUTTON:
- SDL_PrivateJoystickButton(joystick, in->num,
- (Uint8)(evtbuf[i].dwData ? SDL_PRESSED : SDL_RELEASED));
- break;
- case HAT:
- {
- Uint8 pos = TranslatePOV(evtbuf[i].dwData);
- SDL_PrivateJoystickHat(joystick, in->num, pos);
- }
- break;
- }
- }
- }
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-static void
-UpdateDINPUTJoystickState_Polled(SDL_Joystick * joystick)
-{
- DIJOYSTATE2 state;
- HRESULT result;
- int i;
-
- result =
- IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice,
- sizeof(DIJOYSTATE2), &state);
- if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
- IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
- result =
- IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice,
- sizeof(DIJOYSTATE2), &state);
- }
-
- if (result != DI_OK) {
- joystick->hwdata->send_remove_event = SDL_TRUE;
- joystick->hwdata->removed = SDL_TRUE;
- return;
- }
-
- /* Set each known axis, button and POV. */
- for (i = 0; i < joystick->hwdata->NumInputs; ++i) {
- const input_t *in = &joystick->hwdata->Inputs[i];
-
- switch (in->type) {
- case AXIS:
- switch (in->ofs) {
- case DIJOFS_X:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lX);
- break;
- case DIJOFS_Y:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lY);
- break;
- case DIJOFS_Z:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lZ);
- break;
- case DIJOFS_RX:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lRx);
- break;
- case DIJOFS_RY:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lRy);
- break;
- case DIJOFS_RZ:
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.lRz);
- break;
- case DIJOFS_SLIDER(0):
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.rglSlider[0]);
- break;
- case DIJOFS_SLIDER(1):
- SDL_PrivateJoystickAxis(joystick, in->num, (Sint16)state.rglSlider[1]);
- break;
- }
- break;
-
- case BUTTON:
- SDL_PrivateJoystickButton(joystick, in->num,
- (Uint8)(state.rgbButtons[in->ofs - DIJOFS_BUTTON0] ? SDL_PRESSED : SDL_RELEASED));
- break;
- case HAT:
- {
- Uint8 pos = TranslatePOV(state.rgdwPOV[in->ofs - DIJOFS_POV(0)]);
- SDL_PrivateJoystickHat(joystick, in->num, pos);
- break;
- }
- }
- }
-}
-
-void
-SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick)
-{
- HRESULT result;
-
- result = IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
- if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
- IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
- IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
- }
-
- if (joystick->hwdata->buffered) {
- UpdateDINPUTJoystickState_Buffered(joystick);
- } else {
- UpdateDINPUTJoystickState_Polled(joystick);
- }
-}
-
-void
-SDL_DINPUT_JoystickClose(SDL_Joystick * joystick)
-{
- IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
- IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
-}
-
-void
-SDL_DINPUT_JoystickQuit(void)
-{
- if (dinput != NULL) {
- IDirectInput8_Release(dinput);
- dinput = NULL;
- }
-
- if (coinitialized) {
- WIN_CoUninitialize();
- coinitialized = SDL_FALSE;
- }
-}
-
-#else /* !SDL_JOYSTICK_DINPUT */
-
-typedef struct JoyStick_DeviceData JoyStick_DeviceData;
-
-int
-SDL_DINPUT_JoystickInit(void)
-{
- return 0;
-}
-
-void
-SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
-{
-}
-
-int
-SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice)
-{
- return SDL_Unsupported();
-}
-
-void
-SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick)
-{
-}
-
-void
-SDL_DINPUT_JoystickClose(SDL_Joystick * joystick)
-{
-}
-
-void
-SDL_DINPUT_JoystickQuit(void)
-{
-}
-
-#endif /* SDL_JOYSTICK_DINPUT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/libm/e_log.c b/3rdparty/sdl2-2.0.4/src/libm/e_log.c
deleted file mode 100644
index da64138cd1..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/e_log.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* @(#)e_log.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
- "$NetBSD: e_log.c,v 1.8 1995/05/10 20:45:49 jtc Exp $";
-#endif
-
-/* __ieee754_log(x)
- * Return the logrithm of x
- *
- * Method :
- * 1. Argument Reduction: find k and f such that
- * x = 2^k * (1+f),
- * where sqrt(2)/2 < 1+f < sqrt(2) .
- *
- * 2. Approximation of log(1+f).
- * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
- * = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
- * We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
- * of this polynomial approximation is bounded by 2**-58.45. In
- * other words,
- * 2 4 6 8 10 12 14
- * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s
- * (the values of Lg1 to Lg7 are listed in the program)
- * and
- * | 2 14 | -58.45
- * | Lg1*s +...+Lg7*s - R(z) | <= 2
- * | |
- * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
- * In order to guarantee error in log below 1ulp, we compute log
- * by
- * log(1+f) = f - s*(f - R) (if f is not too large)
- * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy)
- *
- * 3. Finally, log(x) = k*ln2 + log(1+f).
- * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
- * Here ln2 is split into two floating point number:
- * ln2_hi + ln2_lo,
- * where n*ln2_hi is always exact for |n| < 2000.
- *
- * Special cases:
- * log(x) is NaN with signal if x < 0 (including -INF) ;
- * log(+INF) is +INF; log(0) is -INF with signal;
- * log(NaN) is that NaN with no signal.
- *
- * Accuracy:
- * according to an error analysis, the error is always less than
- * 1 ulp (unit in the last place).
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
- ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
- ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
- two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
- Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
- Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
- Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
- Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
- Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
- Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
- Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
-
-#ifdef __STDC__
-static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-
-#ifdef __STDC__
-double attribute_hidden
-__ieee754_log(double x)
-#else
-double attribute_hidden
-__ieee754_log(x)
- double x;
-#endif
-{
- double hfsq, f, s, z, R, w, t1, t2, dk;
- int32_t k, hx, i, j;
- u_int32_t lx;
-
- EXTRACT_WORDS(hx, lx, x);
-
- k = 0;
- if (hx < 0x00100000) { /* x < 2**-1022 */
- if (((hx & 0x7fffffff) | lx) == 0)
- return -two54 / zero; /* log(+-0)=-inf */
- if (hx < 0)
- return (x - x) / zero; /* log(-#) = NaN */
- k -= 54;
- x *= two54; /* subnormal number, scale up x */
- GET_HIGH_WORD(hx, x);
- }
- if (hx >= 0x7ff00000)
- return x + x;
- k += (hx >> 20) - 1023;
- hx &= 0x000fffff;
- i = (hx + 0x95f64) & 0x100000;
- SET_HIGH_WORD(x, hx | (i ^ 0x3ff00000)); /* normalize x or x/2 */
- k += (i >> 20);
- f = x - 1.0;
- if ((0x000fffff & (2 + hx)) < 3) { /* |f| < 2**-20 */
- if (f == zero) {
- if (k == 0)
- return zero;
- else {
- dk = (double) k;
- return dk * ln2_hi + dk * ln2_lo;
- }
- }
- R = f * f * (0.5 - 0.33333333333333333 * f);
- if (k == 0)
- return f - R;
- else {
- dk = (double) k;
- return dk * ln2_hi - ((R - dk * ln2_lo) - f);
- }
- }
- s = f / (2.0 + f);
- dk = (double) k;
- z = s * s;
- i = hx - 0x6147a;
- w = z * z;
- j = 0x6b851 - hx;
- t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
- t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
- i |= j;
- R = t2 + t1;
- if (i > 0) {
- hfsq = 0.5 * f * f;
- if (k == 0)
- return f - (hfsq - s * (hfsq + R));
- else
- return dk * ln2_hi - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) -
- f);
- } else {
- if (k == 0)
- return f - s * (f - R);
- else
- return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f);
- }
-}
diff --git a/3rdparty/sdl2-2.0.4/src/libm/e_pow.c b/3rdparty/sdl2-2.0.4/src/libm/e_pow.c
deleted file mode 100644
index 686da2e556..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/e_pow.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/* @(#)e_pow.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_pow.c,v 1.9 1995/05/12 04:57:32 jtc Exp $";
-#endif
-
-/* __ieee754_pow(x,y) return x**y
- *
- * n
- * Method: Let x = 2 * (1+f)
- * 1. Compute and return log2(x) in two pieces:
- * log2(x) = w1 + w2,
- * where w1 has 53-24 = 29 bit trailing zeros.
- * 2. Perform y*log2(x) = n+y' by simulating muti-precision
- * arithmetic, where |y'|<=0.5.
- * 3. Return x**y = 2**n*exp(y'*log2)
- *
- * Special cases:
- * 1. (anything) ** 0 is 1
- * 2. (anything) ** 1 is itself
- * 3. (anything) ** NAN is NAN
- * 4. NAN ** (anything except 0) is NAN
- * 5. +-(|x| > 1) ** +INF is +INF
- * 6. +-(|x| > 1) ** -INF is +0
- * 7. +-(|x| < 1) ** +INF is +0
- * 8. +-(|x| < 1) ** -INF is +INF
- * 9. +-1 ** +-INF is NAN
- * 10. +0 ** (+anything except 0, NAN) is +0
- * 11. -0 ** (+anything except 0, NAN, odd integer) is +0
- * 12. +0 ** (-anything except 0, NAN) is +INF
- * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF
- * 14. -0 ** (odd integer) = -( +0 ** (odd integer) )
- * 15. +INF ** (+anything except 0,NAN) is +INF
- * 16. +INF ** (-anything except 0,NAN) is +0
- * 17. -INF ** (anything) = -0 ** (-anything)
- * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
- * 19. (-anything except 0 and inf) ** (non-integer) is NAN
- *
- * Accuracy:
- * pow(x,y) returns x**y nearly rounded. In particular
- * pow(integer,integer)
- * always returns the correct integer provided it is
- * representable.
- *
- * Constants :
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(scalbn)
- libm_hidden_proto(fabs)
-#ifdef __STDC__
- static const double
-#else
- static double
-#endif
- bp[] = { 1.0, 1.5, }, dp_h[] = {
- 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
-
- dp_l[] = {
- 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
-
- zero = 0.0, one = 1.0, two = 2.0, two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
- huge_val = 1.0e300, tiny = 1.0e-300,
- /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
- L1 = 5.99999999999994648725e-01, /* 0x3FE33333, 0x33333303 */
- L2 = 4.28571428578550184252e-01, /* 0x3FDB6DB6, 0xDB6FABFF */
- L3 = 3.33333329818377432918e-01, /* 0x3FD55555, 0x518F264D */
- L4 = 2.72728123808534006489e-01, /* 0x3FD17460, 0xA91D4101 */
- L5 = 2.30660745775561754067e-01, /* 0x3FCD864A, 0x93C9DB65 */
- L6 = 2.06975017800338417784e-01, /* 0x3FCA7E28, 0x4A454EEF */
- P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
- P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
- P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
- P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
- P5 = 4.13813679705723846039e-08, /* 0x3E663769, 0x72BEA4D0 */
- lg2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */
- lg2_h = 6.93147182464599609375e-01, /* 0x3FE62E43, 0x00000000 */
- lg2_l = -1.90465429995776804525e-09, /* 0xBE205C61, 0x0CA86C39 */
- ovt = 8.0085662595372944372e-0017, /* -(1024-log2(ovfl+.5ulp)) */
- cp = 9.61796693925975554329e-01, /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */
- cp_h = 9.61796700954437255859e-01, /* 0x3FEEC709, 0xE0000000 =(float)cp */
- cp_l = -7.02846165095275826516e-09, /* 0xBE3E2FE0, 0x145B01F5 =tail of cp_h */
- ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */
- ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2 */
- ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail */
-
-#ifdef __STDC__
- double attribute_hidden __ieee754_pow(double x, double y)
-#else
- double attribute_hidden __ieee754_pow(x, y)
- double x, y;
-#endif
- {
- double z, ax, z_h, z_l, p_h, p_l;
- double y1, t1, t2, r, s, t, u, v, w;
- int32_t i, j, k, yisint, n;
- int32_t hx, hy, ix, iy;
- u_int32_t lx, ly;
-
- EXTRACT_WORDS(hx, lx, x);
- EXTRACT_WORDS(hy, ly, y);
- ix = hx & 0x7fffffff;
- iy = hy & 0x7fffffff;
-
- /* y==zero: x**0 = 1 */
- if ((iy | ly) == 0)
- return one;
-
- /* +-NaN return x+y */
- if (ix > 0x7ff00000 || ((ix == 0x7ff00000) && (lx != 0)) ||
- iy > 0x7ff00000 || ((iy == 0x7ff00000) && (ly != 0)))
- return x + y;
-
- /* determine if y is an odd int when x < 0
- * yisint = 0 ... y is not an integer
- * yisint = 1 ... y is an odd int
- * yisint = 2 ... y is an even int
- */
- yisint = 0;
- if (hx < 0) {
- if (iy >= 0x43400000)
- yisint = 2; /* even integer y */
- else if (iy >= 0x3ff00000) {
- k = (iy >> 20) - 0x3ff; /* exponent */
- if (k > 20) {
- j = ly >> (52 - k);
- if ((j << (52 - k)) == ly)
- yisint = 2 - (j & 1);
- } else if (ly == 0) {
- j = iy >> (20 - k);
- if ((j << (20 - k)) == iy)
- yisint = 2 - (j & 1);
- }
- }
- }
-
- /* special value of y */
- if (ly == 0) {
- if (iy == 0x7ff00000) { /* y is +-inf */
- if (((ix - 0x3ff00000) | lx) == 0)
- return y - y; /* inf**+-1 is NaN */
- else if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */
- return (hy >= 0) ? y : zero;
- else /* (|x|<1)**-,+inf = inf,0 */
- return (hy < 0) ? -y : zero;
- }
- if (iy == 0x3ff00000) { /* y is +-1 */
- if (hy < 0)
- return one / x;
- else
- return x;
- }
- if (hy == 0x40000000)
- return x * x; /* y is 2 */
- if (hy == 0x3fe00000) { /* y is 0.5 */
- if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrt(x);
- }
- }
-
- ax = fabs(x);
- /* special value of x */
- if (lx == 0) {
- if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) {
- z = ax; /* x is +-0,+-inf,+-1 */
- if (hy < 0)
- z = one / z; /* z = (1/|x|) */
- if (hx < 0) {
- if (((ix - 0x3ff00000) | yisint) == 0) {
- z = (z - z) / (z - z); /* (-1)**non-int is NaN */
- } else if (yisint == 1)
- z = -z; /* (x<0)**odd = -(|x|**odd) */
- }
- return z;
- }
- }
-
- /* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
- return (x - x) / (x - x);
-
- /* |y| is huge */
- if (iy > 0x41e00000) { /* if |y| > 2**31 */
- if (iy > 0x43f00000) { /* if |y| > 2**64, must o/uflow */
- if (ix <= 0x3fefffff)
- return (hy < 0) ? huge_val * huge_val : tiny * tiny;
- if (ix >= 0x3ff00000)
- return (hy > 0) ? huge_val * huge_val : tiny * tiny;
- }
- /* over/underflow if x is not close to one */
- if (ix < 0x3fefffff)
- return (hy < 0) ? huge_val * huge_val : tiny * tiny;
- if (ix > 0x3ff00000)
- return (hy > 0) ? huge_val * huge_val : tiny * tiny;
- /* now |1-x| is tiny <= 2**-20, suffice to compute
- log(x) by x-x^2/2+x^3/3-x^4/4 */
- t = x - 1; /* t has 20 trailing zeros */
- w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
- u = ivln2_h * t; /* ivln2_h has 21 sig. bits */
- v = t * ivln2_l - w * ivln2;
- t1 = u + v;
- SET_LOW_WORD(t1, 0);
- t2 = v - (t1 - u);
- } else {
- double s2, s_h, s_l, t_h, t_l;
- n = 0;
- /* take care subnormal number */
- if (ix < 0x00100000) {
- ax *= two53;
- n -= 53;
- GET_HIGH_WORD(ix, ax);
- }
- n += ((ix) >> 20) - 0x3ff;
- j = ix & 0x000fffff;
- /* determine interval */
- ix = j | 0x3ff00000; /* normalize ix */
- if (j <= 0x3988E)
- k = 0; /* |x|> 1) | 0x20000000) + 0x00080000 + (k << 18));
- t_l = ax - (t_h - bp[k]);
- s_l = v * ((u - s_h * t_h) - s_h * t_l);
- /* compute log(ax) */
- s2 = s * s;
- r = s2 * s2 * (L1 +
- s2 * (L2 +
- s2 * (L3 +
- s2 * (L4 + s2 * (L5 + s2 * L6)))));
- r += s_l * (s_h + s);
- s2 = s_h * s_h;
- t_h = 3.0 + s2 + r;
- SET_LOW_WORD(t_h, 0);
- t_l = r - ((t_h - 3.0) - s2);
- /* u+v = s*(1+...) */
- u = s_h * t_h;
- v = s_l * t_h + t_l * s;
- /* 2/(3log2)*(s+...) */
- p_h = u + v;
- SET_LOW_WORD(p_h, 0);
- p_l = v - (p_h - u);
- z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */
- z_l = cp_l * p_h + p_l * cp + dp_l[k];
- /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (double) n;
- t1 = (((z_h + z_l) + dp_h[k]) + t);
- SET_LOW_WORD(t1, 0);
- t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
- }
-
- s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
- s = -one; /* (-ve)**(odd int) */
-
- /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
- y1 = y;
- SET_LOW_WORD(y1, 0);
- p_l = (y - y1) * t1 + y * t2;
- p_h = y1 * t1;
- z = p_l + p_h;
- EXTRACT_WORDS(j, i, z);
- if (j >= 0x40900000) { /* z >= 1024 */
- if (((j - 0x40900000) | i) != 0) /* if z > 1024 */
- return s * huge_val * huge_val; /* overflow */
- else {
- if (p_l + ovt > z - p_h)
- return s * huge_val * huge_val; /* overflow */
- }
- } else if ((j & 0x7fffffff) >= 0x4090cc00) { /* z <= -1075 */
- if (((j - 0xc090cc00) | i) != 0) /* z < -1075 */
- return s * tiny * tiny; /* underflow */
- else {
- if (p_l <= z - p_h)
- return s * tiny * tiny; /* underflow */
- }
- }
- /*
- * compute 2**(p_h+p_l)
- */
- i = j & 0x7fffffff;
- k = (i >> 20) - 0x3ff;
- n = 0;
- if (i > 0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */
- n = j + (0x00100000 >> (k + 1));
- k = ((n & 0x7fffffff) >> 20) - 0x3ff; /* new k for n */
- t = zero;
- SET_HIGH_WORD(t, n & ~(0x000fffff >> k));
- n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
- if (j < 0)
- n = -n;
- p_h -= t;
- }
- t = p_l + p_h;
- SET_LOW_WORD(t, 0);
- u = t * lg2_h;
- v = (p_l - (t - p_h)) * lg2 + t * lg2_l;
- z = u + v;
- w = v - (z - u);
- t = z * z;
- t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
- r = (z * t1) / (t1 - two) - (w + z * w);
- z = one - (r - z);
- GET_HIGH_WORD(j, z);
- j += (n << 20);
- if ((j >> 20) <= 0)
- z = scalbn(z, n); /* subnormal output */
- else
- SET_HIGH_WORD(z, j);
- return s * z;
- }
diff --git a/3rdparty/sdl2-2.0.4/src/libm/e_rem_pio2.c b/3rdparty/sdl2-2.0.4/src/libm/e_rem_pio2.c
deleted file mode 100644
index a8ffe31421..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/e_rem_pio2.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* @(#)e_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
- "$NetBSD: e_rem_pio2.c,v 1.8 1995/05/10 20:46:02 jtc Exp $";
-#endif
-
-/* __ieee754_rem_pio2(x,y)
- *
- * return the remainder of x rem pi/2 in y[0]+y[1]
- * use __kernel_rem_pio2()
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(fabs)
-
-/*
- * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
- */
-#ifdef __STDC__
- static const int32_t two_over_pi[] = {
-#else
- static int32_t two_over_pi[] = {
-#endif
- 0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
- 0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
- 0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
- 0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,
- 0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,
- 0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,
- 0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,
- 0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,
- 0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,
- 0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,
- 0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
- };
-
-#ifdef __STDC__
-static const int32_t npio2_hw[] = {
-#else
-static int32_t npio2_hw[] = {
-#endif
- 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
- 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
- 0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A,
- 0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C,
- 0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB,
- 0x404858EB, 0x404921FB,
-};
-
-/*
- * invpio2: 53 bits of 2/pi
- * pio2_1: first 33 bit of pi/2
- * pio2_1t: pi/2 - pio2_1
- * pio2_2: second 33 bit of pi/2
- * pio2_2t: pi/2 - (pio2_1+pio2_2)
- * pio2_3: third 33 bit of pi/2
- * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3)
- */
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
- zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
- half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
- two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
- invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
- pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
- pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
- pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
- pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
- pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
- pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
-
-#ifdef __STDC__
-int32_t attribute_hidden
-__ieee754_rem_pio2(double x, double *y)
-#else
-int32_t attribute_hidden
-__ieee754_rem_pio2(x, y)
- double x, y[];
-#endif
-{
- double z = 0.0, w, t, r, fn;
- double tx[3];
- int32_t e0, i, j, nx, n, ix, hx;
- u_int32_t low;
-
- GET_HIGH_WORD(hx, x); /* high word of x */
- ix = hx & 0x7fffffff;
- if (ix <= 0x3fe921fb) { /* |x| ~<= pi/4 , no need for reduction */
- y[0] = x;
- y[1] = 0;
- return 0;
- }
- if (ix < 0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */
- if (hx > 0) {
- z = x - pio2_1;
- if (ix != 0x3ff921fb) { /* 33+53 bit pi is good enough */
- y[0] = z - pio2_1t;
- y[1] = (z - y[0]) - pio2_1t;
- } else { /* near pi/2, use 33+33+53 bit pi */
- z -= pio2_2;
- y[0] = z - pio2_2t;
- y[1] = (z - y[0]) - pio2_2t;
- }
- return 1;
- } else { /* negative x */
- z = x + pio2_1;
- if (ix != 0x3ff921fb) { /* 33+53 bit pi is good enough */
- y[0] = z + pio2_1t;
- y[1] = (z - y[0]) + pio2_1t;
- } else { /* near pi/2, use 33+33+53 bit pi */
- z += pio2_2;
- y[0] = z + pio2_2t;
- y[1] = (z - y[0]) + pio2_2t;
- }
- return -1;
- }
- }
- if (ix <= 0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */
- t = fabs(x);
- n = (int32_t) (t * invpio2 + half);
- fn = (double) n;
- r = t - fn * pio2_1;
- w = fn * pio2_1t; /* 1st round good to 85 bit */
- if (n < 32 && ix != npio2_hw[n - 1]) {
- y[0] = r - w; /* quick check no cancellation */
- } else {
- u_int32_t high;
- j = ix >> 20;
- y[0] = r - w;
- GET_HIGH_WORD(high, y[0]);
- i = j - ((high >> 20) & 0x7ff);
- if (i > 16) { /* 2nd iteration needed, good to 118 */
- t = r;
- w = fn * pio2_2;
- r = t - w;
- w = fn * pio2_2t - ((t - r) - w);
- y[0] = r - w;
- GET_HIGH_WORD(high, y[0]);
- i = j - ((high >> 20) & 0x7ff);
- if (i > 49) { /* 3rd iteration need, 151 bits acc */
- t = r; /* will cover all possible cases */
- w = fn * pio2_3;
- r = t - w;
- w = fn * pio2_3t - ((t - r) - w);
- y[0] = r - w;
- }
- }
- }
- y[1] = (r - y[0]) - w;
- if (hx < 0) {
- y[0] = -y[0];
- y[1] = -y[1];
- return -n;
- } else
- return n;
- }
- /*
- * all other (large) arguments
- */
- if (ix >= 0x7ff00000) { /* x is inf or NaN */
- y[0] = y[1] = x - x;
- return 0;
- }
- /* set z = scalbn(|x|,ilogb(x)-23) */
- GET_LOW_WORD(low, x);
- SET_LOW_WORD(z, low);
- e0 = (ix >> 20) - 1046; /* e0 = ilogb(z)-23; */
- SET_HIGH_WORD(z, ix - ((int32_t) (e0 << 20)));
- for (i = 0; i < 2; i++) {
- tx[i] = (double) ((int32_t) (z));
- z = (z - tx[i]) * two24;
- }
- tx[2] = z;
- nx = 3;
- while (tx[nx - 1] == zero)
- nx--; /* skip zero term */
- n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi);
- if (hx < 0) {
- y[0] = -y[0];
- y[1] = -y[1];
- return -n;
- }
- return n;
-}
diff --git a/3rdparty/sdl2-2.0.4/src/libm/k_rem_pio2.c b/3rdparty/sdl2-2.0.4/src/libm/k_rem_pio2.c
deleted file mode 100644
index 23c2b61dd9..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/k_rem_pio2.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/* @(#)k_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
- "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $";
-#endif
-
-/*
- * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- * double x[],y[]; int e0,nx,prec; int ipio2[];
- *
- * __kernel_rem_pio2 return the last three digits of N with
- * y = x - N*pi/2
- * so that |y| < pi/2.
- *
- * The method is to compute the integer (mod 8) and fraction parts of
- * (2/pi)*x without doing the full multiplication. In general we
- * skip the part of the product that are known to be a huge integer (
- * more accurately, = 0 mod 8 ). Thus the number of operations are
- * independent of the exponent of the input.
- *
- * (2/pi) is represented by an array of 24-bit integers in ipio2[].
- *
- * Input parameters:
- * x[] The input value (must be positive) is broken into nx
- * pieces of 24-bit integers in double precision format.
- * x[i] will be the i-th 24 bit of x. The scaled exponent
- * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0
- * match x's up to 24 bits.
- *
- * Example of breaking a double positive z into x[0]+x[1]+x[2]:
- * e0 = ilogb(z)-23
- * z = scalbn(z,-e0)
- * for i = 0,1,2
- * x[i] = floor(z)
- * z = (z-x[i])*2**24
- *
- *
- * y[] ouput result in an array of double precision numbers.
- * The dimension of y[] is:
- * 24-bit precision 1
- * 53-bit precision 2
- * 64-bit precision 2
- * 113-bit precision 3
- * The actual value is the sum of them. Thus for 113-bit
- * precison, one may have to do something like:
- *
- * long double t,w,r_head, r_tail;
- * t = (long double)y[2] + (long double)y[1];
- * w = (long double)y[0];
- * r_head = t+w;
- * r_tail = w - (r_head - t);
- *
- * e0 The exponent of x[0]
- *
- * nx dimension of x[]
- *
- * prec an integer indicating the precision:
- * 0 24 bits (single)
- * 1 53 bits (double)
- * 2 64 bits (extended)
- * 3 113 bits (quad)
- *
- * ipio2[]
- * integer array, contains the (24*i)-th to (24*i+23)-th
- * bit of 2/pi after binary point. The corresponding
- * floating value is
- *
- * ipio2[i] * 2^(-24(i+1)).
- *
- * External function:
- * double scalbn(), floor();
- *
- *
- * Here is the description of some local variables:
- *
- * jk jk+1 is the initial number of terms of ipio2[] needed
- * in the computation. The recommended value is 2,3,4,
- * 6 for single, double, extended,and quad.
- *
- * jz local integer variable indicating the number of
- * terms of ipio2[] used.
- *
- * jx nx - 1
- *
- * jv index for pointing to the suitable ipio2[] for the
- * computation. In general, we want
- * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8
- * is an integer. Thus
- * e0-3-24*jv >= 0 or (e0-3)/24 >= jv
- * Hence jv = max(0,(e0-3)/24).
- *
- * jp jp+1 is the number of terms in PIo2[] needed, jp = jk.
- *
- * q[] double array with integral value, representing the
- * 24-bits chunk of the product of x and 2/pi.
- *
- * q0 the corresponding exponent of q[0]. Note that the
- * exponent for q[i] would be q0-24*i.
- *
- * PIo2[] double precision array, obtained by cutting pi/2
- * into 24 bits chunks.
- *
- * f[] ipio2[] in floating point
- *
- * iq[] integer array by breaking up q[] in 24-bits chunk.
- *
- * fq[] final product of x*(2/pi) in fq[0],..,fq[jk]
- *
- * ih integer. If >0 it indicates q[] is >= 0.5, hence
- * it also indicates the *sign* of the result.
- *
- */
-
-
-/*
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#include "SDL_assert.h"
-
-libm_hidden_proto(scalbn)
- libm_hidden_proto(floor)
-#ifdef __STDC__
- static const int init_jk[] = { 2, 3, 4, 6 }; /* initial value for jk */
-#else
- static int init_jk[] = { 2, 3, 4, 6 };
-#endif
-
-#ifdef __STDC__
-static const double PIo2[] = {
-#else
-static double PIo2[] = {
-#endif
- 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
- 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
- 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
- 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */
- 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */
- 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */
- 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */
- 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
-};
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
- zero = 0.0, one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
- twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
-
-#ifdef __STDC__
-int attribute_hidden
-__kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec,
- const int32_t * ipio2)
-#else
-int attribute_hidden
-__kernel_rem_pio2(x, y, e0, nx, prec, ipio2)
- double x[], y[];
- int e0, nx, prec;
- int32_t ipio2[];
-#endif
-{
- int32_t jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih;
- double z, fw, f[20], fq[20], q[20];
-
- /* initialize jk */
- SDL_assert((prec >= 0) && (prec < SDL_arraysize(init_jk)));
- jk = init_jk[prec];
- SDL_assert((jk >= 2) && (jk <= 6));
- jp = jk;
-
- /* determine jx,jv,q0, note that 3>q0 */
- SDL_assert(nx > 0);
- jx = nx - 1;
- jv = (e0 - 3) / 24;
- if (jv < 0)
- jv = 0;
- q0 = e0 - 24 * (jv + 1);
-
- /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
- j = jv - jx;
- m = jx + jk;
- for (i = 0; i <= m; i++, j++)
- f[i] = (j < 0) ? zero : (double) ipio2[j];
-
- /* compute q[0],q[1],...q[jk] */
- for (i = 0; i <= jk; i++) {
- for (j = 0, fw = 0.0; j <= jx; j++)
- fw += x[j] * f[jx + i - j];
- q[i] = fw;
- }
-
- jz = jk;
- recompute:
- /* distill q[] into iq[] reversingly */
- for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--) {
- fw = (double) ((int32_t) (twon24 * z));
- iq[i] = (int32_t) (z - two24 * fw);
- z = q[j - 1] + fw;
- }
-
- /* compute n */
- z = scalbn(z, q0); /* actual value of z */
- z -= 8.0 * floor(z * 0.125); /* trim off integer >= 8 */
- n = (int32_t) z;
- z -= (double) n;
- ih = 0;
- if (q0 > 0) { /* need iq[jz-1] to determine n */
- i = (iq[jz - 1] >> (24 - q0));
- n += i;
- iq[jz - 1] -= i << (24 - q0);
- ih = iq[jz - 1] >> (23 - q0);
- } else if (q0 == 0)
- ih = iq[jz - 1] >> 23;
- else if (z >= 0.5)
- ih = 2;
-
- if (ih > 0) { /* q > 0.5 */
- n += 1;
- carry = 0;
- for (i = 0; i < jz; i++) { /* compute 1-q */
- j = iq[i];
- if (carry == 0) {
- if (j != 0) {
- carry = 1;
- iq[i] = 0x1000000 - j;
- }
- } else
- iq[i] = 0xffffff - j;
- }
- if (q0 > 0) { /* rare case: chance is 1 in 12 */
- switch (q0) {
- case 1:
- iq[jz - 1] &= 0x7fffff;
- break;
- case 2:
- iq[jz - 1] &= 0x3fffff;
- break;
- }
- }
- if (ih == 2) {
- z = one - z;
- if (carry != 0)
- z -= scalbn(one, q0);
- }
- }
-
- /* check if recomputation is needed */
- if (z == zero) {
- j = 0;
- for (i = jz - 1; i >= jk; i--)
- j |= iq[i];
- if (j == 0) { /* need recomputation */
- for (k = 1; iq[jk - k] == 0; k++); /* k = no. of terms needed */
-
- for (i = jz + 1; i <= jz + k; i++) { /* add q[jz+1] to q[jz+k] */
- f[jx + i] = (double) ipio2[jv + i];
- for (j = 0, fw = 0.0; j <= jx; j++)
- fw += x[j] * f[jx + i - j];
- q[i] = fw;
- }
- jz += k;
- goto recompute;
- }
- }
-
- /* chop off zero terms */
- if (z == 0.0) {
- jz -= 1;
- q0 -= 24;
- while (iq[jz] == 0) {
- jz--;
- q0 -= 24;
- }
- } else { /* break z into 24-bit if necessary */
- z = scalbn(z, -q0);
- if (z >= two24) {
- fw = (double) ((int32_t) (twon24 * z));
- iq[jz] = (int32_t) (z - two24 * fw);
- jz += 1;
- q0 += 24;
- iq[jz] = (int32_t) fw;
- } else
- iq[jz] = (int32_t) z;
- }
-
- /* convert integer "bit" chunk to floating-point value */
- fw = scalbn(one, q0);
- for (i = jz; i >= 0; i--) {
- q[i] = fw * (double) iq[i];
- fw *= twon24;
- }
-
- /* compute PIo2[0,...,jp]*q[jz,...,0] */
- for (i = jz; i >= 0; i--) {
- for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
- fw += PIo2[k] * q[i + k];
- fq[jz - i] = fw;
- }
-
- /* compress fq[] into y[] */
- switch (prec) {
- case 0:
- fw = 0.0;
- for (i = jz; i >= 0; i--)
- fw += fq[i];
- y[0] = (ih == 0) ? fw : -fw;
- break;
- case 1:
- case 2:
- fw = 0.0;
- for (i = jz; i >= 0; i--)
- fw += fq[i];
- y[0] = (ih == 0) ? fw : -fw;
- fw = fq[0] - fw;
- for (i = 1; i <= jz; i++)
- fw += fq[i];
- y[1] = (ih == 0) ? fw : -fw;
- break;
- case 3: /* painful */
- for (i = jz; i > 0; i--) {
- fw = fq[i - 1] + fq[i];
- fq[i] += fq[i - 1] - fw;
- fq[i - 1] = fw;
- }
- for (i = jz; i > 1; i--) {
- fw = fq[i - 1] + fq[i];
- fq[i] += fq[i - 1] - fw;
- fq[i - 1] = fw;
- }
- for (fw = 0.0, i = jz; i >= 2; i--)
- fw += fq[i];
- if (ih == 0) {
- y[0] = fq[0];
- y[1] = fq[1];
- y[2] = fw;
- } else {
- y[0] = -fq[0];
- y[1] = -fq[1];
- y[2] = -fw;
- }
- }
- return n & 7;
-}
diff --git a/3rdparty/sdl2-2.0.4/src/libm/s_floor.c b/3rdparty/sdl2-2.0.4/src/libm/s_floor.c
deleted file mode 100644
index b553d30382..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/s_floor.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* @(#)s_floor.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
- "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $";
-#endif
-
-/*
- * floor(x)
- * Return x rounded toward -inf to integral value
- * Method:
- * Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double huge_val = 1.0e300;
-#else
-static double huge_val = 1.0e300;
-#endif
-
-libm_hidden_proto(floor)
-#ifdef __STDC__
- double floor(double x)
-#else
- double floor(x)
- double x;
-#endif
-{
- int32_t i0, i1, j0;
- u_int32_t i, j;
- EXTRACT_WORDS(i0, i1, x);
- j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
- if (j0 < 20) {
- if (j0 < 0) { /* raise inexact if x != 0 */
- if (huge_val + x > 0.0) { /* return 0*sign(x) if |x|<1 */
- if (i0 >= 0) {
- i0 = i1 = 0;
- } else if (((i0 & 0x7fffffff) | i1) != 0) {
- i0 = 0xbff00000;
- i1 = 0;
- }
- }
- } else {
- i = (0x000fffff) >> j0;
- if (((i0 & i) | i1) == 0)
- return x; /* x is integral */
- if (huge_val + x > 0.0) { /* raise inexact flag */
- if (i0 < 0)
- i0 += (0x00100000) >> j0;
- i0 &= (~i);
- i1 = 0;
- }
- }
- } else if (j0 > 51) {
- if (j0 == 0x400)
- return x + x; /* inf or NaN */
- else
- return x; /* x is integral */
- } else {
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
- if ((i1 & i) == 0)
- return x; /* x is integral */
- if (huge_val + x > 0.0) { /* raise inexact flag */
- if (i0 < 0) {
- if (j0 == 20)
- i0 += 1;
- else {
- j = i1 + (1 << (52 - j0));
- if (j < (u_int32_t) i1)
- i0 += 1; /* got a carry */
- i1 = j;
- }
- }
- i1 &= (~i);
- }
- }
- INSERT_WORDS(x, i0, i1);
- return x;
-}
-
-libm_hidden_def(floor)
diff --git a/3rdparty/sdl2-2.0.4/src/libm/s_scalbn.c b/3rdparty/sdl2-2.0.4/src/libm/s_scalbn.c
deleted file mode 100644
index f824e926d7..0000000000
--- a/3rdparty/sdl2-2.0.4/src/libm/s_scalbn.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
- "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
-#endif
-
-/*
- * scalbn (double x, int n)
- * scalbn(x,n) returns x* 2**n computed by exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(copysign)
-#ifdef __STDC__
- static const double
-#else
- static double
-#endif
- two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
- twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
- huge_val = 1.0e+300, tiny = 1.0e-300;
-
-libm_hidden_proto(scalbn)
-#ifdef __STDC__
- double scalbn(double x, int n)
-#else
- double scalbn(x, n)
- double x;
- int n;
-#endif
-{
- int32_t k, hx, lx;
- EXTRACT_WORDS(hx, lx, x);
- k = (hx & 0x7ff00000) >> 20; /* extract exponent */
- if (k == 0) { /* 0 or subnormal x */
- if ((lx | (hx & 0x7fffffff)) == 0)
- return x; /* +-0 */
- x *= two54;
- GET_HIGH_WORD(hx, x);
- k = ((hx & 0x7ff00000) >> 20) - 54;
- if (n < -50000)
- return tiny * x; /* underflow */
- }
- if (k == 0x7ff)
- return x + x; /* NaN or Inf */
- k = k + n;
- if (k > 0x7fe)
- return huge_val * copysign(huge_val, x); /* overflow */
- if (k > 0) { /* normal result */
- SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20));
- return x;
- }
- if (k <= -54) {
- if (n > 50000) /* in case integer overflow in n+k */
- return huge_val * copysign(huge_val, x); /* overflow */
- else
- return tiny * copysign(tiny, x); /* underflow */
- }
- k += 54; /* subnormal result */
- SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20));
- return x * twom54;
-}
-
-libm_hidden_def(scalbn)
diff --git a/3rdparty/sdl2-2.0.4/src/loadso/haiku/SDL_sysloadso.c b/3rdparty/sdl2-2.0.4/src/loadso/haiku/SDL_sysloadso.c
deleted file mode 100644
index 1336d9e18a..0000000000
--- a/3rdparty/sdl2-2.0.4/src/loadso/haiku/SDL_sysloadso.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#ifdef SDL_LOADSO_HAIKU
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include
-#include
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
- void *handle = NULL;
- image_id library_id = load_add_on(sofile);
- if (library_id < 0) {
- SDL_SetError(strerror((int) library_id));
- } else {
- handle = (void *) (library_id);
- }
- return (handle);
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
- void *sym = NULL;
- image_id library_id = (image_id) handle;
- status_t rc =
- get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
- if (rc != B_NO_ERROR) {
- SDL_SetError(strerror(rc));
- }
- return (sym);
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
- image_id library_id;
- if (handle != NULL) {
- library_id = (image_id) handle;
- unload_add_on(library_id);
- }
-}
-
-#endif /* SDL_LOADSO_HAIKU */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/main/android/SDL_android_main.c b/3rdparty/sdl2-2.0.4/src/main/android/SDL_android_main.c
deleted file mode 100644
index 4173bcb1d1..0000000000
--- a/3rdparty/sdl2-2.0.4/src/main/android/SDL_android_main.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- SDL_android_main.c, placed in the public domain by Sam Lantinga 3/13/14
-*/
-#include "../../SDL_internal.h"
-
-#ifdef __ANDROID__
-
-/* Include the SDL main definition header */
-#include "SDL_main.h"
-
-/*******************************************************************************
- Functions called by JNI
-*******************************************************************************/
-#include
-
-/* Called before SDL_main() to initialize JNI bindings in SDL library */
-extern void SDL_Android_Init(JNIEnv* env, jclass cls);
-
-/* Start up the SDL app */
-JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject array)
-{
- int i;
- int argc;
- int status;
-
- /* This interface could expand with ABI negotiation, callbacks, etc. */
- SDL_Android_Init(env, cls);
-
- SDL_SetMainReady();
-
- /* Prepare the arguments. */
-
- int len = (*env)->GetArrayLength(env, array);
- char* argv[1 + len + 1];
- argc = 0;
- /* Use the name "app_process" so PHYSFS_platformCalcBaseDir() works.
- https://bitbucket.org/MartinFelis/love-android-sdl2/issue/23/release-build-crash-on-start
- */
- argv[argc++] = SDL_strdup("app_process");
- for (i = 0; i < len; ++i) {
- const char* utf;
- char* arg = NULL;
- jstring string = (*env)->GetObjectArrayElement(env, array, i);
- if (string) {
- utf = (*env)->GetStringUTFChars(env, string, 0);
- if (utf) {
- arg = SDL_strdup(utf);
- (*env)->ReleaseStringUTFChars(env, string, utf);
- }
- (*env)->DeleteLocalRef(env, string);
- }
- if (!arg) {
- arg = SDL_strdup("");
- }
- argv[argc++] = arg;
- }
- argv[argc] = NULL;
-
-
- /* Run the application. */
-
- status = SDL_main(argc, argv);
-
- /* Release the arguments. */
-
- for (i = 0; i < argc; ++i) {
- SDL_free(argv[i]);
- }
-
- /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
- /* exit(status); */
-
- return status;
-}
-
-#endif /* __ANDROID__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/SDL_d3dmath.c b/3rdparty/sdl2-2.0.4/src/render/SDL_d3dmath.c
deleted file mode 100644
index 83d67bfa70..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/SDL_d3dmath.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-#if (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
-#include "SDL_stdinc.h"
-
-#include "SDL_d3dmath.h"
-
-/* Direct3D matrix math functions */
-
-Float4X4 MatrixIdentity()
-{
- Float4X4 m;
- SDL_zero(m);
- m._11 = 1.0f;
- m._22 = 1.0f;
- m._33 = 1.0f;
- m._44 = 1.0f;
- return m;
-}
-
-Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2)
-{
- Float4X4 m;
- m._11 = M1._11 * M2._11 + M1._12 * M2._21 + M1._13 * M2._31 + M1._14 * M2._41;
- m._12 = M1._11 * M2._12 + M1._12 * M2._22 + M1._13 * M2._32 + M1._14 * M2._42;
- m._13 = M1._11 * M2._13 + M1._12 * M2._23 + M1._13 * M2._33 + M1._14 * M2._43;
- m._14 = M1._11 * M2._14 + M1._12 * M2._24 + M1._13 * M2._34 + M1._14 * M2._44;
- m._21 = M1._21 * M2._11 + M1._22 * M2._21 + M1._23 * M2._31 + M1._24 * M2._41;
- m._22 = M1._21 * M2._12 + M1._22 * M2._22 + M1._23 * M2._32 + M1._24 * M2._42;
- m._23 = M1._21 * M2._13 + M1._22 * M2._23 + M1._23 * M2._33 + M1._24 * M2._43;
- m._24 = M1._21 * M2._14 + M1._22 * M2._24 + M1._23 * M2._34 + M1._24 * M2._44;
- m._31 = M1._31 * M2._11 + M1._32 * M2._21 + M1._33 * M2._31 + M1._34 * M2._41;
- m._32 = M1._31 * M2._12 + M1._32 * M2._22 + M1._33 * M2._32 + M1._34 * M2._42;
- m._33 = M1._31 * M2._13 + M1._32 * M2._23 + M1._33 * M2._33 + M1._34 * M2._43;
- m._34 = M1._31 * M2._14 + M1._32 * M2._24 + M1._33 * M2._34 + M1._34 * M2._44;
- m._41 = M1._41 * M2._11 + M1._42 * M2._21 + M1._43 * M2._31 + M1._44 * M2._41;
- m._42 = M1._41 * M2._12 + M1._42 * M2._22 + M1._43 * M2._32 + M1._44 * M2._42;
- m._43 = M1._41 * M2._13 + M1._42 * M2._23 + M1._43 * M2._33 + M1._44 * M2._43;
- m._44 = M1._41 * M2._14 + M1._42 * M2._24 + M1._43 * M2._34 + M1._44 * M2._44;
- return m;
-}
-
-Float4X4 MatrixScaling(float x, float y, float z)
-{
- Float4X4 m;
- SDL_zero(m);
- m._11 = x;
- m._22 = y;
- m._33 = z;
- m._44 = 1.0f;
- return m;
-}
-
-Float4X4 MatrixTranslation(float x, float y, float z)
-{
- Float4X4 m;
- SDL_zero(m);
- m._11 = 1.0f;
- m._22 = 1.0f;
- m._33 = 1.0f;
- m._44 = 1.0f;
- m._41 = x;
- m._42 = y;
- m._43 = z;
- return m;
-}
-
-Float4X4 MatrixRotationX(float r)
-{
- float sinR = SDL_sinf(r);
- float cosR = SDL_cosf(r);
- Float4X4 m;
- SDL_zero(m);
- m._11 = 1.0f;
- m._22 = cosR;
- m._23 = sinR;
- m._32 = -sinR;
- m._33 = cosR;
- m._44 = 1.0f;
- return m;
-}
-
-Float4X4 MatrixRotationY(float r)
-{
- float sinR = SDL_sinf(r);
- float cosR = SDL_cosf(r);
- Float4X4 m;
- SDL_zero(m);
- m._11 = cosR;
- m._13 = -sinR;
- m._22 = 1.0f;
- m._31 = sinR;
- m._33 = cosR;
- m._44 = 1.0f;
- return m;
-}
-
-Float4X4 MatrixRotationZ(float r)
-{
- float sinR = SDL_sinf(r);
- float cosR = SDL_cosf(r);
- Float4X4 m;
- SDL_zero(m);
- m._11 = cosR;
- m._12 = sinR;
- m._21 = -sinR;
- m._22 = cosR;
- m._33 = 1.0f;
- m._44 = 1.0f;
- return m;
-
-}
-
-#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_mmx.c b/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_mmx.c
deleted file mode 100644
index 0de776a36e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_mmx.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-
-#include "SDL_stdinc.h"
-
-#include "mmx.h"
-
-/* *INDENT-OFF* */
-
-static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} };
-static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} };
-static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} };
-
-static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} };
-
-static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} };
-static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} };
-static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} };
-static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} };
-
-static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} };
-static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} };
-static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} };
-static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} };
-
-static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} };
-static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} };
-
-/**
- This MMX assembler is my first assembler/MMX program ever.
- Thus it maybe buggy.
- Send patches to:
- mvogt@rhrk.uni-kl.de
-
- After it worked fine I have "obfuscated" the code a bit to have
- more parallism in the MMX units. This means I moved
- initilisation around and delayed other instruction.
- Performance measurement did not show that this brought any advantage
- but in theory it _should_ be faster this way.
-
- The overall performanve gain to the C based dither was 30%-40%.
- The MMX routine calculates 256bit=8RGB values in each cycle
- (4 for row1 & 4 for row2)
-
- The red/green/blue.. coefficents are taken from the mpeg_play
- player. They look nice, but I dont know if you can have
- better values, to avoid integer rounding errors.
-
-
- IMPORTANT:
- ==========
-
- It is a requirement that the cr/cb/lum are 8 byte aligned and
- the out are 16byte aligned or you will/may get segfaults
-
-*/
-
-void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint32 *row1;
- Uint32 *row2;
-
- unsigned char* y = lum +cols*rows; /* Pointer to the end */
- int x = 0;
- row1 = (Uint32 *)out; /* 32 bit target */
- row2 = (Uint32 *)out+cols+mod; /* start of second row */
- mod = (mod+cols+mod)*4; /* increment for row1 in byte */
-
- __asm__ __volatile__ (
- /* tap dance to workaround the inability to use %%ebx at will... */
- /* move one thing to the stack... */
- "pushl $0\n" /* save a slot on the stack. */
- "pushl %%ebx\n" /* save %%ebx. */
- "movl %0, %%ebx\n" /* put the thing in ebx. */
- "movl %%ebx,4(%%esp)\n" /* put the thing in the stack slot. */
- "popl %%ebx\n" /* get back %%ebx (the PIC register). */
-
- ".align 8\n"
- "1:\n"
-
- /* create Cr (result in mm1) */
- "pushl %%ebx\n"
- "movl 4(%%esp),%%ebx\n"
- "movd (%%ebx),%%mm1\n" /* 0 0 0 0 v3 v2 v1 v0 */
- "popl %%ebx\n"
- "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */
- "movd (%2), %%mm2\n" /* 0 0 0 0 l3 l2 l1 l0 */
- "punpcklbw %%mm7,%%mm1\n" /* 0 v3 0 v2 00 v1 00 v0 */
- "punpckldq %%mm1,%%mm1\n" /* 00 v1 00 v0 00 v1 00 v0 */
- "psubw %9,%%mm1\n" /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */
-
- /* create Cr_g (result in mm0) */
- "movq %%mm1,%%mm0\n" /* r1 r1 r0 r0 r1 r1 r0 r0 */
- "pmullw %10,%%mm0\n" /* red*-46dec=0.7136*64 */
- "pmullw %11,%%mm1\n" /* red*89dec=1.4013*64 */
- "psraw $6, %%mm0\n" /* red=red/64 */
- "psraw $6, %%mm1\n" /* red=red/64 */
-
- /* create L1 L2 (result in mm2,mm4) */
- /* L2=lum+cols */
- "movq (%2,%4),%%mm3\n" /* 0 0 0 0 L3 L2 L1 L0 */
- "punpckldq %%mm3,%%mm2\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */
- "movq %%mm2,%%mm4\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */
- "pand %12,%%mm2\n" /* L3 0 L1 0 l3 0 l1 0 */
- "pand %13,%%mm4\n" /* 0 L2 0 L0 0 l2 0 l0 */
- "psrlw $8,%%mm2\n" /* 0 L3 0 L1 0 l3 0 l1 */
-
- /* create R (result in mm6) */
- "movq %%mm2,%%mm5\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm6\n" /* 0 L2 0 L0 0 l2 0 l0 */
- "paddsw %%mm1, %%mm5\n" /* lum1+red:x R3 x R1 x r3 x r1 */
- "paddsw %%mm1, %%mm6\n" /* lum1+red:x R2 x R0 x r2 x r0 */
- "packuswb %%mm5,%%mm5\n" /* R3 R1 r3 r1 R3 R1 r3 r1 */
- "packuswb %%mm6,%%mm6\n" /* R2 R0 r2 r0 R2 R0 r2 r0 */
- "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */
- "punpcklbw %%mm5,%%mm6\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */
-
- /* create Cb (result in mm1) */
- "movd (%1), %%mm1\n" /* 0 0 0 0 u3 u2 u1 u0 */
- "punpcklbw %%mm7,%%mm1\n" /* 0 u3 0 u2 00 u1 00 u0 */
- "punpckldq %%mm1,%%mm1\n" /* 00 u1 00 u0 00 u1 00 u0 */
- "psubw %9,%%mm1\n" /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */
-
- /* create Cb_g (result in mm5) */
- "movq %%mm1,%%mm5\n" /* u1 u1 u0 u0 u1 u1 u0 u0 */
- "pmullw %14,%%mm5\n" /* blue*-109dec=1.7129*64 */
- "pmullw %15,%%mm1\n" /* blue*114dec=1.78125*64 */
- "psraw $6, %%mm5\n" /* blue=red/64 */
- "psraw $6, %%mm1\n" /* blue=blue/64 */
-
- /* create G (result in mm7) */
- "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm7\n" /* 0 L2 0 L0 0 l2 0 l1 */
- "paddsw %%mm5, %%mm3\n" /* lum1+Cb_g:x G3t x G1t x g3t x g1t */
- "paddsw %%mm5, %%mm7\n" /* lum1+Cb_g:x G2t x G0t x g2t x g0t */
- "paddsw %%mm0, %%mm3\n" /* lum1+Cr_g:x G3 x G1 x g3 x g1 */
- "paddsw %%mm0, %%mm7\n" /* lum1+blue:x G2 x G0 x g2 x g0 */
- "packuswb %%mm3,%%mm3\n" /* G3 G1 g3 g1 G3 G1 g3 g1 */
- "packuswb %%mm7,%%mm7\n" /* G2 G0 g2 g0 G2 G0 g2 g0 */
- "punpcklbw %%mm3,%%mm7\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */
-
- /* create B (result in mm5) */
- "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm5\n" /* 0 L2 0 L0 0 l2 0 l1 */
- "paddsw %%mm1, %%mm3\n" /* lum1+blue:x B3 x B1 x b3 x b1 */
- "paddsw %%mm1, %%mm5\n" /* lum1+blue:x B2 x B0 x b2 x b0 */
- "packuswb %%mm3,%%mm3\n" /* B3 B1 b3 b1 B3 B1 b3 b1 */
- "packuswb %%mm5,%%mm5\n" /* B2 B0 b2 b0 B2 B0 b2 b0 */
- "punpcklbw %%mm3,%%mm5\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
- /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "pxor %%mm4,%%mm4\n" /* 0 0 0 0 0 0 0 0 */
- "movq %%mm6,%%mm1\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */
- "movq %%mm5,%%mm3\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
- /* process lower lum */
- "punpcklbw %%mm4,%%mm1\n" /* 0 r3 0 r2 0 r1 0 r0 */
- "punpcklbw %%mm4,%%mm3\n" /* 0 b3 0 b2 0 b1 0 b0 */
- "movq %%mm1,%%mm2\n" /* 0 r3 0 r2 0 r1 0 r0 */
- "movq %%mm3,%%mm0\n" /* 0 b3 0 b2 0 b1 0 b0 */
- "punpcklwd %%mm1,%%mm3\n" /* 0 r1 0 b1 0 r0 0 b0 */
- "punpckhwd %%mm2,%%mm0\n" /* 0 r3 0 b3 0 r2 0 b2 */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "movq %%mm7,%%mm1\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */
- "punpcklbw %%mm1,%%mm2\n" /* g3 0 g2 0 g1 0 g0 0 */
- "punpcklwd %%mm4,%%mm2\n" /* 0 0 g1 0 0 0 g0 0 */
- "por %%mm3, %%mm2\n" /* 0 r1 g1 b1 0 r0 g0 b0 */
- "movq %%mm2,(%3)\n" /* wrote out ! row1 */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "punpcklbw %%mm1,%%mm4\n" /* g3 0 g2 0 g1 0 g0 0 */
- "punpckhwd %%mm2,%%mm4\n" /* 0 0 g3 0 0 0 g2 0 */
- "por %%mm0, %%mm4\n" /* 0 r3 g3 b3 0 r2 g2 b2 */
- "movq %%mm4,8(%3)\n" /* wrote out ! row1 */
-
- /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
- /* this can be done "destructive" */
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "punpckhbw %%mm2,%%mm6\n" /* 0 R3 0 R2 0 R1 0 R0 */
- "punpckhbw %%mm1,%%mm5\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */
- "movq %%mm5,%%mm1\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */
- "punpcklwd %%mm6,%%mm1\n" /* 0 R1 G1 B1 0 R0 G0 B0 */
- "movq %%mm1,(%5)\n" /* wrote out ! row2 */
- "punpckhwd %%mm6,%%mm5\n" /* 0 R3 G3 B3 0 R2 G2 B2 */
- "movq %%mm5,8(%5)\n" /* wrote out ! row2 */
-
- "addl $4,%2\n" /* lum+4 */
- "leal 16(%3),%3\n" /* row1+16 */
- "leal 16(%5),%5\n" /* row2+16 */
- "addl $2,(%%esp)\n" /* cr+2 */
- "addl $2,%1\n" /* cb+2 */
-
- "addl $4,%6\n" /* x+4 */
- "cmpl %4,%6\n"
-
- "jl 1b\n"
- "addl %4,%2\n" /* lum += cols */
- "addl %8,%3\n" /* row1+= mod */
- "addl %8,%5\n" /* row2+= mod */
- "movl $0,%6\n" /* x=0 */
- "cmpl %7,%2\n"
- "jl 1b\n"
-
- "addl $4,%%esp\n" /* get rid of the stack slot we reserved. */
- "emms\n" /* reset MMX registers. */
- :
- : "m" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
- "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
- "m"(MMX_UbluRGB)
- );
-}
-
-void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint16 *row1;
- Uint16 *row2;
-
- unsigned char* y = lum +cols*rows; /* Pointer to the end */
- int x = 0;
- row1 = (Uint16 *)out; /* 16 bit target */
- row2 = (Uint16 *)out+cols+mod; /* start of second row */
- mod = (mod+cols+mod)*2; /* increment for row1 in byte */
-
- __asm__ __volatile__(
- /* tap dance to workaround the inability to use %%ebx at will... */
- /* move one thing to the stack... */
- "pushl $0\n" /* save a slot on the stack. */
- "pushl %%ebx\n" /* save %%ebx. */
- "movl %0, %%ebx\n" /* put the thing in ebx. */
- "movl %%ebx, 4(%%esp)\n" /* put the thing in the stack slot. */
- "popl %%ebx\n" /* get back %%ebx (the PIC register). */
-
- ".align 8\n"
- "1:\n"
-
- "movd (%1), %%mm0\n" /* 4 Cb 0 0 0 0 u3 u2 u1 u0 */
- "pxor %%mm7, %%mm7\n"
- "pushl %%ebx\n"
- "movl 4(%%esp), %%ebx\n"
- "movd (%%ebx), %%mm1\n" /* 4 Cr 0 0 0 0 v3 v2 v1 v0 */
- "popl %%ebx\n"
-
- "punpcklbw %%mm7, %%mm0\n" /* 4 W cb 0 u3 0 u2 0 u1 0 u0 */
- "punpcklbw %%mm7, %%mm1\n" /* 4 W cr 0 v3 0 v2 0 v1 0 v0 */
- "psubw %9, %%mm0\n"
- "psubw %9, %%mm1\n"
- "movq %%mm0, %%mm2\n" /* Cb 0 u3 0 u2 0 u1 0 u0 */
- "movq %%mm1, %%mm3\n" /* Cr */
- "pmullw %10, %%mm2\n" /* Cb2green 0 R3 0 R2 0 R1 0 R0 */
- "movq (%2), %%mm6\n" /* L1 l7 L6 L5 L4 L3 L2 L1 L0 */
- "pmullw %11, %%mm0\n" /* Cb2blue */
- "pand %12, %%mm6\n" /* L1 00 L6 00 L4 00 L2 00 L0 */
- "pmullw %13, %%mm3\n" /* Cr2green */
- "movq (%2), %%mm7\n" /* L2 */
- "pmullw %14, %%mm1\n" /* Cr2red */
- "psrlw $8, %%mm7\n" /* L2 00 L7 00 L5 00 L3 00 L1 */
- "pmullw %15, %%mm6\n" /* lum1 */
- "paddw %%mm3, %%mm2\n" /* Cb2green + Cr2green == green */
- "pmullw %15, %%mm7\n" /* lum2 */
-
- "movq %%mm6, %%mm4\n" /* lum1 */
- "paddw %%mm0, %%mm6\n" /* lum1 +blue 00 B6 00 B4 00 B2 00 B0 */
- "movq %%mm4, %%mm5\n" /* lum1 */
- "paddw %%mm1, %%mm4\n" /* lum1 +red 00 R6 00 R4 00 R2 00 R0 */
- "paddw %%mm2, %%mm5\n" /* lum1 +green 00 G6 00 G4 00 G2 00 G0 */
- "psraw $6, %%mm4\n" /* R1 0 .. 64 */
- "movq %%mm7, %%mm3\n" /* lum2 00 L7 00 L5 00 L3 00 L1 */
- "psraw $6, %%mm5\n" /* G1 - .. + */
- "paddw %%mm0, %%mm7\n" /* Lum2 +blue 00 B7 00 B5 00 B3 00 B1 */
- "psraw $6, %%mm6\n" /* B1 0 .. 64 */
- "packuswb %%mm4, %%mm4\n" /* R1 R1 */
- "packuswb %%mm5, %%mm5\n" /* G1 G1 */
- "packuswb %%mm6, %%mm6\n" /* B1 B1 */
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
-
- "pand %16, %%mm4\n"
- "psllw $3, %%mm5\n" /* GREEN 1 */
- "punpcklbw %%mm6, %%mm6\n"
- "pand %17, %%mm5\n"
- "pand %16, %%mm6\n"
- "por %%mm5, %%mm4\n" /* */
- "psrlw $11, %%mm6\n" /* BLUE 1 */
- "movq %%mm3, %%mm5\n" /* lum2 */
- "paddw %%mm1, %%mm3\n" /* lum2 +red 00 R7 00 R5 00 R3 00 R1 */
- "paddw %%mm2, %%mm5\n" /* lum2 +green 00 G7 00 G5 00 G3 00 G1 */
- "psraw $6, %%mm3\n" /* R2 */
- "por %%mm6, %%mm4\n" /* MM4 */
- "psraw $6, %%mm5\n" /* G2 */
- "movq (%2, %4), %%mm6\n" /* L3 load lum2 */
- "psraw $6, %%mm7\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm5, %%mm5\n"
- "packuswb %%mm7, %%mm7\n"
- "pand %12, %%mm6\n" /* L3 */
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm5, %%mm5\n"
- "pmullw %15, %%mm6\n" /* lum3 */
- "punpcklbw %%mm7, %%mm7\n"
- "psllw $3, %%mm5\n" /* GREEN 2 */
- "pand %16, %%mm7\n"
- "pand %16, %%mm3\n"
- "psrlw $11, %%mm7\n" /* BLUE 2 */
- "pand %17, %%mm5\n"
- "por %%mm7, %%mm3\n"
- "movq (%2,%4), %%mm7\n" /* L4 load lum2 */
- "por %%mm5, %%mm3\n"
- "psrlw $8, %%mm7\n" /* L4 */
- "movq %%mm4, %%mm5\n"
- "punpcklwd %%mm3, %%mm4\n"
- "pmullw %15, %%mm7\n" /* lum4 */
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%3)\n" /* write row1 */
- "movq %%mm5, 8(%3)\n" /* write row1 */
-
- "movq %%mm6, %%mm4\n" /* Lum3 */
- "paddw %%mm0, %%mm6\n" /* Lum3 +blue */
-
- "movq %%mm4, %%mm5\n" /* Lum3 */
- "paddw %%mm1, %%mm4\n" /* Lum3 +red */
- "paddw %%mm2, %%mm5\n" /* Lum3 +green */
- "psraw $6, %%mm4\n"
- "movq %%mm7, %%mm3\n" /* Lum4 */
- "psraw $6, %%mm5\n"
- "paddw %%mm0, %%mm7\n" /* Lum4 +blue */
- "psraw $6, %%mm6\n" /* Lum3 +blue */
- "movq %%mm3, %%mm0\n" /* Lum4 */
- "packuswb %%mm4, %%mm4\n"
- "paddw %%mm1, %%mm3\n" /* Lum4 +red */
- "packuswb %%mm5, %%mm5\n"
- "paddw %%mm2, %%mm0\n" /* Lum4 +green */
- "packuswb %%mm6, %%mm6\n"
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
- "punpcklbw %%mm6, %%mm6\n"
- "psllw $3, %%mm5\n" /* GREEN 3 */
- "pand %16, %%mm4\n"
- "psraw $6, %%mm3\n" /* psr 6 */
- "psraw $6, %%mm0\n"
- "pand %16, %%mm6\n" /* BLUE */
- "pand %17, %%mm5\n"
- "psrlw $11, %%mm6\n" /* BLUE 3 */
- "por %%mm5, %%mm4\n"
- "psraw $6, %%mm7\n"
- "por %%mm6, %%mm4\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm0, %%mm0\n"
- "packuswb %%mm7, %%mm7\n"
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm0, %%mm0\n"
- "punpcklbw %%mm7, %%mm7\n"
- "pand %16, %%mm3\n"
- "pand %16, %%mm7\n" /* BLUE */
- "psllw $3, %%mm0\n" /* GREEN 4 */
- "psrlw $11, %%mm7\n"
- "pand %17, %%mm0\n"
- "por %%mm7, %%mm3\n"
- "por %%mm0, %%mm3\n"
-
- "movq %%mm4, %%mm5\n"
-
- "punpcklwd %%mm3, %%mm4\n"
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%5)\n"
- "movq %%mm5, 8(%5)\n"
-
- "addl $8, %6\n"
- "addl $8, %2\n"
- "addl $4, (%%esp)\n"
- "addl $4, %1\n"
- "cmpl %4, %6\n"
- "leal 16(%3), %3\n"
- "leal 16(%5),%5\n" /* row2+16 */
-
- "jl 1b\n"
- "addl %4, %2\n" /* lum += cols */
- "addl %8, %3\n" /* row1+= mod */
- "addl %8, %5\n" /* row2+= mod */
- "movl $0, %6\n" /* x=0 */
- "cmpl %7, %2\n"
- "jl 1b\n"
- "addl $4, %%esp\n" /* get rid of the stack slot we reserved. */
- "emms\n"
- :
- : "m" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
- "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
- "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
- );
-}
-
-/* *INDENT-ON* */
-
-#endif /* GCC3 i386 inline assembly */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_sw.c b/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_sw.c
deleted file mode 100644
index 7fc6b88654..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/SDL_yuv_sw.c
+++ /dev/null
@@ -1,1405 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-/* This is the software implementation of the YUV texture support */
-
-/* This code was derived from code carrying the following copyright notices:
-
- * Copyright (c) 1995 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Copyright (c) 1995 Erik Corry
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
- * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
- * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Portions of this software Copyright (c) 1995 Brown University.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement
- * is hereby granted, provided that the above copyright notice and the
- * following two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
- * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
- * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
-#include "SDL_assert.h"
-#include "SDL_video.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_yuv_sw_c.h"
-
-
-/* The colorspace conversion functions */
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
-extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
-#endif
-
-static void
-Color16DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned short *row1;
- unsigned short *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = (unsigned short *) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum++;
- *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum2++;
- *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color24DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row1;
- unsigned char *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = out;
- row2 = row1 + cols * 3 + mod * 3;
- lum2 = lum + cols;
-
- mod += cols + mod;
- mod *= 3;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row1++ = (value) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row1++ = (value) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row2++ = (value) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row2++ = (value) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color32DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1;
- unsigned int *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = (unsigned int *) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- *row1++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- L = *lum++;
- *row1++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- L = *lum2++;
- *row2++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1 = (unsigned int *) out;
- const int next_row = cols + (mod / 2);
- unsigned int *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + (mod / 2);
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row1++;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row1++;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row2++;
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row2++;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color24DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row1 = out;
- const int next_row = (cols * 2 + mod) * 3;
- unsigned char *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = next_row * 3 + mod * 3;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
- row1[next_row + 3 + 0] = (value) & 0xFF;
- row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
- row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
- row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row1 += 2 * 3;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
- row1[next_row + 3 + 0] = (value) & 0xFF;
- row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
- row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
- row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row1 += 2 * 3;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
- row2[next_row + 3 + 0] = (value) & 0xFF;
- row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
- row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
- row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row2 += 2 * 3;
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
- row2[next_row + 3 + 0] = (value) & 0xFF;
- row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
- row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
- row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row2 += 2 * 3;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color32DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1 = (unsigned int *) out;
- const int next_row = cols * 2 + mod;
- unsigned int *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + mod;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1 += 2;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1 += 2;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2 += 2;
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2 += 2;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color16DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned short *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned short *) out;
-
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum;
- lum += 2;
- *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- }
-
- row += mod;
- }
-}
-
-static void
-Color24DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned char *) out;
- mod *= 3;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row++ = (value) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row++ = (value) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- }
- row += mod;
- }
-}
-
-static void
-Color32DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned int *) out;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- *row++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- L = *lum;
- lum += 2;
- *row++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-
- }
- row += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row = (unsigned int *) out;
- const int next_row = cols + (mod / 2);
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row++;
-
- L = *lum;
- lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row++;
-
- }
- row += next_row;
- }
-}
-
-static void
-Color24DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row = out;
- const int next_row = (cols * 2 + mod) * 3;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row[0 + 0] = row[3 + 0] = row[next_row + 0] =
- row[next_row + 3 + 0] = (value) & 0xFF;
- row[0 + 1] = row[3 + 1] = row[next_row + 1] =
- row[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row[0 + 2] = row[3 + 2] = row[next_row + 2] =
- row[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row += 2 * 3;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row[0 + 0] = row[3 + 0] = row[next_row + 0] =
- row[next_row + 3 + 0] = (value) & 0xFF;
- row[0 + 1] = row[3 + 1] = row[next_row + 1] =
- row[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row[0 + 2] = row[3 + 2] = row[next_row + 2] =
- row[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row += 2 * 3;
-
- }
- row += next_row;
- }
-}
-
-static void
-Color32DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row = (unsigned int *) out;
- const int next_row = cols * 2 + mod;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- mod += mod;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row += 2;
-
- L = *lum;
- lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row += 2;
-
-
- }
-
- row += next_row;
- }
-}
-
-/*
- * How many 1 bits are there in the Uint32.
- * Low performance, do not call often.
- */
-static int
-number_of_bits_set(Uint32 a)
-{
- if (!a)
- return 0;
- if (a & 1)
- return 1 + number_of_bits_set(a >> 1);
- return (number_of_bits_set(a >> 1));
-}
-
-/*
- * How many 0 bits are there at least significant end of Uint32.
- * Low performance, do not call often.
- */
-static int
-free_bits_at_bottom(Uint32 a)
-{
- /* assume char is 8 bits */
- if (!a)
- return sizeof(Uint32) * 8;
- if (((Sint32) a) & 1l)
- return 0;
- return 1 + free_bits_at_bottom(a >> 1);
-}
-
-static int
-SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
-{
- Uint32 *r_2_pix_alloc;
- Uint32 *g_2_pix_alloc;
- Uint32 *b_2_pix_alloc;
- int i;
- int bpp;
- Uint32 Rmask, Gmask, Bmask, Amask;
-
- if (!SDL_PixelFormatEnumToMasks
- (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
- return SDL_SetError("Unsupported YUV destination format");
- }
-
- swdata->target_format = target_format;
- r_2_pix_alloc = &swdata->rgb_2_pix[0 * 768];
- g_2_pix_alloc = &swdata->rgb_2_pix[1 * 768];
- b_2_pix_alloc = &swdata->rgb_2_pix[2 * 768];
-
- /*
- * Set up entries 0-255 in rgb-to-pixel value tables.
- */
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Rmask));
- r_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Rmask);
- r_2_pix_alloc[i + 256] |= Amask;
- g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Gmask));
- g_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Gmask);
- g_2_pix_alloc[i + 256] |= Amask;
- b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Bmask));
- b_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Bmask);
- b_2_pix_alloc[i + 256] |= Amask;
- }
-
- /*
- * If we have 16-bit output depth, then we double the value
- * in the top word. This means that we can write out both
- * pixels in the pixel doubling mode with one op. It is
- * harmless in the normal case as storing a 32-bit value
- * through a short pointer will lose the top bits anyway.
- */
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16;
- g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16;
- b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16;
- }
- }
-
- /*
- * Spread out the values we have to the rest of the array so that
- * we do not need to check for overflow.
- */
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i] = r_2_pix_alloc[256];
- r_2_pix_alloc[i + 512] = r_2_pix_alloc[511];
- g_2_pix_alloc[i] = g_2_pix_alloc[256];
- g_2_pix_alloc[i + 512] = g_2_pix_alloc[511];
- b_2_pix_alloc[i] = b_2_pix_alloc[256];
- b_2_pix_alloc[i + 512] = b_2_pix_alloc[511];
- }
-
- /* You have chosen wisely... */
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
- /* inline assembly functions */
- if (SDL_HasMMX() && (Rmask == 0xF800) &&
- (Gmask == 0x07E0) && (Bmask == 0x001F)
- && (swdata->w & 15) == 0) {
-/* printf("Using MMX 16-bit 565 dither\n"); */
- swdata->Display1X = Color565DitherYV12MMX1X;
- } else {
-/* printf("Using C 16-bit dither\n"); */
- swdata->Display1X = Color16DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color16DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color16DitherYV12Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 3) {
- swdata->Display1X = Color24DitherYV12Mod1X;
- swdata->Display2X = Color24DitherYV12Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 4) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
- /* inline assembly functions */
- if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
- (Gmask == 0x0000FF00) &&
- (Bmask == 0x000000FF) && (swdata->w & 15) == 0) {
-/* printf("Using MMX 32-bit dither\n"); */
- swdata->Display1X = ColorRGBDitherYV12MMX1X;
- } else {
-/* printf("Using C 32-bit dither\n"); */
- swdata->Display1X = Color32DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color32DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color32DitherYV12Mod2X;
- }
- break;
- case SDL_PIXELFORMAT_YUY2:
- case SDL_PIXELFORMAT_UYVY:
- case SDL_PIXELFORMAT_YVYU:
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
- swdata->Display1X = Color16DitherYUY2Mod1X;
- swdata->Display2X = Color16DitherYUY2Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 3) {
- swdata->Display1X = Color24DitherYUY2Mod1X;
- swdata->Display2X = Color24DitherYUY2Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 4) {
- swdata->Display1X = Color32DitherYUY2Mod1X;
- swdata->Display2X = Color32DitherYUY2Mod2X;
- }
- break;
- default:
- /* We should never get here (caught above) */
- break;
- }
-
- SDL_FreeSurface(swdata->display);
- swdata->display = NULL;
- return 0;
-}
-
-SDL_SW_YUVTexture *
-SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
-{
- SDL_SW_YUVTexture *swdata;
- int *Cr_r_tab;
- int *Cr_g_tab;
- int *Cb_g_tab;
- int *Cb_b_tab;
- int i;
- int CR, CB;
-
- switch (format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- case SDL_PIXELFORMAT_YUY2:
- case SDL_PIXELFORMAT_UYVY:
- case SDL_PIXELFORMAT_YVYU:
- break;
- default:
- SDL_SetError("Unsupported YUV format");
- return NULL;
- }
-
- swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata));
- if (!swdata) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- swdata->format = format;
- swdata->target_format = SDL_PIXELFORMAT_UNKNOWN;
- swdata->w = w;
- swdata->h = h;
- swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2);
- swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
- swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
- if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
- SDL_SW_DestroyYUVTexture(swdata);
- SDL_OutOfMemory();
- return NULL;
- }
-
- /* Generate the tables for the display surface */
- Cr_r_tab = &swdata->colortab[0 * 256];
- Cr_g_tab = &swdata->colortab[1 * 256];
- Cb_g_tab = &swdata->colortab[2 * 256];
- Cb_b_tab = &swdata->colortab[3 * 256];
- for (i = 0; i < 256; i++) {
- /* Gamma correction (luminescence table) and chroma correction
- would be done here. See the Berkeley mpeg_play sources.
- */
- CB = CR = (i - 128);
- Cr_r_tab[i] = (int) ((0.419 / 0.299) * CR);
- Cr_g_tab[i] = (int) (-(0.299 / 0.419) * CR);
- Cb_g_tab[i] = (int) (-(0.114 / 0.331) * CB);
- Cb_b_tab[i] = (int) ((0.587 / 0.331) * CB);
- }
-
- /* Find the pitch and offset values for the overlay */
- switch (format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- swdata->pitches[0] = w;
- swdata->pitches[1] = swdata->pitches[0] / 2;
- swdata->pitches[2] = swdata->pitches[0] / 2;
- swdata->planes[0] = swdata->pixels;
- swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h;
- swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2;
- break;
- case SDL_PIXELFORMAT_YUY2:
- case SDL_PIXELFORMAT_UYVY:
- case SDL_PIXELFORMAT_YVYU:
- swdata->pitches[0] = w * 2;
- swdata->planes[0] = swdata->pixels;
- break;
- default:
- SDL_assert(0 && "We should never get here (caught above)");
- break;
- }
-
- /* We're all done.. */
- return (swdata);
-}
-
-int
-SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
- int *pitch)
-{
- *pixels = swdata->planes[0];
- *pitch = swdata->pitches[0];
- return 0;
-}
-
-int
-SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
- const void *pixels, int pitch)
-{
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- if (rect->x == 0 && rect->y == 0 &&
- rect->w == swdata->w && rect->h == swdata->h) {
- SDL_memcpy(swdata->pixels, pixels,
- (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
- } else {
- Uint8 *src, *dst;
- int row;
- size_t length;
-
- /* Copy the Y plane */
- src = (Uint8 *) pixels;
- dst = swdata->pixels + rect->y * swdata->w + rect->x;
- length = rect->w;
- for (row = 0; row < rect->h; ++row) {
- SDL_memcpy(dst, src, length);
- src += pitch;
- dst += swdata->w;
- }
-
- /* Copy the next plane */
- src = (Uint8 *) pixels + rect->h * pitch;
- dst = swdata->pixels + swdata->h * swdata->w;
- dst += rect->y/2 * swdata->w/2 + rect->x/2;
- length = rect->w / 2;
- for (row = 0; row < rect->h/2; ++row) {
- SDL_memcpy(dst, src, length);
- src += pitch/2;
- dst += swdata->w/2;
- }
-
- /* Copy the next plane */
- src = (Uint8 *) pixels + rect->h * pitch + (rect->h * pitch) / 4;
- dst = swdata->pixels + swdata->h * swdata->w +
- (swdata->h * swdata->w) / 4;
- dst += rect->y/2 * swdata->w/2 + rect->x/2;
- length = rect->w / 2;
- for (row = 0; row < rect->h/2; ++row) {
- SDL_memcpy(dst, src, length);
- src += pitch/2;
- dst += swdata->w/2;
- }
- }
- break;
- case SDL_PIXELFORMAT_YUY2:
- case SDL_PIXELFORMAT_UYVY:
- case SDL_PIXELFORMAT_YVYU:
- {
- Uint8 *src, *dst;
- int row;
- size_t length;
-
- src = (Uint8 *) pixels;
- dst =
- swdata->planes[0] + rect->y * swdata->pitches[0] +
- rect->x * 2;
- length = rect->w * 2;
- for (row = 0; row < rect->h; ++row) {
- SDL_memcpy(dst, src, length);
- src += pitch;
- dst += swdata->pitches[0];
- }
- }
- break;
- }
- return 0;
-}
-
-int
-SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
- const Uint8 *Yplane, int Ypitch,
- const Uint8 *Uplane, int Upitch,
- const Uint8 *Vplane, int Vpitch)
-{
- const Uint8 *src;
- Uint8 *dst;
- int row;
- size_t length;
-
- /* Copy the Y plane */
- src = Yplane;
- dst = swdata->pixels + rect->y * swdata->w + rect->x;
- length = rect->w;
- for (row = 0; row < rect->h; ++row) {
- SDL_memcpy(dst, src, length);
- src += Ypitch;
- dst += swdata->w;
- }
-
- /* Copy the U plane */
- src = Uplane;
- if (swdata->format == SDL_PIXELFORMAT_IYUV) {
- dst = swdata->pixels + swdata->h * swdata->w;
- } else {
- dst = swdata->pixels + swdata->h * swdata->w +
- (swdata->h * swdata->w) / 4;
- }
- dst += rect->y/2 * swdata->w/2 + rect->x/2;
- length = rect->w / 2;
- for (row = 0; row < rect->h/2; ++row) {
- SDL_memcpy(dst, src, length);
- src += Upitch;
- dst += swdata->w/2;
- }
-
- /* Copy the V plane */
- src = Vplane;
- if (swdata->format == SDL_PIXELFORMAT_YV12) {
- dst = swdata->pixels + swdata->h * swdata->w;
- } else {
- dst = swdata->pixels + swdata->h * swdata->w +
- (swdata->h * swdata->w) / 4;
- }
- dst += rect->y/2 * swdata->w/2 + rect->x/2;
- length = rect->w / 2;
- for (row = 0; row < rect->h/2; ++row) {
- SDL_memcpy(dst, src, length);
- src += Vpitch;
- dst += swdata->w/2;
- }
- return 0;
-}
-
-int
-SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
- void **pixels, int *pitch)
-{
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- if (rect
- && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w
- || rect->h != swdata->h)) {
- return SDL_SetError
- ("YV12 and IYUV textures only support full surface locks");
- }
- break;
- }
-
- if (rect) {
- *pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2;
- } else {
- *pixels = swdata->planes[0];
- }
- *pitch = swdata->pitches[0];
- return 0;
-}
-
-void
-SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata)
-{
-}
-
-int
-SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
- Uint32 target_format, int w, int h, void *pixels,
- int pitch)
-{
- const int targetbpp = SDL_BYTESPERPIXEL(target_format);
- int stretch;
- int scale_2x;
- Uint8 *lum, *Cr, *Cb;
- int mod;
-
- if (targetbpp == 0) {
- return SDL_SetError("Invalid target pixel format");
- }
-
- /* Make sure we're set up to display in the desired format */
- if (target_format != swdata->target_format) {
- if (SDL_SW_SetupYUVDisplay(swdata, target_format) < 0) {
- return -1;
- }
- }
-
- stretch = 0;
- scale_2x = 0;
- if (srcrect->x || srcrect->y || srcrect->w < swdata->w
- || srcrect->h < swdata->h) {
- /* The source rectangle has been clipped.
- Using a scratch surface is easier than adding clipped
- source support to all the blitters, plus that would
- slow them down in the general unclipped case.
- */
- stretch = 1;
- } else if ((srcrect->w != w) || (srcrect->h != h)) {
- if ((w == 2 * srcrect->w) && (h == 2 * srcrect->h)) {
- scale_2x = 1;
- } else {
- stretch = 1;
- }
- }
- if (stretch) {
- int bpp;
- Uint32 Rmask, Gmask, Bmask, Amask;
-
- if (swdata->display) {
- swdata->display->w = w;
- swdata->display->h = h;
- swdata->display->pixels = pixels;
- swdata->display->pitch = pitch;
- } else {
- /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */
- SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask,
- &Bmask, &Amask);
- swdata->display =
- SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask,
- Gmask, Bmask, Amask);
- if (!swdata->display) {
- return (-1);
- }
- }
- if (!swdata->stretch) {
- /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */
- SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask,
- &Bmask, &Amask);
- swdata->stretch =
- SDL_CreateRGBSurface(0, swdata->w, swdata->h, bpp, Rmask,
- Gmask, Bmask, Amask);
- if (!swdata->stretch) {
- return (-1);
- }
- }
- pixels = swdata->stretch->pixels;
- pitch = swdata->stretch->pitch;
- }
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- lum = swdata->planes[0];
- Cr = swdata->planes[1];
- Cb = swdata->planes[2];
- break;
- case SDL_PIXELFORMAT_IYUV:
- lum = swdata->planes[0];
- Cr = swdata->planes[2];
- Cb = swdata->planes[1];
- break;
- case SDL_PIXELFORMAT_YUY2:
- lum = swdata->planes[0];
- Cr = lum + 3;
- Cb = lum + 1;
- break;
- case SDL_PIXELFORMAT_UYVY:
- lum = swdata->planes[0] + 1;
- Cr = lum + 1;
- Cb = lum - 1;
- break;
- case SDL_PIXELFORMAT_YVYU:
- lum = swdata->planes[0];
- Cr = lum + 1;
- Cb = lum + 3;
- break;
- default:
- return SDL_SetError("Unsupported YUV format in copy");
- }
- mod = (pitch / targetbpp);
-
- if (scale_2x) {
- mod -= (swdata->w * 2);
- swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
- } else {
- mod -= swdata->w;
- swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
- }
- if (stretch) {
- SDL_Rect rect = *srcrect;
- SDL_SoftStretch(swdata->stretch, &rect, swdata->display, NULL);
- }
- return 0;
-}
-
-void
-SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
-{
- if (swdata) {
- SDL_free(swdata->pixels);
- SDL_free(swdata->colortab);
- SDL_free(swdata->rgb_2_pix);
- SDL_FreeSurface(swdata->stretch);
- SDL_FreeSurface(swdata->display);
- SDL_free(swdata);
- }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/mmx.h b/3rdparty/sdl2-2.0.4/src/render/mmx.h
deleted file mode 100644
index 3bd00ac239..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/mmx.h
+++ /dev/null
@@ -1,642 +0,0 @@
-/* mmx.h
-
- MultiMedia eXtensions GCC interface library for IA32.
-
- To use this library, simply include this header file
- and compile with GCC. You MUST have inlining enabled
- in order for mmx_ok() to work; this can be done by
- simply using -O on the GCC command line.
-
- Compiling with -DMMX_TRACE will cause detailed trace
- output to be sent to stderr for each mmx operation.
- This adds lots of code, and obviously slows execution to
- a crawl, but can be very useful for debugging.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
- LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR ANY PARTICULAR PURPOSE.
-
- 1997-99 by H. Dietz and R. Fisher
-
- Notes:
- It appears that the latest gas has the pand problem fixed, therefore
- I'll undefine BROKEN_PAND by default.
-*/
-
-#ifndef _MMX_H
-#define _MMX_H
-
-
-/* Warning: at this writing, the version of GAS packaged
- with most Linux distributions does not handle the
- parallel AND operation mnemonic correctly. If the
- symbol BROKEN_PAND is defined, a slower alternative
- coding will be used. If execution of mmxtest results
- in an illegal instruction fault, define this symbol.
-*/
-#undef BROKEN_PAND
-
-
-/* The type of an value that fits in an MMX register
- (note that long long constant values MUST be suffixed
- by LL and unsigned long long values by ULL, lest
- they be truncated by the compiler)
-*/
-typedef union
-{
- long long q; /* Quadword (64-bit) value */
- unsigned long long uq; /* Unsigned Quadword */
- int d[2]; /* 2 Doubleword (32-bit) values */
- unsigned int ud[2]; /* 2 Unsigned Doubleword */
- short w[4]; /* 4 Word (16-bit) values */
- unsigned short uw[4]; /* 4 Unsigned Word */
- char b[8]; /* 8 Byte (8-bit) values */
- unsigned char ub[8]; /* 8 Unsigned Byte */
- float s[2]; /* Single-precision (32-bit) value */
-} __attribute__ ((aligned(8))) mmx_t; /* On an 8-byte (64-bit) boundary */
-
-
-#if 0
-/* Function to test if multimedia instructions are supported...
-*/
-inline extern int
-mm_support(void)
-{
- /* Returns 1 if MMX instructions are supported,
- 3 if Cyrix MMX and Extended MMX instructions are supported
- 5 if AMD MMX and 3DNow! instructions are supported
- 0 if hardware does not support any of these
- */
- register int rval = 0;
-
- __asm__ __volatile__(
- /* See if CPUID instruction is supported ... */
- /* ... Get copies of EFLAGS into eax and ecx */
- "pushf\n\t"
- "popl %%eax\n\t" "movl %%eax, %%ecx\n\t"
- /* ... Toggle the ID bit in one copy and store */
- /* to the EFLAGS reg */
- "xorl $0x200000, %%eax\n\t"
- "push %%eax\n\t" "popf\n\t"
- /* ... Get the (hopefully modified) EFLAGS */
- "pushf\n\t" "popl %%eax\n\t"
- /* ... Compare and test result */
- "xorl %%eax, %%ecx\n\t" "testl $0x200000, %%ecx\n\t" "jz NotSupported1\n\t" /* CPUID not supported */
- /* Get standard CPUID information, and
- go to a specific vendor section */
- "movl $0, %%eax\n\t" "cpuid\n\t"
- /* Check for Intel */
- "cmpl $0x756e6547, %%ebx\n\t"
- "jne TryAMD\n\t"
- "cmpl $0x49656e69, %%edx\n\t"
- "jne TryAMD\n\t"
- "cmpl $0x6c65746e, %%ecx\n"
- "jne TryAMD\n\t" "jmp Intel\n\t"
- /* Check for AMD */
- "\nTryAMD:\n\t"
- "cmpl $0x68747541, %%ebx\n\t"
- "jne TryCyrix\n\t"
- "cmpl $0x69746e65, %%edx\n\t"
- "jne TryCyrix\n\t"
- "cmpl $0x444d4163, %%ecx\n"
- "jne TryCyrix\n\t" "jmp AMD\n\t"
- /* Check for Cyrix */
- "\nTryCyrix:\n\t"
- "cmpl $0x69727943, %%ebx\n\t"
- "jne NotSupported2\n\t"
- "cmpl $0x736e4978, %%edx\n\t"
- "jne NotSupported3\n\t"
- "cmpl $0x64616574, %%ecx\n\t"
- "jne NotSupported4\n\t"
- /* Drop through to Cyrix... */
- /* Cyrix Section */
- /* See if extended CPUID level 80000001 is supported */
- /* The value of CPUID/80000001 for the 6x86MX is undefined
- according to the Cyrix CPU Detection Guide (Preliminary
- Rev. 1.01 table 1), so we'll check the value of eax for
- CPUID/0 to see if standard CPUID level 2 is supported.
- According to the table, the only CPU which supports level
- 2 is also the only one which supports extended CPUID levels.
- */
- "cmpl $0x2, %%eax\n\t" "jne MMXtest\n\t" /* Use standard CPUID instead */
- /* Extended CPUID supported (in theory), so get extended
- features */
- "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%eax\n\t" /* Test for MMX */
- "jz NotSupported5\n\t" /* MMX not supported */
- "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
- "jnz EMMXSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\n" "EMMXSupported:\n\t" "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
- "jmp Return\n\t"
- /* AMD Section */
- "AMD:\n\t"
- /* See if extended CPUID is supported */
- "movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t" /* Use standard CPUID instead */
- /* Extended CPUID supported, so get extended features */
- "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
- "jz NotSupported6\n\t" /* MMX not supported */
- "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
- "jnz ThreeDNowSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\n" "ThreeDNowSupported:\n\t" "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
- "jmp Return\n\t"
- /* Intel Section */
- "Intel:\n\t"
- /* Check for MMX */
- "MMXtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
- "jz NotSupported7\n\t" /* MMX Not supported */
- "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\t"
- /* Nothing supported */
- "\nNotSupported1:\n\t" "#movl $101, %0:\n\n\t" "\nNotSupported2:\n\t" "#movl $102, %0:\n\n\t" "\nNotSupported3:\n\t" "#movl $103, %0:\n\n\t" "\nNotSupported4:\n\t" "#movl $104, %0:\n\n\t" "\nNotSupported5:\n\t" "#movl $105, %0:\n\n\t" "\nNotSupported6:\n\t" "#movl $106, %0:\n\n\t" "\nNotSupported7:\n\t" "#movl $107, %0:\n\n\t" "movl $0, %0:\n\n\t" "Return:\n\t":"=a"(rval): /* no input */
- :"eax", "ebx", "ecx", "edx");
-
- /* Return */
- return (rval);
-}
-
-/* Function to test if mmx instructions are supported...
-*/
-inline extern int
-mmx_ok(void)
-{
- /* Returns 1 if MMX instructions are supported, 0 otherwise */
- return (mm_support() & 0x1);
-}
-#endif
-
-/* Helper functions for the instruction macros that follow...
- (note that memory-to-register, m2r, instructions are nearly
- as efficient as register-to-register, r2r, instructions;
- however, memory-to-memory instructions are really simulated
- as a convenience, and are only 1/3 as efficient)
-*/
-#ifdef MMX_TRACE
-
-/* Include the stuff for printing a trace to stderr...
-*/
-
-#define mmx_i2r(op, imm, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace.uq = (imm); \
- printf(#op "_i2r(" #imm "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (imm)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_m2r(op, mem, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mem); \
- printf(#op "_m2r(" #mem "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (mem)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_r2m(op, reg, mem) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#op "_r2m(" #reg "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- mmx_trace = (mem); \
- printf(#mem "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
- : /* nothing */ ); \
- mmx_trace = (mem); \
- printf(#mem "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_r2r(op, regs, regd) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #regs ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#op "_r2r(" #regs "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#regd "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#regd "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_m2m(op, mems, memd) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mems); \
- printf(#op "_m2m(" #mems "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- mmx_trace = (memd); \
- printf(#memd "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems)); \
- mmx_trace = (memd); \
- printf(#memd "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#else
-
-/* These macros are a lot simpler without the tracing...
-*/
-
-#define mmx_i2r(op, imm, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (imm) )
-
-#define mmx_m2r(op, mem, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "m" (mem))
-
-#define mmx_r2m(op, reg, mem) \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=m" (mem) \
- : /* nothing */ )
-
-#define mmx_r2r(op, regs, regd) \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd)
-
-#define mmx_m2m(op, mems, memd) \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems))
-
-#endif
-
-
-/* 1x64 MOVe Quadword
- (this is both a load and a store...
- in fact, it is the only way to store)
-*/
-#define movq_m2r(var, reg) mmx_m2r(movq, var, reg)
-#define movq_r2m(reg, var) mmx_r2m(movq, reg, var)
-#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd)
-#define movq(vars, vard) \
- __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 1x32 MOVe Doubleword
- (like movq, this is both load and store...
- but is most useful for moving things between
- mmx registers and ordinary registers)
-*/
-#define movd_m2r(var, reg) mmx_m2r(movd, var, reg)
-#define movd_r2m(reg, var) mmx_r2m(movd, reg, var)
-#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd)
-#define movd(vars, vard) \
- __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
- "movd %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 2x32, 4x16, and 8x8 Parallel ADDs
-*/
-#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg)
-#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd)
-#define paddd(vars, vard) mmx_m2m(paddd, vars, vard)
-
-#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg)
-#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd)
-#define paddw(vars, vard) mmx_m2m(paddw, vars, vard)
-
-#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg)
-#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd)
-#define paddb(vars, vard) mmx_m2m(paddb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic
-*/
-#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg)
-#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd)
-#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard)
-
-#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg)
-#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd)
-#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
-*/
-#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg)
-#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd)
-#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard)
-
-#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg)
-#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd)
-#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel SUBs
-*/
-#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg)
-#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd)
-#define psubd(vars, vard) mmx_m2m(psubd, vars, vard)
-
-#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg)
-#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd)
-#define psubw(vars, vard) mmx_m2m(psubw, vars, vard)
-
-#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg)
-#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd)
-#define psubb(vars, vard) mmx_m2m(psubb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic
-*/
-#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg)
-#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd)
-#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard)
-
-#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg)
-#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd)
-#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
-*/
-#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg)
-#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd)
-#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard)
-
-#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg)
-#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd)
-#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard)
-
-
-/* 4x16 Parallel MULs giving Low 4x16 portions of results
-*/
-#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg)
-#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd)
-#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard)
-
-
-/* 4x16 Parallel MULs giving High 4x16 portions of results
-*/
-#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg)
-#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd)
-#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard)
-
-
-/* 4x16->2x32 Parallel Mul-ADD
- (muls like pmullw, then adds adjacent 16-bit fields
- in the multiply result to make the final 2x32 result)
-*/
-#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg)
-#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd)
-#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard)
-
-
-/* 1x64 bitwise AND
-*/
-#ifdef BROKEN_PAND
-#define pand_m2r(var, reg) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, reg); \
- mmx_m2r(pandn, var, reg); \
- }
-#define pand_r2r(regs, regd) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, regd); \
- mmx_r2r(pandn, regs, regd) \
- }
-#define pand(vars, vard) \
- { \
- movq_m2r(vard, mm0); \
- mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
- mmx_m2r(pandn, vars, mm0); \
- movq_r2m(mm0, vard); \
- }
-#else
-#define pand_m2r(var, reg) mmx_m2r(pand, var, reg)
-#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd)
-#define pand(vars, vard) mmx_m2m(pand, vars, vard)
-#endif
-
-
-/* 1x64 bitwise AND with Not the destination
-*/
-#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg)
-#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd)
-#define pandn(vars, vard) mmx_m2m(pandn, vars, vard)
-
-
-/* 1x64 bitwise OR
-*/
-#define por_m2r(var, reg) mmx_m2r(por, var, reg)
-#define por_r2r(regs, regd) mmx_r2r(por, regs, regd)
-#define por(vars, vard) mmx_m2m(por, vars, vard)
-
-
-/* 1x64 bitwise eXclusive OR
-*/
-#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg)
-#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd)
-#define pxor(vars, vard) mmx_m2m(pxor, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
- (resulting fields are either 0 or -1)
-*/
-#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg)
-#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd)
-#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard)
-
-#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg)
-#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd)
-#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard)
-
-#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg)
-#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd)
-#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
- (resulting fields are either 0 or -1)
-*/
-#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg)
-#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd)
-#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard)
-
-#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg)
-#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd)
-#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard)
-
-#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg)
-#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd)
-#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical
-*/
-#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg)
-#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg)
-#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd)
-#define psllq(vars, vard) mmx_m2m(psllq, vars, vard)
-
-#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg)
-#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg)
-#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd)
-#define pslld(vars, vard) mmx_m2m(pslld, vars, vard)
-
-#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg)
-#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg)
-#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd)
-#define psllw(vars, vard) mmx_m2m(psllw, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical
-*/
-#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg)
-#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg)
-#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd)
-#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard)
-
-#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg)
-#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg)
-#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd)
-#define psrld(vars, vard) mmx_m2m(psrld, vars, vard)
-
-#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg)
-#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg)
-#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd)
-#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard)
-
-
-/* 2x32 and 4x16 Parallel Shift Right Arithmetic
-*/
-#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg)
-#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg)
-#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd)
-#define psrad(vars, vard) mmx_m2m(psrad, vars, vard)
-
-#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg)
-#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg)
-#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd)
-#define psraw(vars, vard) mmx_m2m(psraw, vars, vard)
-
-
-/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg)
-#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
-#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard)
-
-#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg)
-#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
-#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard)
-
-
-/* 4x16->8x8 PACK and Unsigned Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg)
-#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
-#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
- (interleaves low half of dest with low half of source
- as padding in each result field)
-*/
-#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg)
-#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
-#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard)
-
-#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg)
-#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
-#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard)
-
-#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg)
-#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
-#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
- (interleaves high half of dest with high half of source
- as padding in each result field)
-*/
-#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg)
-#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
-#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard)
-
-#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg)
-#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
-#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard)
-
-#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg)
-#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
-#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard)
-
-
-/* Empty MMx State
- (used to clean-up when going from mmx to float use
- of the registers that are shared by both; note that
- there is no float-to-mmx operation needed, because
- only the float tag word info is corruptible)
-*/
-#ifdef MMX_TRACE
-
-#define emms() \
- { \
- printf("emms()\n"); \
- __asm__ __volatile__ ("emms"); \
- }
-
-#else
-
-#define emms() __asm__ __volatile__ ("emms")
-
-#endif
-
-#endif
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/opengl/SDL_shaders_gl.c b/3rdparty/sdl2-2.0.4/src/render/opengl/SDL_shaders_gl.c
deleted file mode 100644
index bcf7b43150..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/opengl/SDL_shaders_gl.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
-
-#include "SDL_stdinc.h"
-#include "SDL_log.h"
-#include "SDL_opengl.h"
-#include "SDL_video.h"
-#include "SDL_shaders_gl.h"
-
-/* OpenGL shader implementation */
-
-/* #define DEBUG_SHADERS */
-
-typedef struct
-{
- GLhandleARB program;
- GLhandleARB vert_shader;
- GLhandleARB frag_shader;
-} GL_ShaderData;
-
-struct GL_ShaderContext
-{
- GLenum (*glGetError)(void);
-
- PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
- PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
- PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
- PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
- PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
- PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
- PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
- PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
- PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
- PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
- PFNGLUNIFORM1IARBPROC glUniform1iARB;
- PFNGLUNIFORM1FARBPROC glUniform1fARB;
- PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
-
- SDL_bool GL_ARB_texture_rectangle_supported;
-
- GL_ShaderData shaders[NUM_SHADERS];
-};
-
-/*
- * NOTE: Always use sampler2D, etc here. We'll #define them to the
- * texture_rectangle versions if we choose to use that extension.
- */
-static const char *shader_source[NUM_SHADERS][2] =
-{
- /* SHADER_NONE */
- { NULL, NULL },
-
- /* SHADER_SOLID */
- {
- /* vertex shader */
-"varying vec4 v_color;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-" v_color = gl_Color;\n"
-"}",
- /* fragment shader */
-"varying vec4 v_color;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_FragColor = v_color;\n"
-"}"
- },
-
- /* SHADER_RGB */
- {
- /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-" v_color = gl_Color;\n"
-" v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
- /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n"
-"}"
- },
-
- /* SHADER_YUV */
- {
- /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-" v_color = gl_Color;\n"
-" v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
- /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0; // Y \n"
-"uniform sampler2D tex1; // U \n"
-"uniform sampler2D tex2; // V \n"
-"\n"
-"// YUV offset \n"
-"const vec3 offset = vec3(-0.0627451017, -0.501960814, -0.501960814);\n"
-"\n"
-"// RGB coefficients \n"
-"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n"
-"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
-"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n"
-"\n"
-"void main()\n"
-"{\n"
-" vec2 tcoord;\n"
-" vec3 yuv, rgb;\n"
-"\n"
-" // Get the Y value \n"
-" tcoord = v_texCoord;\n"
-" yuv.x = texture2D(tex0, tcoord).r;\n"
-"\n"
-" // Get the U and V values \n"
-" tcoord *= UVCoordScale;\n"
-" yuv.y = texture2D(tex1, tcoord).r;\n"
-" yuv.z = texture2D(tex2, tcoord).r;\n"
-"\n"
-" // Do the color transform \n"
-" yuv += offset;\n"
-" rgb.r = dot(yuv, Rcoeff);\n"
-" rgb.g = dot(yuv, Gcoeff);\n"
-" rgb.b = dot(yuv, Bcoeff);\n"
-"\n"
-" // That was easy. :) \n"
-" gl_FragColor = vec4(rgb, 1.0) * v_color;\n"
-"}"
- },
-
- /* SHADER_NV12 */
- {
- /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-" v_color = gl_Color;\n"
-" v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
- /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0; // Y \n"
-"uniform sampler2D tex1; // U/V \n"
-"\n"
-"// YUV offset \n"
-"const vec3 offset = vec3(-0.0627451017, -0.501960814, -0.501960814);\n"
-"\n"
-"// RGB coefficients \n"
-"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n"
-"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
-"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n"
-"\n"
-"void main()\n"
-"{\n"
-" vec2 tcoord;\n"
-" vec3 yuv, rgb;\n"
-"\n"
-" // Get the Y value \n"
-" tcoord = v_texCoord;\n"
-" yuv.x = texture2D(tex0, tcoord).r;\n"
-"\n"
-" // Get the U and V values \n"
-" tcoord *= UVCoordScale;\n"
-" yuv.yz = texture2D(tex1, tcoord).ra;\n"
-"\n"
-" // Do the color transform \n"
-" yuv += offset;\n"
-" rgb.r = dot(yuv, Rcoeff);\n"
-" rgb.g = dot(yuv, Gcoeff);\n"
-" rgb.b = dot(yuv, Bcoeff);\n"
-"\n"
-" // That was easy. :) \n"
-" gl_FragColor = vec4(rgb, 1.0) * v_color;\n"
-"}"
- },
-
- /* SHADER_NV21 */
- {
- /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-" v_color = gl_Color;\n"
-" v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
- /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0; // Y \n"
-"uniform sampler2D tex1; // U/V \n"
-"\n"
-"// YUV offset \n"
-"const vec3 offset = vec3(-0.0627451017, -0.501960814, -0.501960814);\n"
-"\n"
-"// RGB coefficients \n"
-"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n"
-"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
-"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n"
-"\n"
-"void main()\n"
-"{\n"
-" vec2 tcoord;\n"
-" vec3 yuv, rgb;\n"
-"\n"
-" // Get the Y value \n"
-" tcoord = v_texCoord;\n"
-" yuv.x = texture2D(tex0, tcoord).r;\n"
-"\n"
-" // Get the U and V values \n"
-" tcoord *= UVCoordScale;\n"
-" yuv.yz = texture2D(tex1, tcoord).ar;\n"
-"\n"
-" // Do the color transform \n"
-" yuv += offset;\n"
-" rgb.r = dot(yuv, Rcoeff);\n"
-" rgb.g = dot(yuv, Gcoeff);\n"
-" rgb.b = dot(yuv, Bcoeff);\n"
-"\n"
-" // That was easy. :) \n"
-" gl_FragColor = vec4(rgb, 1.0) * v_color;\n"
-"}"
- },
-};
-
-static SDL_bool
-CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, const char *source)
-{
- GLint status;
- const char *sources[2];
-
- sources[0] = defines;
- sources[1] = source;
-
- ctx->glShaderSourceARB(shader, SDL_arraysize(sources), sources, NULL);
- ctx->glCompileShaderARB(shader);
- ctx->glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);
- if (status == 0) {
- GLint length;
- char *info;
-
- ctx->glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
- info = SDL_stack_alloc(char, length+1);
- ctx->glGetInfoLogARB(shader, length, NULL, info);
- SDL_LogError(SDL_LOG_CATEGORY_RENDER,
- "Failed to compile shader:\n%s%s\n%s", defines, source, info);
-#ifdef DEBUG_SHADERS
- fprintf(stderr,
- "Failed to compile shader:\n%s%s\n%s", defines, source, info);
-#endif
- SDL_stack_free(info);
-
- return SDL_FALSE;
- } else {
- return SDL_TRUE;
- }
-}
-
-static SDL_bool
-CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data)
-{
- const int num_tmus_bound = 4;
- const char *vert_defines = "";
- const char *frag_defines = "";
- int i;
- GLint location;
-
- if (index == SHADER_NONE) {
- return SDL_TRUE;
- }
-
- ctx->glGetError();
-
- /* Make sure we use the correct sampler type for our texture type */
- if (ctx->GL_ARB_texture_rectangle_supported) {
- frag_defines =
-"#define sampler2D sampler2DRect\n"
-"#define texture2D texture2DRect\n"
-"#define UVCoordScale 0.5\n";
- } else {
- frag_defines =
-"#define UVCoordScale 1.0\n";
- }
-
- /* Create one program object to rule them all */
- data->program = ctx->glCreateProgramObjectARB();
-
- /* Create the vertex shader */
- data->vert_shader = ctx->glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
- if (!CompileShader(ctx, data->vert_shader, vert_defines, shader_source[index][0])) {
- return SDL_FALSE;
- }
-
- /* Create the fragment shader */
- data->frag_shader = ctx->glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
- if (!CompileShader(ctx, data->frag_shader, frag_defines, shader_source[index][1])) {
- return SDL_FALSE;
- }
-
- /* ... and in the darkness bind them */
- ctx->glAttachObjectARB(data->program, data->vert_shader);
- ctx->glAttachObjectARB(data->program, data->frag_shader);
- ctx->glLinkProgramARB(data->program);
-
- /* Set up some uniform variables */
- ctx->glUseProgramObjectARB(data->program);
- for (i = 0; i < num_tmus_bound; ++i) {
- char tex_name[10];
- SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i);
- location = ctx->glGetUniformLocationARB(data->program, tex_name);
- if (location >= 0) {
- ctx->glUniform1iARB(location, i);
- }
- }
- ctx->glUseProgramObjectARB(0);
-
- return (ctx->glGetError() == GL_NO_ERROR);
-}
-
-static void
-DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data)
-{
- ctx->glDeleteObjectARB(data->vert_shader);
- ctx->glDeleteObjectARB(data->frag_shader);
- ctx->glDeleteObjectARB(data->program);
-}
-
-GL_ShaderContext *
-GL_CreateShaderContext()
-{
- GL_ShaderContext *ctx;
- SDL_bool shaders_supported;
- int i;
-
- ctx = (GL_ShaderContext *)SDL_calloc(1, sizeof(*ctx));
- if (!ctx) {
- return NULL;
- }
-
- if (!SDL_GL_ExtensionSupported("GL_ARB_texture_non_power_of_two") &&
- (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle") ||
- SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle"))) {
- ctx->GL_ARB_texture_rectangle_supported = SDL_TRUE;
- }
-
- /* Check for shader support */
- shaders_supported = SDL_FALSE;
- if (SDL_GL_ExtensionSupported("GL_ARB_shader_objects") &&
- SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
- SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
- SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
- ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
- ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
- ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
- ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
- ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
- ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
- ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
- ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
- ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
- ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
- ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
- ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
- ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
- ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
- if (ctx->glGetError &&
- ctx->glAttachObjectARB &&
- ctx->glCompileShaderARB &&
- ctx->glCreateProgramObjectARB &&
- ctx->glCreateShaderObjectARB &&
- ctx->glDeleteObjectARB &&
- ctx->glGetInfoLogARB &&
- ctx->glGetObjectParameterivARB &&
- ctx->glGetUniformLocationARB &&
- ctx->glLinkProgramARB &&
- ctx->glShaderSourceARB &&
- ctx->glUniform1iARB &&
- ctx->glUniform1fARB &&
- ctx->glUseProgramObjectARB) {
- shaders_supported = SDL_TRUE;
- }
- }
-
- if (!shaders_supported) {
- SDL_free(ctx);
- return NULL;
- }
-
- /* Compile all the shaders */
- for (i = 0; i < NUM_SHADERS; ++i) {
- if (!CompileShaderProgram(ctx, i, &ctx->shaders[i])) {
- GL_DestroyShaderContext(ctx);
- return NULL;
- }
- }
-
- /* We're done! */
- return ctx;
-}
-
-void
-GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader)
-{
- ctx->glUseProgramObjectARB(ctx->shaders[shader].program);
-}
-
-void
-GL_DestroyShaderContext(GL_ShaderContext *ctx)
-{
- int i;
-
- for (i = 0; i < NUM_SHADERS; ++i) {
- DestroyShaderProgram(ctx, &ctx->shaders[i]);
- }
- SDL_free(ctx);
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/render/opengles2/SDL_shaders_gles2.c b/3rdparty/sdl2-2.0.4/src/render/opengles2/SDL_shaders_gles2.c
deleted file mode 100644
index 0c01a8c64e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/render/opengles2/SDL_shaders_gles2.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
-
-#include "SDL_video.h"
-#include "SDL_opengles2.h"
-#include "SDL_shaders_gles2.h"
-#include "SDL_stdinc.h"
-
-/*************************************************************************************************
- * Vertex/fragment shader source *
- *************************************************************************************************/
-
-static const Uint8 GLES2_VertexSrc_Default_[] = " \
- uniform mat4 u_projection; \
- attribute vec2 a_position; \
- attribute vec2 a_texCoord; \
- attribute float a_angle; \
- attribute vec2 a_center; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- float angle = radians(a_angle); \
- float c = cos(angle); \
- float s = sin(angle); \
- mat2 rotationMatrix = mat2(c, -s, s, c); \
- vec2 position = rotationMatrix * (a_position - a_center) + a_center; \
- v_texCoord = a_texCoord; \
- gl_Position = u_projection * vec4(position, 0.0, 1.0);\
- gl_PointSize = 1.0; \
- } \
-";
-
-static const Uint8 GLES2_FragmentSrc_SolidSrc_[] = " \
- precision mediump float; \
- uniform vec4 u_color; \
- \
- void main() \
- { \
- gl_FragColor = u_color; \
- } \
-";
-
-static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- gl_FragColor = texture2D(u_texture, v_texCoord); \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* ARGB to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureARGBSrc_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- vec4 abgr = texture2D(u_texture, v_texCoord); \
- gl_FragColor = abgr; \
- gl_FragColor.r = abgr.b; \
- gl_FragColor.b = abgr.r; \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* RGB to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureRGBSrc_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- vec4 abgr = texture2D(u_texture, v_texCoord); \
- gl_FragColor = abgr; \
- gl_FragColor.r = abgr.b; \
- gl_FragColor.b = abgr.r; \
- gl_FragColor.a = 1.0; \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* BGR to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureBGRSrc_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- vec4 abgr = texture2D(u_texture, v_texCoord); \
- gl_FragColor = abgr; \
- gl_FragColor.a = 1.0; \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* YUV to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureYUVSrc_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform sampler2D u_texture_u; \
- uniform sampler2D u_texture_v; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- mediump vec3 yuv; \
- lowp vec3 rgb; \
- yuv.x = texture2D(u_texture, v_texCoord).r; \
- yuv.y = texture2D(u_texture_u, v_texCoord).r - 0.5; \
- yuv.z = texture2D(u_texture_v, v_texCoord).r - 0.5; \
- rgb = mat3( 1, 1, 1, \
- 0, -0.39465, 2.03211, \
- 1.13983, -0.58060, 0) * yuv; \
- gl_FragColor = vec4(rgb, 1); \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* NV12 to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureNV12Src_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform sampler2D u_texture_u; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- mediump vec3 yuv; \
- lowp vec3 rgb; \
- yuv.x = texture2D(u_texture, v_texCoord).r; \
- yuv.yz = texture2D(u_texture_u, v_texCoord).ra - 0.5; \
- rgb = mat3( 1, 1, 1, \
- 0, -0.39465, 2.03211, \
- 1.13983, -0.58060, 0) * yuv; \
- gl_FragColor = vec4(rgb, 1); \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-/* NV21 to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureNV21Src_[] = " \
- precision mediump float; \
- uniform sampler2D u_texture; \
- uniform sampler2D u_texture_u; \
- uniform vec4 u_modulation; \
- varying vec2 v_texCoord; \
- \
- void main() \
- { \
- mediump vec3 yuv; \
- lowp vec3 rgb; \
- yuv.x = texture2D(u_texture, v_texCoord).r; \
- yuv.yz = texture2D(u_texture_u, v_texCoord).ar - 0.5; \
- rgb = mat3( 1, 1, 1, \
- 0, -0.39465, 2.03211, \
- 1.13983, -0.58060, 0) * yuv; \
- gl_FragColor = vec4(rgb, 1); \
- gl_FragColor *= u_modulation; \
- } \
-";
-
-static const GLES2_ShaderInstance GLES2_VertexSrc_Default = {
- GL_VERTEX_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_VertexSrc_Default_),
- GLES2_VertexSrc_Default_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_SolidSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_SolidSrc_),
- GLES2_FragmentSrc_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureABGRSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureABGRSrc_),
- GLES2_FragmentSrc_TextureABGRSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureARGBSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureARGBSrc_),
- GLES2_FragmentSrc_TextureARGBSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureRGBSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureRGBSrc_),
- GLES2_FragmentSrc_TextureRGBSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureBGRSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureBGRSrc_),
- GLES2_FragmentSrc_TextureBGRSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureYUVSrc = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureYUVSrc_),
- GLES2_FragmentSrc_TextureYUVSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureNV12Src = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureNV12Src_),
- GLES2_FragmentSrc_TextureNV12Src_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureNV21Src = {
- GL_FRAGMENT_SHADER,
- GLES2_SOURCE_SHADER,
- sizeof(GLES2_FragmentSrc_TextureNV21Src_),
- GLES2_FragmentSrc_TextureNV21Src_
-};
-
-
-/*************************************************************************************************
- * Vertex/fragment shader binaries (NVIDIA Tegra 1/2) *
- *************************************************************************************************/
-
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-
-#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
-
-static const Uint8 GLES2_VertexTegra_Default_[] = {
- 243, 193, 1, 142, 31, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 2, 0, 0, 0, 85, 0, 0, 0, 2, 0, 0, 0, 24, 0, 0, 0, 3, 0, 0, 0,
- 91, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0, 5, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 95, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
- 13, 0, 0, 0, 102, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 0, 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 17, 0, 0, 0, 112, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 112, 0, 0, 0, 80, 0, 0, 0, 80, 0, 0, 0, 19, 0, 0, 0, 132, 0,
- 0, 0, 104, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
- 95, 112, 111, 115, 105, 116, 105, 111, 110, 0, 97, 95, 116, 101, 120, 67, 111, 111, 114, 100,
- 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 112, 114, 111, 106, 101, 99,
- 116, 105, 111, 110, 0, 0, 0, 0, 0, 0, 0, 82, 139, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 80, 139, 0,
- 0, 1, 0, 0, 0, 22, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 33, 0, 0, 0, 92, 139, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 240, 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 64, 0, 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 193, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 66, 24, 0, 6, 34, 108, 28,
- 0, 0, 42, 16, 128, 0, 195, 192, 6, 129, 252, 255, 65, 96, 108, 28, 0, 0, 0, 0, 0, 1, 195, 192,
- 6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 8, 1, 64, 0, 131, 192, 6, 1, 156, 159, 65, 96, 108,
- 28, 0, 0, 85, 32, 0, 1, 195, 192, 6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 0, 64, 64, 0, 131,
- 192, 134, 1, 152, 31, 65, 96, 108, 156, 31, 64, 127, 48, 0, 1, 195, 192, 6, 129, 129, 255, 33,
- 96
-};
-
-static const Uint8 GLES2_FragmentTegra_None_SolidSrc_[] = {
- 155, 191, 159, 1, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
- 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
- 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
- 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0,
- 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1,
- 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0, 0, 0,
- 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 0, 40, 0, 0, 0, 242, 65, 63,
- 192, 200, 0, 0, 0, 242, 65, 63, 128, 168, 0, 0, 0, 242, 65, 63, 64, 72, 0, 0, 0, 242, 65, 63,
- 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Alpha_SolidSrc_[] = {
- 169, 153, 195, 28, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
- 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
- 0, 220, 0, 0, 0, 220, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
- 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 118, 118, 17, 241, 0, 0, 0, 240, 0,
- 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 21, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
- 1, 0, 0, 0, 3, 0, 0, 0, 3, 0, 65, 37, 8, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 21, 0,
- 0, 0, 0, 3, 0, 1, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 39, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, 24, 0, 4, 40, 232, 231, 15,
- 0, 0, 242, 65, 62, 194, 72, 1, 0, 0, 250, 65, 63, 194, 40, 1, 0, 0, 250, 65, 63, 192, 168, 1,
- 0, 0, 242, 1, 64, 192, 168, 1, 0, 0, 242, 1, 68, 168, 32, 0, 0, 0, 50, 64, 0, 192, 168, 15,
- 0, 0, 242, 1, 66, 168, 64, 0, 16, 0, 242, 65, 1, 232, 231, 15, 0, 0, 242, 65, 62, 168, 160,
- 0, 0, 0, 50, 64, 2, 104, 192, 0, 0, 36, 48, 66, 4, 232, 231, 15, 0, 0, 242, 65, 62, 3, 0, 6,
- 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 41, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Additive_SolidSrc_[] = {
- 59, 71, 42, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0,
- 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
- 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
- 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
- 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 22, 22, 17, 241, 0, 0, 0, 240, 0,
- 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
- 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0,
- 0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 192, 200, 0, 0, 0, 26,
- 0, 70, 192, 40, 0, 0, 0, 2, 0, 64, 192, 72, 0, 0, 0, 10, 0, 66, 192, 168, 0, 0, 0, 18, 0, 68,
- 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Modulated_SolidSrc_[] = {
- 37, 191, 49, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0,
- 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
- 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
- 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
- 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 32, 32, 17, 241, 0, 0, 0, 240, 0,
- 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
- 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0,
- 0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242,
- 1, 70, 8, 32, 0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68,
- 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_None_TextureSrc_[] = {
- 220, 217, 41, 211, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
- 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
- 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
- 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
- 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
- 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
- 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
- 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0,
- 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 1, 0, 0, 0, 2, 0, 4, 38, 186, 81, 78, 16, 2, 1, 0, 0, 1, 0,
- 1, 39, 0, 4, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242, 1, 70, 8, 32,
- 0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68, 1, 0, 6, 40,
- 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Alpha_TextureSrc_[] = {
- 71, 202, 114, 229, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
- 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
- 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
- 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
- 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
- 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
- 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 118, 118, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0,
- 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0,
- 1, 0, 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0,
- 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186,
- 81, 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0,
- 0, 0, 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0,
- 0, 242, 1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 154, 192, 0, 0, 37, 34, 64, 3, 8, 32, 0, 0, 5, 58,
- 208, 4, 40, 64, 0, 0, 5, 50, 208, 4, 72, 160, 0, 0, 37, 42, 208, 4, 2, 0, 6, 40, 0, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Additive_TextureSrc_[] = {
- 161, 234, 193, 234, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
- 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
- 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
- 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
- 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
- 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
- 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 22, 22, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
- 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0,
- 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0,
- 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81,
- 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0,
- 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 104, 32, 1, 0, 0, 242, 1, 70, 8, 192, 1, 0, 0, 242,
- 1, 64, 72, 64, 1, 0, 0, 242, 1, 68, 136, 192, 0, 0, 0, 26, 64, 4, 136, 32, 0, 0, 0, 2, 64, 7,
- 136, 64, 0, 0, 0, 10, 64, 6, 136, 160, 0, 0, 0, 18, 64, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Modulated_TextureSrc_[] = {
- 75, 132, 201, 227, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
- 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
- 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
- 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
- 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
- 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
- 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
- 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
- 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
- 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 32, 32, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
- 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0,
- 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0,
- 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81,
- 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0,
- 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0, 0, 242,
- 1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 104, 192, 0, 0, 0, 242, 65, 4, 232, 32, 0, 0, 0, 242, 65,
- 0, 40, 64, 0, 0, 0, 242, 65, 6, 72, 160, 0, 0, 0, 242, 65, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const GLES2_ShaderInstance GLES2_VertexTegra_Default = {
- GL_VERTEX_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_VertexTegra_Default_),
- GLES2_VertexTegra_Default_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_None_SolidSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_None_SolidSrc_),
- GLES2_FragmentTegra_None_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_SolidSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Alpha_SolidSrc_),
- GLES2_FragmentTegra_Alpha_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_SolidSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Additive_SolidSrc_),
- GLES2_FragmentTegra_Additive_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_SolidSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Modulated_SolidSrc_),
- GLES2_FragmentTegra_Modulated_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_None_TextureSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_None_TextureSrc_),
- GLES2_FragmentTegra_None_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_TextureSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Alpha_TextureSrc_),
- GLES2_FragmentTegra_Alpha_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_TextureSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Additive_TextureSrc_),
- GLES2_FragmentTegra_Additive_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_TextureSrc = {
- GL_FRAGMENT_SHADER,
- GL_NVIDIA_PLATFORM_BINARY_NV,
- sizeof(GLES2_FragmentTegra_Modulated_TextureSrc_),
- GLES2_FragmentTegra_Modulated_TextureSrc_
-};
-
-#endif /* GLES2_INCLUDE_NVIDIA_SHADERS */
-
-/*************************************************************************************************
- * Vertex/fragment shader definitions *
- *************************************************************************************************/
-
-static GLES2_Shader GLES2_VertexShader_Default = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_VertexTegra_Default,
-#endif
- &GLES2_VertexSrc_Default
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_None_SolidSrc,
-#endif
- &GLES2_FragmentSrc_SolidSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Alpha_SolidSrc,
-#endif
- &GLES2_FragmentSrc_SolidSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Additive_SolidSrc,
-#endif
- &GLES2_FragmentSrc_SolidSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Modulated_SolidSrc,
-#endif
- &GLES2_FragmentSrc_SolidSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_None_TextureSrc,
-#endif
- &GLES2_FragmentSrc_TextureABGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Alpha_TextureSrc,
-#endif
- &GLES2_FragmentSrc_TextureABGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Additive_TextureSrc,
-#endif
- &GLES2_FragmentSrc_TextureABGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- 2,
-#else
- 1,
-#endif
- {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
- &GLES2_FragmentTegra_Modulated_TextureSrc,
-#endif
- &GLES2_FragmentSrc_TextureABGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureARGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureARGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureARGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureARGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureARGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureARGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureARGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureARGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureRGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureRGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureRGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureRGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureRGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureRGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureRGBSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureRGBSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureBGRSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureBGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureBGRSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureBGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureBGRSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureBGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureBGRSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureBGRSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_TextureYUVSrc = {
- 1,
- {
- &GLES2_FragmentSrc_TextureYUVSrc
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_TextureNV12Src = {
- 1,
- {
- &GLES2_FragmentSrc_TextureNV12Src
- }
-};
-
-static GLES2_Shader GLES2_FragmentShader_TextureNV21Src = {
- 1,
- {
- &GLES2_FragmentSrc_TextureNV21Src
- }
-};
-
-
-/*************************************************************************************************
- * Shader selector *
- *************************************************************************************************/
-
-const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode)
-{
- switch (type) {
- case GLES2_SHADER_VERTEX_DEFAULT:
- return &GLES2_VertexShader_Default;
- case GLES2_SHADER_FRAGMENT_SOLID_SRC:
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
- return &GLES2_FragmentShader_None_SolidSrc;
- case SDL_BLENDMODE_BLEND:
- return &GLES2_FragmentShader_Alpha_SolidSrc;
- case SDL_BLENDMODE_ADD:
- return &GLES2_FragmentShader_Additive_SolidSrc;
- case SDL_BLENDMODE_MOD:
- return &GLES2_FragmentShader_Modulated_SolidSrc;
- default:
- return NULL;
- }
- case GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC:
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
- return &GLES2_FragmentShader_None_TextureABGRSrc;
- case SDL_BLENDMODE_BLEND:
- return &GLES2_FragmentShader_Alpha_TextureABGRSrc;
- case SDL_BLENDMODE_ADD:
- return &GLES2_FragmentShader_Additive_TextureABGRSrc;
- case SDL_BLENDMODE_MOD:
- return &GLES2_FragmentShader_Modulated_TextureABGRSrc;
- default:
- return NULL;
- }
- case GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC:
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
- return &GLES2_FragmentShader_None_TextureARGBSrc;
- case SDL_BLENDMODE_BLEND:
- return &GLES2_FragmentShader_Alpha_TextureARGBSrc;
- case SDL_BLENDMODE_ADD:
- return &GLES2_FragmentShader_Additive_TextureARGBSrc;
- case SDL_BLENDMODE_MOD:
- return &GLES2_FragmentShader_Modulated_TextureARGBSrc;
- default:
- return NULL;
- }
-
- case GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC:
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
- return &GLES2_FragmentShader_None_TextureRGBSrc;
- case SDL_BLENDMODE_BLEND:
- return &GLES2_FragmentShader_Alpha_TextureRGBSrc;
- case SDL_BLENDMODE_ADD:
- return &GLES2_FragmentShader_Additive_TextureRGBSrc;
- case SDL_BLENDMODE_MOD:
- return &GLES2_FragmentShader_Modulated_TextureRGBSrc;
- default:
- return NULL;
- }
-
- case GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC:
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
- return &GLES2_FragmentShader_None_TextureBGRSrc;
- case SDL_BLENDMODE_BLEND:
- return &GLES2_FragmentShader_Alpha_TextureBGRSrc;
- case SDL_BLENDMODE_ADD:
- return &GLES2_FragmentShader_Additive_TextureBGRSrc;
- case SDL_BLENDMODE_MOD:
- return &GLES2_FragmentShader_Modulated_TextureBGRSrc;
- default:
- return NULL;
- }
-
- case GLES2_SHADER_FRAGMENT_TEXTURE_YUV_SRC:
- {
- return &GLES2_FragmentShader_TextureYUVSrc;
- }
-
- case GLES2_SHADER_FRAGMENT_TEXTURE_NV12_SRC:
- {
- return &GLES2_FragmentShader_TextureNV12Src;
- }
-
- case GLES2_SHADER_FRAGMENT_TEXTURE_NV21_SRC:
- {
- return &GLES2_FragmentShader_TextureNV21Src;
- }
-
- default:
- return NULL;
- }
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/stdlib/SDL_qsort.c b/3rdparty/sdl2-2.0.4/src/stdlib/SDL_qsort.c
deleted file mode 100644
index 0d1978424d..0000000000
--- a/3rdparty/sdl2-2.0.4/src/stdlib/SDL_qsort.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/* qsort.c
- * (c) 1998 Gareth McCaughan
- *
- * This is a drop-in replacement for the C library's |qsort()| routine.
- *
- * Features:
- * - Median-of-three pivoting (and more)
- * - Truncation and final polishing by a single insertion sort
- * - Early truncation when no swaps needed in pivoting step
- * - Explicit recursion, guaranteed not to overflow
- * - A few little wrinkles stolen from the GNU |qsort()|.
- * - separate code for non-aligned / aligned / word-size objects
- *
- * This code may be reproduced freely provided
- * - this file is retained unaltered apart from minor
- * changes for portability and efficiency
- * - no changes are made to this comment
- * - any changes that *are* made are clearly flagged
- * - the _ID string below is altered by inserting, after
- * the date, the string " altered" followed at your option
- * by other material. (Exceptions: you may change the name
- * of the exported routine without changing the ID string.
- * You may change the values of the macros TRUNC_* and
- * PIVOT_THRESHOLD without changing the ID string, provided
- * they remain constants with TRUNC_nonaligned, TRUNC_aligned
- * and TRUNC_words/WORD_BYTES between 8 and 24, and
- * PIVOT_THRESHOLD between 32 and 200.)
- *
- * You may use it in anything you like; you may make money
- * out of it; you may distribute it in object form or as
- * part of an executable without including source code;
- * you don't have to credit me. (But it would be nice if
- * you did.)
- *
- * If you find problems with this code, or find ways of
- * making it significantly faster, please let me know!
- * My e-mail address, valid as of early 1998 and certainly
- * OK for at least the next 18 months, is
- * gjm11@dpmms.cam.ac.uk
- * Thanks!
- *
- * Gareth McCaughan Peterhouse Cambridge 1998
- */
-
-#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
-#define SDL_DISABLE_ANALYZE_MACROS 1
-#endif
-
-#include "../SDL_internal.h"
-
-/*
-#include
-#include
-#include
-*/
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-
-#if defined(HAVE_QSORT)
-void
-SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *))
-{
- qsort(base, nmemb, size, compare);
-}
-#else
-
-#ifdef assert
-#undef assert
-#endif
-#define assert(X) SDL_assert(X)
-#ifdef malloc
-#undef malloc
-#endif
-#define malloc SDL_malloc
-#ifdef free
-#undef free
-#endif
-#define free SDL_free
-#ifdef memcpy
-#undef memcpy
-#endif
-#define memcpy SDL_memcpy
-#ifdef memmove
-#undef memmove
-#endif
-#define memmove SDL_memmove
-#ifdef qsort
-#undef qsort
-#endif
-#define qsort SDL_qsort
-
-static const char _ID[] = "";
-
-/* How many bytes are there per word? (Must be a power of 2,
- * and must in fact equal sizeof(int).)
- */
-#define WORD_BYTES sizeof(int)
-
-/* How big does our stack need to be? Answer: one entry per
- * bit in a |size_t|.
- */
-#define STACK_SIZE (8*sizeof(size_t))
-
-/* Different situations have slightly different requirements,
- * and we make life epsilon easier by using different truncation
- * points for the three different cases.
- * So far, I have tuned TRUNC_words and guessed that the same
- * value might work well for the other two cases. Of course
- * what works well on my machine might work badly on yours.
- */
-#define TRUNC_nonaligned 12
-#define TRUNC_aligned 12
-#define TRUNC_words 12*WORD_BYTES /* nb different meaning */
-
-/* We use a simple pivoting algorithm for shortish sub-arrays
- * and a more complicated one for larger ones. The threshold
- * is PIVOT_THRESHOLD.
- */
-#define PIVOT_THRESHOLD 40
-
-typedef struct
-{
- char *first;
- char *last;
-} stack_entry;
-#define pushLeft {stack[stacktop].first=ffirst;stack[stacktop++].last=last;}
-#define pushRight {stack[stacktop].first=first;stack[stacktop++].last=llast;}
-#define doLeft {first=ffirst;llast=last;continue;}
-#define doRight {ffirst=first;last=llast;continue;}
-#define pop {if (--stacktop<0) break;\
- first=ffirst=stack[stacktop].first;\
- last=llast=stack[stacktop].last;\
- continue;}
-
-/* Some comments on the implementation.
- * 1. When we finish partitioning the array into "low"
- * and "high", we forget entirely about short subarrays,
- * because they'll be done later by insertion sort.
- * Doing lots of little insertion sorts might be a win
- * on large datasets for locality-of-reference reasons,
- * but it makes the code much nastier and increases
- * bookkeeping overhead.
- * 2. We always save the shorter and get to work on the
- * longer. This guarantees that every time we push
- * an item onto the stack its size is <= 1/2 of that
- * of its parent; so the stack can't need more than
- * log_2(max-array-size) entries.
- * 3. We choose a pivot by looking at the first, last
- * and middle elements. We arrange them into order
- * because it's easy to do that in conjunction with
- * choosing the pivot, and it makes things a little
- * easier in the partitioning step. Anyway, the pivot
- * is the middle of these three. It's still possible
- * to construct datasets where the algorithm takes
- * time of order n^2, but it simply never happens in
- * practice.
- * 3' Newsflash: On further investigation I find that
- * it's easy to construct datasets where median-of-3
- * simply isn't good enough. So on large-ish subarrays
- * we do a more sophisticated pivoting: we take three
- * sets of 3 elements, find their medians, and then
- * take the median of those.
- * 4. We copy the pivot element to a separate place
- * because that way we can always do our comparisons
- * directly against a pointer to that separate place,
- * and don't have to wonder "did we move the pivot
- * element?". This makes the inner loop better.
- * 5. It's possible to make the pivoting even more
- * reliable by looking at more candidates when n
- * is larger. (Taking this to its logical conclusion
- * results in a variant of quicksort that doesn't
- * have that n^2 worst case.) However, the overhead
- * from the extra bookkeeping means that it's just
- * not worth while.
- * 6. This is pretty clean and portable code. Here are
- * all the potential portability pitfalls and problems
- * I know of:
- * - In one place (the insertion sort) I construct
- * a pointer that points just past the end of the
- * supplied array, and assume that (a) it won't
- * compare equal to any pointer within the array,
- * and (b) it will compare equal to a pointer
- * obtained by stepping off the end of the array.
- * These might fail on some segmented architectures.
- * - I assume that there are 8 bits in a |char| when
- * computing the size of stack needed. This would
- * fail on machines with 9-bit or 16-bit bytes.
- * - I assume that if |((int)base&(sizeof(int)-1))==0|
- * and |(size&(sizeof(int)-1))==0| then it's safe to
- * get at array elements via |int*|s, and that if
- * actually |size==sizeof(int)| as well then it's
- * safe to treat the elements as |int|s. This might
- * fail on systems that convert pointers to integers
- * in non-standard ways.
- * - I assume that |8*sizeof(size_t)<=INT_MAX|. This
- * would be false on a machine with 8-bit |char|s,
- * 16-bit |int|s and 4096-bit |size_t|s. :-)
- */
-
-/* The recursion logic is the same in each case: */
-#define Recurse(Trunc) \
- { size_t l=last-ffirst,r=llast-first; \
- if (l=Trunc) doRight \
- else pop \
- } \
- else if (l<=r) { pushLeft; doRight } \
- else if (r>=Trunc) { pushRight; doLeft }\
- else doLeft \
- }
-
-/* and so is the pivoting logic: */
-#define Pivot(swapper,sz) \
- if ((size_t)(last-first)>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
- else { \
- if (compare(first,mid)<0) { \
- if (compare(mid,last)>0) { \
- swapper(mid,last); \
- if (compare(first,mid)>0) swapper(first,mid);\
- } \
- } \
- else { \
- if (compare(mid,last)>0) swapper(first,last)\
- else { \
- swapper(first,mid); \
- if (compare(mid,last)>0) swapper(mid,last);\
- } \
- } \
- first+=sz; last-=sz; \
- }
-
-#ifdef DEBUG_QSORT
-#include
-#endif
-
-/* and so is the partitioning logic: */
-#define Partition(swapper,sz) { \
- int swapped=0; \
- do { \
- while (compare(first,pivot)<0) first+=sz; \
- while (compare(pivot,last)<0) last-=sz; \
- if (firstlimit ? limit : nmemb-1)*sz;\
- while (last!=base) { \
- if (compare(first,last)>0) first=last; \
- last-=sz; } \
- if (first!=base) swapper(first,(char*)base);
-
-/* and so is the insertion sort, in the first two cases: */
-#define Insertion(swapper) \
- last=((char*)base)+nmemb*size; \
- for (first=((char*)base)+size;first!=last;first+=size) { \
- char *test; \
- /* Find the right place for |first|. \
- * My apologies for var reuse. */ \
- for (test=first-size;compare(test,first)>0;test-=size) ; \
- test+=size; \
- if (test!=first) { \
- /* Shift everything in [test,first) \
- * up by one, and place |first| \
- * where |test| is. */ \
- memcpy(pivot,first,size); \
- memmove(test+size,test,first-test); \
- memcpy(test,pivot,size); \
- } \
- }
-
-#define SWAP_nonaligned(a,b) { \
- register char *aa=(a),*bb=(b); \
- register size_t sz=size; \
- do { register char t=*aa; *aa++=*bb; *bb++=t; } while (--sz); }
-
-#define SWAP_aligned(a,b) { \
- register int *aa=(int*)(a),*bb=(int*)(b); \
- register size_t sz=size; \
- do { register int t=*aa;*aa++=*bb; *bb++=t; } while (sz-=WORD_BYTES); }
-
-#define SWAP_words(a,b) { \
- register int t=*((int*)a); *((int*)a)=*((int*)b); *((int*)b)=t; }
-
-/* ---------------------------------------------------------------------- */
-
-static char *
-pivot_big(char *first, char *mid, char *last, size_t size,
- int compare(const void *, const void *))
-{
- size_t d = (((last - first) / size) >> 3) * size;
- char *m1, *m2, *m3;
- {
- char *a = first, *b = first + d, *c = first + 2 * d;
-#ifdef DEBUG_QSORT
- fprintf(stderr, "< %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
- m1 = compare(a, b) < 0 ?
- (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
- : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
- }
- {
- char *a = mid - d, *b = mid, *c = mid + d;
-#ifdef DEBUG_QSORT
- fprintf(stderr, ". %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
- m2 = compare(a, b) < 0 ?
- (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
- : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
- }
- {
- char *a = last - 2 * d, *b = last - d, *c = last;
-#ifdef DEBUG_QSORT
- fprintf(stderr, "> %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
- m3 = compare(a, b) < 0 ?
- (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
- : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
- }
-#ifdef DEBUG_QSORT
- fprintf(stderr, "-> %d %d %d\n", *(int *) m1, *(int *) m2, *(int *) m3);
-#endif
- return compare(m1, m2) < 0 ?
- (compare(m2, m3) < 0 ? m2 : (compare(m1, m3) < 0 ? m3 : m1))
- : (compare(m1, m3) < 0 ? m1 : (compare(m2, m3) < 0 ? m3 : m2));
-}
-
-/* ---------------------------------------------------------------------- */
-
-static void
-qsort_nonaligned(void *base, size_t nmemb, size_t size,
- int (*compare) (const void *, const void *))
-{
-
- stack_entry stack[STACK_SIZE];
- int stacktop = 0;
- char *first, *last;
- char *pivot = malloc(size);
- size_t trunc = TRUNC_nonaligned * size;
- assert(pivot != 0);
-
- first = (char *) base;
- last = first + (nmemb - 1) * size;
-
- if ((size_t) (last - first) > trunc) {
- char *ffirst = first, *llast = last;
- while (1) {
- /* Select pivot */
- {
- char *mid = first + size * ((last - first) / size >> 1);
- Pivot(SWAP_nonaligned, size);
- memcpy(pivot, mid, size);
- }
- /* Partition. */
- Partition(SWAP_nonaligned, size);
- /* Prepare to recurse/iterate. */
- Recurse(trunc)}
- }
- PreInsertion(SWAP_nonaligned, TRUNC_nonaligned, size);
- Insertion(SWAP_nonaligned);
- free(pivot);
-}
-
-static void
-qsort_aligned(void *base, size_t nmemb, size_t size,
- int (*compare) (const void *, const void *))
-{
-
- stack_entry stack[STACK_SIZE];
- int stacktop = 0;
- char *first, *last;
- char *pivot = malloc(size);
- size_t trunc = TRUNC_aligned * size;
- assert(pivot != 0);
-
- first = (char *) base;
- last = first + (nmemb - 1) * size;
-
- if ((size_t) (last - first) > trunc) {
- char *ffirst = first, *llast = last;
- while (1) {
- /* Select pivot */
- {
- char *mid = first + size * ((last - first) / size >> 1);
- Pivot(SWAP_aligned, size);
- memcpy(pivot, mid, size);
- }
- /* Partition. */
- Partition(SWAP_aligned, size);
- /* Prepare to recurse/iterate. */
- Recurse(trunc)}
- }
- PreInsertion(SWAP_aligned, TRUNC_aligned, size);
- Insertion(SWAP_aligned);
- free(pivot);
-}
-
-static void
-qsort_words(void *base, size_t nmemb,
- int (*compare) (const void *, const void *))
-{
-
- stack_entry stack[STACK_SIZE];
- int stacktop = 0;
- char *first, *last;
- char *pivot = malloc(WORD_BYTES);
- assert(pivot != 0);
-
- first = (char *) base;
- last = first + (nmemb - 1) * WORD_BYTES;
-
- if (last - first > TRUNC_words) {
- char *ffirst = first, *llast = last;
- while (1) {
-#ifdef DEBUG_QSORT
- fprintf(stderr, "Doing %d:%d: ",
- (first - (char *) base) / WORD_BYTES,
- (last - (char *) base) / WORD_BYTES);
-#endif
- /* Select pivot */
- {
- char *mid =
- first + WORD_BYTES * ((last - first) / (2 * WORD_BYTES));
- Pivot(SWAP_words, WORD_BYTES);
- *(int *) pivot = *(int *) mid;
- }
-#ifdef DEBUG_QSORT
- fprintf(stderr, "pivot=%d\n", *(int *) pivot);
-#endif
- /* Partition. */
- Partition(SWAP_words, WORD_BYTES);
- /* Prepare to recurse/iterate. */
- Recurse(TRUNC_words)}
- }
- PreInsertion(SWAP_words, (TRUNC_words / WORD_BYTES), WORD_BYTES);
- /* Now do insertion sort. */
- last = ((char *) base) + nmemb * WORD_BYTES;
- for (first = ((char *) base) + WORD_BYTES; first != last;
- first += WORD_BYTES) {
- /* Find the right place for |first|. My apologies for var reuse */
- int *pl = (int *) (first - WORD_BYTES), *pr = (int *) first;
- *(int *) pivot = *(int *) first;
- for (; compare(pl, pivot) > 0; pr = pl, --pl) {
- *pr = *pl;
- }
- if (pr != (int *) first)
- *pr = *(int *) pivot;
- }
- free(pivot);
-}
-
-/* ---------------------------------------------------------------------- */
-
-void
-qsort(void *base, size_t nmemb, size_t size,
- int (*compare) (const void *, const void *))
-{
-
- if (nmemb <= 1)
- return;
- if (((uintptr_t) base | size) & (WORD_BYTES - 1))
- qsort_nonaligned(base, nmemb, size, compare);
- else if (size != WORD_BYTES)
- qsort_aligned(base, nmemb, size, compare);
- else
- qsort_words(base, nmemb, compare);
-}
-
-#endif /* !SDL_qsort */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/android/SDL_androidmouse.c b/3rdparty/sdl2-2.0.4/src/video/android/SDL_androidmouse.c
deleted file mode 100644
index 3e9c0aff57..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/android/SDL_androidmouse.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-#include "SDL_androidmouse.h"
-
-#include "SDL_events.h"
-#include "../../events/SDL_mouse_c.h"
-
-#include "../../core/android/SDL_android.h"
-
-#define ACTION_DOWN 0
-#define ACTION_UP 1
-#define ACTION_HOVER_MOVE 7
-#define ACTION_SCROLL 8
-#define BUTTON_PRIMARY 1
-#define BUTTON_SECONDARY 2
-#define BUTTON_TERTIARY 4
-
-void Android_OnMouse( int androidButton, int action, float x, float y) {
- static Uint8 SDLButton;
-
- if (!Android_Window) {
- return;
- }
-
- switch(action) {
- case ACTION_DOWN:
- // Determine which button originated the event, and store it for ACTION_UP
- SDLButton = SDL_BUTTON_LEFT;
- if (androidButton == BUTTON_SECONDARY) {
- SDLButton = SDL_BUTTON_RIGHT;
- } else if (androidButton == BUTTON_TERTIARY) {
- SDLButton = SDL_BUTTON_MIDDLE;
- }
- SDL_SendMouseMotion(Android_Window, 0, 0, x, y);
- SDL_SendMouseButton(Android_Window, 0, SDL_PRESSED, SDLButton);
- break;
-
- case ACTION_UP:
- // Android won't give us the button that originated the ACTION_DOWN event, so we'll
- // assume it's the one we stored
- SDL_SendMouseMotion(Android_Window, 0, 0, x, y);
- SDL_SendMouseButton(Android_Window, 0, SDL_RELEASED, SDLButton);
- break;
-
- case ACTION_HOVER_MOVE:
- SDL_SendMouseMotion(Android_Window, 0, 0, x, y);
- break;
-
- case ACTION_SCROLL:
- SDL_SendMouseWheel(Android_Window, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
- break;
-
- default:
- break;
- }
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bclipboard.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bclipboard.cc
deleted file mode 100644
index fcd1caa269..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bclipboard.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-/* BWindow based framebuffer implementation */
-
-#include
-#include
-
-#include "SDL_BWin.h"
-#include "SDL_timer.h"
-#include "../SDL_sysvideo.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int BE_SetClipboardText(_THIS, const char *text) {
- BMessage *clip = NULL;
- if(be_clipboard->Lock()) {
- be_clipboard->Clear();
- if((clip = be_clipboard->Data())) {
- /* Presumably the string of characters is ascii-format */
- ssize_t asciiLength = 0;
- for(; text[asciiLength] != 0; ++asciiLength) {}
- clip->AddData("text/plain", B_MIME_TYPE, &text, asciiLength);
- be_clipboard->Commit();
- }
- be_clipboard->Unlock();
- }
- return 0;
-}
-
-char *BE_GetClipboardText(_THIS) {
- BMessage *clip = NULL;
- const char *text = NULL;
- ssize_t length;
- char *result;
- if(be_clipboard->Lock()) {
- if((clip = be_clipboard->Data())) {
- /* Presumably the string of characters is ascii-format */
- clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
- &length);
- } else {
- be_clipboard->Unlock();
- }
- be_clipboard->Unlock();
- }
-
- if (!text) {
- result = SDL_strdup("");
- } else {
- /* Copy the data and pass on to SDL */
- result = (char*)SDL_calloc(1, sizeof(char*)*length);
- SDL_strlcpy(result, text, length);
- }
-
- return result;
-}
-
-SDL_bool BE_HasClipboardText(_THIS) {
- SDL_bool result = SDL_FALSE;
- char *text = BE_GetClipboardText(_this);
- if (text) {
- result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
- SDL_free(text);
- }
- return result;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bframebuffer.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bframebuffer.cc
deleted file mode 100644
index 5e6a300e8e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bframebuffer.cc
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-#include "SDL_bframebuffer.h"
-
-#include
-#include
-#include "SDL_bmodes.h"
-#include "SDL_BWin.h"
-
-#include "../../main/haiku/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int32 BE_UpdateOnce(SDL_Window *window);
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
- return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
- return ((SDL_BApp*)be_app);
-}
-
-int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
- Uint32 * format,
- void ** pixels, int *pitch) {
- SDL_BWin *bwin = _ToBeWin(window);
- BScreen bscreen;
- if(!bscreen.IsValid()) {
- return -1;
- }
-
- while(!bwin->Connected()) { snooze(100); }
-
- /* Make sure we have exclusive access to frame buffer data */
- bwin->LockBuffer();
-
- /* format */
- display_mode bmode;
- bscreen.GetMode(&bmode);
- int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode.space);
- *format = BE_BPPToSDLPxFormat(bpp);
-
- /* Create the new bitmap object */
- BBitmap *bitmap = bwin->GetBitmap();
-
- if(bitmap) {
- delete bitmap;
- }
- bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
- false, /* Views not accepted */
- true); /* Contiguous memory required */
-
- if(bitmap->InitCheck() != B_OK) {
- return SDL_SetError("Could not initialize back buffer!\n");
- }
-
-
- bwin->SetBitmap(bitmap);
-
- /* Set the pixel pointer */
- *pixels = bitmap->Bits();
-
- /* pitch = width of window, in bytes */
- *pitch = bitmap->BytesPerRow();
-
- bwin->SetBufferExists(true);
- bwin->SetTrashBuffer(false);
- bwin->UnlockBuffer();
- return 0;
-}
-
-
-
-int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
- const SDL_Rect * rects, int numrects) {
- if(!window)
- return 0;
-
- SDL_BWin *bwin = _ToBeWin(window);
-
-#ifdef DRAWTHREAD
- bwin->LockBuffer();
- bwin->SetBufferDirty(true);
- bwin->UnlockBuffer();
-#else
- bwin->SetBufferDirty(true);
- BE_UpdateOnce(window);
-#endif
-
- return 0;
-}
-
-int32 BE_DrawThread(void *data) {
- SDL_BWin *bwin = (SDL_BWin*)data;
-
- BScreen bscreen;
- if(!bscreen.IsValid()) {
- return -1;
- }
-
- while(bwin->ConnectionEnabled()) {
- if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
- bwin->LockBuffer();
- BBitmap *bitmap = NULL;
- bitmap = bwin->GetBitmap();
- int32 windowPitch = bitmap->BytesPerRow();
- int32 bufferPitch = bwin->GetRowBytes();
- uint8 *windowpx;
- uint8 *bufferpx;
-
- int32 BPP = bwin->GetBytesPerPx();
- int32 windowSub = bwin->GetFbX() * BPP +
- bwin->GetFbY() * windowPitch;
- clipping_rect *clips = bwin->GetClips();
- int32 numClips = bwin->GetNumClips();
- int i, y;
-
- /* Blit each clipping rectangle */
- bscreen.WaitForRetrace();
- for(i = 0; i < numClips; ++i) {
- clipping_rect rc = clips[i];
- /* Get addresses of the start of each clipping rectangle */
- int32 width = clips[i].right - clips[i].left + 1;
- int32 height = clips[i].bottom - clips[i].top + 1;
- bufferpx = bwin->GetBufferPx() +
- clips[i].top * bufferPitch + clips[i].left * BPP;
- windowpx = (uint8*)bitmap->Bits() +
- clips[i].top * windowPitch + clips[i].left * BPP -
- windowSub;
-
- /* Copy each row of pixels from the window buffer into the frame
- buffer */
- for(y = 0; y < height; ++y)
- {
-
- if(bwin->CanTrashWindowBuffer()) {
- goto escape; /* Break out before the buffer is killed */
- }
-
- memcpy(bufferpx, windowpx, width * BPP);
- bufferpx += bufferPitch;
- windowpx += windowPitch;
- }
- }
-
- bwin->SetBufferDirty(false);
-escape:
- bwin->UnlockBuffer();
- } else {
- snooze(16000);
- }
- }
-
- return B_OK;
-}
-
-void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
- SDL_BWin *bwin = _ToBeWin(window);
-
- bwin->LockBuffer();
-
- /* Free and clear the window buffer */
- BBitmap *bitmap = bwin->GetBitmap();
- delete bitmap;
- bwin->SetBitmap(NULL);
- bwin->SetBufferExists(false);
- bwin->UnlockBuffer();
-}
-
-
-/*
- * TODO:
- * This was written to test if certain errors were caused by threading issues.
- * The specific issues have since become rare enough that they may have been
- * solved, but I doubt it- they were pretty sporadic before now.
- */
-int32 BE_UpdateOnce(SDL_Window *window) {
- SDL_BWin *bwin = _ToBeWin(window);
- BScreen bscreen;
- if(!bscreen.IsValid()) {
- return -1;
- }
-
- if(bwin->ConnectionEnabled() && bwin->Connected()) {
- bwin->LockBuffer();
- int32 windowPitch = window->surface->pitch;
- int32 bufferPitch = bwin->GetRowBytes();
- uint8 *windowpx;
- uint8 *bufferpx;
-
- int32 BPP = bwin->GetBytesPerPx();
- uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
- int32 windowSub = bwin->GetFbX() * BPP +
- bwin->GetFbY() * windowPitch;
- clipping_rect *clips = bwin->GetClips();
- int32 numClips = bwin->GetNumClips();
- int i, y;
-
- /* Blit each clipping rectangle */
- bscreen.WaitForRetrace();
- for(i = 0; i < numClips; ++i) {
- clipping_rect rc = clips[i];
- /* Get addresses of the start of each clipping rectangle */
- int32 width = clips[i].right - clips[i].left + 1;
- int32 height = clips[i].bottom - clips[i].top + 1;
- bufferpx = bwin->GetBufferPx() +
- clips[i].top * bufferPitch + clips[i].left * BPP;
- windowpx = windowBaseAddress +
- clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
-
- /* Copy each row of pixels from the window buffer into the frame
- buffer */
- for(y = 0; y < height; ++y)
- {
- memcpy(bufferpx, windowpx, width * BPP);
- bufferpx += bufferPitch;
- windowpx += windowPitch;
- }
- }
- bwin->UnlockBuffer();
- }
- return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bkeyboard.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bkeyboard.cc
deleted file mode 100644
index 0ae3d3fc10..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bkeyboard.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-#include
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_events.h"
-#include "SDL_keycode.h"
-
-#include "SDL_bkeyboard.h"
-
-
-#define KEYMAP_SIZE 128
-
-
-static SDL_Scancode keymap[KEYMAP_SIZE];
-static int8 keystate[KEYMAP_SIZE];
-
-void BE_InitOSKeymap() {
- for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
- keymap[i] = SDL_SCANCODE_UNKNOWN;
- }
-
- for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
- keystate[i] = SDL_RELEASED;
- }
-
- keymap[0x01] = SDL_GetScancodeFromKey(SDLK_ESCAPE);
- keymap[B_F1_KEY] = SDL_GetScancodeFromKey(SDLK_F1);
- keymap[B_F2_KEY] = SDL_GetScancodeFromKey(SDLK_F2);
- keymap[B_F3_KEY] = SDL_GetScancodeFromKey(SDLK_F3);
- keymap[B_F4_KEY] = SDL_GetScancodeFromKey(SDLK_F4);
- keymap[B_F5_KEY] = SDL_GetScancodeFromKey(SDLK_F5);
- keymap[B_F6_KEY] = SDL_GetScancodeFromKey(SDLK_F6);
- keymap[B_F7_KEY] = SDL_GetScancodeFromKey(SDLK_F7);
- keymap[B_F8_KEY] = SDL_GetScancodeFromKey(SDLK_F8);
- keymap[B_F9_KEY] = SDL_GetScancodeFromKey(SDLK_F9);
- keymap[B_F10_KEY] = SDL_GetScancodeFromKey(SDLK_F10);
- keymap[B_F11_KEY] = SDL_GetScancodeFromKey(SDLK_F11);
- keymap[B_F12_KEY] = SDL_GetScancodeFromKey(SDLK_F12);
- keymap[B_PRINT_KEY] = SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
- keymap[B_SCROLL_KEY] = SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
- keymap[B_PAUSE_KEY] = SDL_GetScancodeFromKey(SDLK_PAUSE);
- keymap[0x11] = SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
- keymap[0x12] = SDL_GetScancodeFromKey(SDLK_1);
- keymap[0x13] = SDL_GetScancodeFromKey(SDLK_2);
- keymap[0x14] = SDL_GetScancodeFromKey(SDLK_3);
- keymap[0x15] = SDL_GetScancodeFromKey(SDLK_4);
- keymap[0x16] = SDL_GetScancodeFromKey(SDLK_5);
- keymap[0x17] = SDL_GetScancodeFromKey(SDLK_6);
- keymap[0x18] = SDL_GetScancodeFromKey(SDLK_7);
- keymap[0x19] = SDL_GetScancodeFromKey(SDLK_8);
- keymap[0x1a] = SDL_GetScancodeFromKey(SDLK_9);
- keymap[0x1b] = SDL_GetScancodeFromKey(SDLK_0);
- keymap[0x1c] = SDL_GetScancodeFromKey(SDLK_MINUS);
- keymap[0x1d] = SDL_GetScancodeFromKey(SDLK_EQUALS);
- keymap[0x1e] = SDL_GetScancodeFromKey(SDLK_BACKSPACE);
- keymap[0x1f] = SDL_GetScancodeFromKey(SDLK_INSERT);
- keymap[0x20] = SDL_GetScancodeFromKey(SDLK_HOME);
- keymap[0x21] = SDL_GetScancodeFromKey(SDLK_PAGEUP);
- keymap[0x22] = SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
- keymap[0x23] = SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
- keymap[0x24] = SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
- keymap[0x25] = SDL_GetScancodeFromKey(SDLK_KP_MINUS);
- keymap[0x26] = SDL_GetScancodeFromKey(SDLK_TAB);
- keymap[0x27] = SDL_GetScancodeFromKey(SDLK_q);
- keymap[0x28] = SDL_GetScancodeFromKey(SDLK_w);
- keymap[0x29] = SDL_GetScancodeFromKey(SDLK_e);
- keymap[0x2a] = SDL_GetScancodeFromKey(SDLK_r);
- keymap[0x2b] = SDL_GetScancodeFromKey(SDLK_t);
- keymap[0x2c] = SDL_GetScancodeFromKey(SDLK_y);
- keymap[0x2d] = SDL_GetScancodeFromKey(SDLK_u);
- keymap[0x2e] = SDL_GetScancodeFromKey(SDLK_i);
- keymap[0x2f] = SDL_GetScancodeFromKey(SDLK_o);
- keymap[0x30] = SDL_GetScancodeFromKey(SDLK_p);
- keymap[0x31] = SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
- keymap[0x32] = SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
- keymap[0x33] = SDL_GetScancodeFromKey(SDLK_BACKSLASH);
- keymap[0x34] = SDL_GetScancodeFromKey(SDLK_DELETE);
- keymap[0x35] = SDL_GetScancodeFromKey(SDLK_END);
- keymap[0x36] = SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
- keymap[0x37] = SDL_GetScancodeFromKey(SDLK_KP_7);
- keymap[0x38] = SDL_GetScancodeFromKey(SDLK_KP_8);
- keymap[0x39] = SDL_GetScancodeFromKey(SDLK_KP_9);
- keymap[0x3a] = SDL_GetScancodeFromKey(SDLK_KP_PLUS);
- keymap[0x3b] = SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
- keymap[0x3c] = SDL_GetScancodeFromKey(SDLK_a);
- keymap[0x3d] = SDL_GetScancodeFromKey(SDLK_s);
- keymap[0x3e] = SDL_GetScancodeFromKey(SDLK_d);
- keymap[0x3f] = SDL_GetScancodeFromKey(SDLK_f);
- keymap[0x40] = SDL_GetScancodeFromKey(SDLK_g);
- keymap[0x41] = SDL_GetScancodeFromKey(SDLK_h);
- keymap[0x42] = SDL_GetScancodeFromKey(SDLK_j);
- keymap[0x43] = SDL_GetScancodeFromKey(SDLK_k);
- keymap[0x44] = SDL_GetScancodeFromKey(SDLK_l);
- keymap[0x45] = SDL_GetScancodeFromKey(SDLK_SEMICOLON);
- keymap[0x46] = SDL_GetScancodeFromKey(SDLK_QUOTE);
- keymap[0x47] = SDL_GetScancodeFromKey(SDLK_RETURN);
- keymap[0x48] = SDL_GetScancodeFromKey(SDLK_KP_4);
- keymap[0x49] = SDL_GetScancodeFromKey(SDLK_KP_5);
- keymap[0x4a] = SDL_GetScancodeFromKey(SDLK_KP_6);
- keymap[0x4b] = SDL_GetScancodeFromKey(SDLK_LSHIFT);
- keymap[0x4c] = SDL_GetScancodeFromKey(SDLK_z);
- keymap[0x4d] = SDL_GetScancodeFromKey(SDLK_x);
- keymap[0x4e] = SDL_GetScancodeFromKey(SDLK_c);
- keymap[0x4f] = SDL_GetScancodeFromKey(SDLK_v);
- keymap[0x50] = SDL_GetScancodeFromKey(SDLK_b);
- keymap[0x51] = SDL_GetScancodeFromKey(SDLK_n);
- keymap[0x52] = SDL_GetScancodeFromKey(SDLK_m);
- keymap[0x53] = SDL_GetScancodeFromKey(SDLK_COMMA);
- keymap[0x54] = SDL_GetScancodeFromKey(SDLK_PERIOD);
- keymap[0x55] = SDL_GetScancodeFromKey(SDLK_SLASH);
- keymap[0x56] = SDL_GetScancodeFromKey(SDLK_RSHIFT);
- keymap[0x57] = SDL_GetScancodeFromKey(SDLK_UP);
- keymap[0x58] = SDL_GetScancodeFromKey(SDLK_KP_1);
- keymap[0x59] = SDL_GetScancodeFromKey(SDLK_KP_2);
- keymap[0x5a] = SDL_GetScancodeFromKey(SDLK_KP_3);
- keymap[0x5b] = SDL_GetScancodeFromKey(SDLK_KP_ENTER);
- keymap[0x5c] = SDL_GetScancodeFromKey(SDLK_LCTRL);
- keymap[0x5d] = SDL_GetScancodeFromKey(SDLK_LALT);
- keymap[0x5e] = SDL_GetScancodeFromKey(SDLK_SPACE);
- keymap[0x5f] = SDL_GetScancodeFromKey(SDLK_RALT);
- keymap[0x60] = SDL_GetScancodeFromKey(SDLK_RCTRL);
- keymap[0x61] = SDL_GetScancodeFromKey(SDLK_LEFT);
- keymap[0x62] = SDL_GetScancodeFromKey(SDLK_DOWN);
- keymap[0x63] = SDL_GetScancodeFromKey(SDLK_RIGHT);
- keymap[0x64] = SDL_GetScancodeFromKey(SDLK_KP_0);
- keymap[0x65] = SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
- keymap[0x66] = SDL_GetScancodeFromKey(SDLK_LGUI);
- keymap[0x67] = SDL_GetScancodeFromKey(SDLK_RGUI);
- keymap[0x68] = SDL_GetScancodeFromKey(SDLK_MENU);
- keymap[0x69] = SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
- keymap[0x6a] = SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
- keymap[0x6b] = SDL_GetScancodeFromKey(SDLK_POWER);
-}
-
-SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey) {
- if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
- return keymap[bkey];
- } else {
- return SDL_SCANCODE_UNKNOWN;
- }
-}
-
-int8 BE_GetKeyState(int32 bkey) {
- if(bkey > 0 && bkey < KEYMAP_SIZE) {
- return keystate[bkey];
- } else {
- return SDL_RELEASED;
- }
-}
-
-void BE_SetKeyState(int32 bkey, int8 state) {
- if(bkey > 0 && bkey < KEYMAP_SIZE) {
- keystate[bkey] = state;
- }
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bmodes.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bmodes.cc
deleted file mode 100644
index 84aeb1f07b..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bmodes.cc
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-#include
-#include
-#include "SDL_bmodes.h"
-#include "SDL_BWin.h"
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_bopengl.h"
-#endif
-
-#include "../../main/haiku/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define WRAP_BMODE 1 /* FIXME: Some debate as to whether this is necessary */
-
-#if WRAP_BMODE
-/* This wrapper is here so that the driverdata can be freed without freeing
- the display_mode structure */
-typedef struct SDL_DisplayModeData {
- display_mode *bmode;
-};
-#endif
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
- return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
- return ((SDL_BApp*)be_app);
-}
-
-static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
-#if WRAP_BMODE
- return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
-#else
- return (display_mode*)(mode->driverdata);
-#endif
-}
-
-/* Copied from haiku/trunk/src/preferences/screen/ScreenMode.cpp */
-static float get_refresh_rate(display_mode &mode) {
- return float(mode.timing.pixel_clock * 1000)
- / float(mode.timing.h_total * mode.timing.v_total);
-}
-
-
-#if 0
-/* TODO:
- * This is a useful debugging tool. Uncomment and insert into code as needed.
- */
-void _SpoutModeData(display_mode *bmode) {
- printf("BMode:\n");
- printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
- printf("\th,v = (%i,%i)\n", bmode->h_display_start,
- bmode->v_display_start);
- if(bmode->flags) {
- printf("\tFlags:\n");
- if(bmode->flags & B_SCROLL) {
- printf("\t\tB_SCROLL\n");
- }
- if(bmode->flags & B_8_BIT_DAC) {
- printf("\t\tB_8_BIT_DAC\n");
- }
- if(bmode->flags & B_HARDWARE_CURSOR) {
- printf("\t\tB_HARDWARE_CURSOR\n");
- }
- if(bmode->flags & B_PARALLEL_ACCESS) {
- printf("\t\tB_PARALLEL_ACCESS\n");
- }
- if(bmode->flags & B_DPMS) {
- printf("\t\tB_DPMS\n");
- }
- if(bmode->flags & B_IO_FB_NA) {
- printf("\t\tB_IO_FB_NA\n");
- }
- }
- printf("\tTiming:\n");
- printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
- printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
- bmode->timing.h_display, bmode->timing.h_sync_start,
- bmode->timing.h_sync_end, bmode->timing.h_total);
- printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
- bmode->timing.v_display, bmode->timing.v_sync_start,
- bmode->timing.v_sync_end, bmode->timing.v_total);
- if(bmode->timing.flags) {
- printf("\t\tFlags:\n");
- if(bmode->timing.flags & B_BLANK_PEDESTAL) {
- printf("\t\t\tB_BLANK_PEDESTAL\n");
- }
- if(bmode->timing.flags & B_TIMING_INTERLACED) {
- printf("\t\t\tB_TIMING_INTERLACED\n");
- }
- if(bmode->timing.flags & B_POSITIVE_HSYNC) {
- printf("\t\t\tB_POSITIVE_HSYNC\n");
- }
- if(bmode->timing.flags & B_POSITIVE_VSYNC) {
- printf("\t\t\tB_POSITIVE_VSYNC\n");
- }
- if(bmode->timing.flags & B_SYNC_ON_GREEN) {
- printf("\t\t\tB_SYNC_ON_GREEN\n");
- }
- }
-}
-#endif
-
-
-
-int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace)
-{
- int bitsperpixel;
-
- bitsperpixel = 0;
- switch (colorspace) {
- case B_CMAP8:
- bitsperpixel = 8;
- break;
- case B_RGB15:
- case B_RGBA15:
- case B_RGB15_BIG:
- case B_RGBA15_BIG:
- bitsperpixel = 15;
- break;
- case B_RGB16:
- case B_RGB16_BIG:
- bitsperpixel = 16;
- break;
- case B_RGB32:
- case B_RGBA32:
- case B_RGB32_BIG:
- case B_RGBA32_BIG:
- bitsperpixel = 32;
- break;
- default:
- break;
- }
- return(bitsperpixel);
-}
-
-int32 BE_BPPToSDLPxFormat(int32 bpp) {
- /* Translation taken from SDL_windowsmodes.c */
- switch (bpp) {
- case 32:
- return SDL_PIXELFORMAT_RGB888;
- break;
- case 24: /* May not be supported by Haiku */
- return SDL_PIXELFORMAT_RGB24;
- break;
- case 16:
- return SDL_PIXELFORMAT_RGB565;
- break;
- case 15:
- return SDL_PIXELFORMAT_RGB555;
- break;
- case 8:
- return SDL_PIXELFORMAT_INDEX8;
- break;
- case 4: /* May not be supported by Haiku */
- return SDL_PIXELFORMAT_INDEX4LSB;
- break;
- }
-
- /* May never get here, but safer and needed to shut up compiler */
- SDL_SetError("Invalid bpp value");
- return 0;
-}
-
-static void _BDisplayModeToSdlDisplayMode(display_mode *bmode,
- SDL_DisplayMode *mode) {
- mode->w = bmode->virtual_width;
- mode->h = bmode->virtual_height;
- mode->refresh_rate = (int)get_refresh_rate(*bmode);
-
-#if WRAP_BMODE
- SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
- sizeof(SDL_DisplayModeData));
- data->bmode = bmode;
-
- mode->driverdata = data;
-
-#else
-
- mode->driverdata = bmode;
-#endif
-
- /* Set the format */
- int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode->space);
- mode->format = BE_BPPToSDLPxFormat(bpp);
-}
-
-/* Later, there may be more than one monitor available */
-static void _AddDisplay(BScreen *screen) {
- SDL_VideoDisplay display;
- SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
- sizeof(SDL_DisplayMode));
- display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
- screen->GetMode(bmode);
-
- _BDisplayModeToSdlDisplayMode(bmode, mode);
-
- SDL_zero(display);
- display.desktop_mode = *mode;
- display.current_mode = *mode;
-
- SDL_AddVideoDisplay(&display);
-}
-
-/*
- * Functions called by SDL
- */
-
-int BE_InitModes(_THIS) {
- BScreen screen;
-
- /* TODO: When Haiku supports multiple display screens, call
- _AddDisplayScreen() for each of them. */
- _AddDisplay(&screen);
- return 0;
-}
-
-int BE_QuitModes(_THIS) {
- /* FIXME: Nothing really needs to be done here at the moment? */
- return 0;
-}
-
-
-int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
- BScreen bscreen;
- BRect rc = bscreen.Frame();
- rect->x = (int)rc.left;
- rect->y = (int)rc.top;
- rect->w = (int)rc.Width() + 1;
- rect->h = (int)rc.Height() + 1;
- return 0;
-}
-
-void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
- /* Get the current screen */
- BScreen bscreen;
-
- /* Iterate through all of the modes */
- SDL_DisplayMode mode;
- display_mode this_bmode;
- display_mode *bmodes;
- uint32 count, i;
-
- /* Get graphics-hardware supported modes */
- bscreen.GetModeList(&bmodes, &count);
- bscreen.GetMode(&this_bmode);
-
- for(i = 0; i < count; ++i) {
- // FIXME: Apparently there are errors with colorspace changes
- if (bmodes[i].space == this_bmode.space) {
- _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
- SDL_AddDisplayMode(display, &mode);
- }
- }
- free(bmodes);
-}
-
-
-int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
- /* Get the current screen */
- BScreen bscreen;
- if(!bscreen.IsValid()) {
- printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
- }
-
- /* Set the mode using the driver data */
- display_mode *bmode = _ExtractBMode(mode);
-
-
- /* FIXME: Is the first option always going to be the right one? */
- uint32 c = 0, i;
- display_mode *bmode_list;
- bscreen.GetModeList(&bmode_list, &c);
- for(i = 0; i < c; ++i) {
- if( bmode_list[i].space == bmode->space &&
- bmode_list[i].virtual_width == bmode->virtual_width &&
- bmode_list[i].virtual_height == bmode->virtual_height ) {
- bmode = &bmode_list[i];
- break;
- }
- }
-
- if(bscreen.SetMode(bmode) != B_OK) {
- return SDL_SetError("Bad video mode\n");
- }
-
- free(bmode_list);
-
-#if SDL_VIDEO_OPENGL
- /* FIXME: Is there some way to reboot the OpenGL context? This doesn't
- help */
-// BE_GL_RebootContexts(_this);
-#endif
-
- return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bopengl.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bopengl.cc
deleted file mode 100644
index 15454f1007..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bopengl.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-#include "SDL_bopengl.h"
-
-#include
-#include
-#include
-#include "SDL_BWin.h"
-#include "../../main/haiku/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define BGL_FLAGS BGL_RGB | BGL_DOUBLE
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
- return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
- return ((SDL_BApp*)be_app);
-}
-
-/* Passing a NULL path means load pointers from the application */
-int BE_GL_LoadLibrary(_THIS, const char *path)
-{
-/* FIXME: Is this working correctly? */
- image_info info;
- int32 cookie = 0;
- while (get_next_image_info(0, &cookie, &info) == B_OK) {
- void *location = NULL;
- if( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY,
- &location) == B_OK) {
-
- _this->gl_config.dll_handle = (void *) info.id;
- _this->gl_config.driver_loaded = 1;
- SDL_strlcpy(_this->gl_config.driver_path, "libGL.so",
- SDL_arraysize(_this->gl_config.driver_path));
- }
- }
- return 0;
-}
-
-void *BE_GL_GetProcAddress(_THIS, const char *proc)
-{
- if (_this->gl_config.dll_handle != NULL) {
- void *location = NULL;
- status_t err;
- if ((err =
- get_image_symbol((image_id) _this->gl_config.dll_handle,
- proc, B_SYMBOL_TYPE_ANY,
- &location)) == B_OK) {
- return location;
- } else {
- SDL_SetError("Couldn't find OpenGL symbol");
- return NULL;
- }
- } else {
- SDL_SetError("OpenGL library not loaded");
- return NULL;
- }
-}
-
-
-
-
-void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
- _ToBeWin(window)->SwapBuffers();
-}
-
-int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
- _GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
- return 0;
-}
-
-
-SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
- /* FIXME: Not sure what flags should be included here; may want to have
- most of them */
- SDL_BWin *bwin = _ToBeWin(window);
- bwin->CreateGLView(BGL_FLAGS);
- return (SDL_GLContext)(bwin);
-}
-
-void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
- /* Currently, automatically unlocks the view */
- ((SDL_BWin*)context)->RemoveGLView();
-}
-
-
-int BE_GL_SetSwapInterval(_THIS, int interval) {
- /* TODO: Implement this, if necessary? */
- return 0;
-}
-
-int BE_GL_GetSwapInterval(_THIS) {
- /* TODO: Implement this, if necessary? */
- return 0;
-}
-
-
-void BE_GL_UnloadLibrary(_THIS) {
- /* TODO: Implement this, if necessary? */
-}
-
-
-/* FIXME: This function is meant to clear the OpenGL context when the video
- mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not
- currently in use. */
-void BE_GL_RebootContexts(_THIS) {
- SDL_Window *window = _this->windows;
- while(window) {
- SDL_BWin *bwin = _ToBeWin(window);
- if(bwin->GetGLView()) {
- bwin->LockLooper();
- bwin->RemoveGLView();
- bwin->CreateGLView(BGL_FLAGS);
- bwin->UnlockLooper();
- }
- window = window->next;
- }
-}
-
-
-#if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
-
- int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
- {
- /*
- FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
- */
- switch (attrib) {
- case SDL_GL_RED_SIZE:
- glGetIntegerv(GL_RED_BITS, (GLint *) value);
- break;
- case SDL_GL_GREEN_SIZE:
- glGetIntegerv(GL_GREEN_BITS, (GLint *) value);
- break;
- case SDL_GL_BLUE_SIZE:
- glGetIntegerv(GL_BLUE_BITS, (GLint *) value);
- break;
- case SDL_GL_ALPHA_SIZE:
- glGetIntegerv(GL_ALPHA_BITS, (GLint *) value);
- break;
- case SDL_GL_DOUBLEBUFFER:
- glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean *) value);
- break;
- case SDL_GL_BUFFER_SIZE:
- int v;
- glGetIntegerv(GL_RED_BITS, (GLint *) & v);
- *value = v;
- glGetIntegerv(GL_GREEN_BITS, (GLint *) & v);
- *value += v;
- glGetIntegerv(GL_BLUE_BITS, (GLint *) & v);
- *value += v;
- glGetIntegerv(GL_ALPHA_BITS, (GLint *) & v);
- *value += v;
- break;
- case SDL_GL_DEPTH_SIZE:
- glGetIntegerv(GL_DEPTH_BITS, (GLint *) value); /* Mesa creates 16 only? r5 always 32 */
- break;
- case SDL_GL_STENCIL_SIZE:
- glGetIntegerv(GL_STENCIL_BITS, (GLint *) value);
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- glGetIntegerv(GL_ACCUM_RED_BITS, (GLint *) value);
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint *) value);
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint *) value);
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint *) value);
- break;
- case SDL_GL_STEREO:
- case SDL_GL_MULTISAMPLEBUFFERS:
- case SDL_GL_MULTISAMPLESAMPLES:
- default:
- *value = 0;
- return (-1);
- }
- return 0;
- }
-
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bvideo.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bvideo.cc
deleted file mode 100644
index 8c243b7a04..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bvideo.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_bkeyboard.h"
-#include "SDL_bwindow.h"
-#include "SDL_bclipboard.h"
-#include "SDL_bvideo.h"
-#include "SDL_bopengl.h"
-#include "SDL_bmodes.h"
-#include "SDL_bframebuffer.h"
-#include "SDL_bevents.h"
-
-/* FIXME: Undefined functions */
-// #define BE_PumpEvents NULL
- #define BE_StartTextInput NULL
- #define BE_StopTextInput NULL
- #define BE_SetTextInputRect NULL
-
-// #define BE_DeleteDevice NULL
-
-/* End undefined functions */
-
-static SDL_VideoDevice *
-BE_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
- /*SDL_VideoData *data;*/
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-
- device->driverdata = NULL; /* FIXME: Is this the cause of some of the
- SDL_Quit() errors? */
-
-/* TODO: Figure out if any initialization needs to go here */
-
- /* Set the function pointers */
- device->VideoInit = BE_VideoInit;
- device->VideoQuit = BE_VideoQuit;
- device->GetDisplayBounds = BE_GetDisplayBounds;
- device->GetDisplayModes = BE_GetDisplayModes;
- device->SetDisplayMode = BE_SetDisplayMode;
- device->PumpEvents = BE_PumpEvents;
-
- device->CreateWindow = BE_CreateWindow;
- device->CreateWindowFrom = BE_CreateWindowFrom;
- device->SetWindowTitle = BE_SetWindowTitle;
- device->SetWindowIcon = BE_SetWindowIcon;
- device->SetWindowPosition = BE_SetWindowPosition;
- device->SetWindowSize = BE_SetWindowSize;
- device->ShowWindow = BE_ShowWindow;
- device->HideWindow = BE_HideWindow;
- device->RaiseWindow = BE_RaiseWindow;
- device->MaximizeWindow = BE_MaximizeWindow;
- device->MinimizeWindow = BE_MinimizeWindow;
- device->RestoreWindow = BE_RestoreWindow;
- device->SetWindowBordered = BE_SetWindowBordered;
- device->SetWindowFullscreen = BE_SetWindowFullscreen;
- device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
- device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
- device->SetWindowGrab = BE_SetWindowGrab;
- device->DestroyWindow = BE_DestroyWindow;
- device->GetWindowWMInfo = BE_GetWindowWMInfo;
- device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
- device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
- device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
-
- device->shape_driver.CreateShaper = NULL;
- device->shape_driver.SetWindowShape = NULL;
- device->shape_driver.ResizeWindowShape = NULL;
-
-
- device->GL_LoadLibrary = BE_GL_LoadLibrary;
- device->GL_GetProcAddress = BE_GL_GetProcAddress;
- device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
- device->GL_CreateContext = BE_GL_CreateContext;
- device->GL_MakeCurrent = BE_GL_MakeCurrent;
- device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
- device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
- device->GL_SwapWindow = BE_GL_SwapWindow;
- device->GL_DeleteContext = BE_GL_DeleteContext;
-
- device->StartTextInput = BE_StartTextInput;
- device->StopTextInput = BE_StopTextInput;
- device->SetTextInputRect = BE_SetTextInputRect;
-
- device->SetClipboardText = BE_SetClipboardText;
- device->GetClipboardText = BE_GetClipboardText;
- device->HasClipboardText = BE_HasClipboardText;
-
- device->free = BE_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap HAIKU_bootstrap = {
- "haiku", "Haiku graphics",
- BE_Available, BE_CreateDevice
-};
-
-void BE_DeleteDevice(SDL_VideoDevice * device)
-{
- SDL_free(device->driverdata);
- SDL_free(device);
-}
-
-int BE_VideoInit(_THIS)
-{
- /* Initialize the Be Application for appserver interaction */
- if (SDL_InitBeApp() < 0) {
- return -1;
- }
-
- /* Initialize video modes */
- BE_InitModes(_this);
-
- /* Init the keymap */
- BE_InitOSKeymap();
-
-
-#if SDL_VIDEO_OPENGL
- /* testgl application doesn't load library, just tries to load symbols */
- /* is it correct? if so we have to load library here */
- BE_GL_LoadLibrary(_this, NULL);
-#endif
-
- /* We're done! */
- return (0);
-}
-
-int BE_Available(void)
-{
- return (1);
-}
-
-void BE_VideoQuit(_THIS)
-{
-
- BE_QuitModes(_this);
-
- SDL_QuitBeApp();
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.cc b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.cc
deleted file mode 100644
index 287eac9653..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_HAIKU
-#include "../SDL_sysvideo.h"
-
-#include "SDL_BWin.h"
-#include
-
-/* Define a path to window's BWIN data */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
- return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
- return ((SDL_BApp*)be_app);
-}
-
-static int _InitWindow(_THIS, SDL_Window *window) {
- uint32 flags = 0;
- window_look look = B_BORDERED_WINDOW_LOOK;
-
- BRect bounds(
- window->x,
- window->y,
- window->x + window->w - 1, //BeWindows have an off-by-one px w/h thing
- window->y + window->h - 1
- );
-
- if(window->flags & SDL_WINDOW_FULLSCREEN) {
- /* TODO: Add support for this flag */
- printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
- }
- if(window->flags & SDL_WINDOW_OPENGL) {
- /* TODO: Add support for this flag */
- }
- if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
- flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
- }
- if(window->flags & SDL_WINDOW_BORDERLESS) {
- look = B_NO_BORDER_WINDOW_LOOK;
- }
-
- SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags);
- if(bwin == NULL)
- return ENOMEM;
-
- window->driverdata = bwin;
- int32 winID = _GetBeApp()->GetID(window);
- bwin->SetID(winID);
-
- return 0;
-}
-
-int BE_CreateWindow(_THIS, SDL_Window *window) {
- if(_InitWindow(_this, window) == ENOMEM)
- return ENOMEM;
-
- /* Start window loop */
- _ToBeWin(window)->Show();
- return 0;
-}
-
-int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
-
- SDL_BWin *otherBWin = (SDL_BWin*)data;
- if(!otherBWin->LockLooper())
- return -1;
-
- /* Create the new window and initialize its members */
- window->x = (int)otherBWin->Frame().left;
- window->y = (int)otherBWin->Frame().top;
- window->w = (int)otherBWin->Frame().Width();
- window->h = (int)otherBWin->Frame().Height();
-
- /* Set SDL flags */
- if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
- window->flags |= SDL_WINDOW_RESIZABLE;
- }
-
- /* If we are out of memory, return the error code */
- if(_InitWindow(_this, window) == ENOMEM)
- return ENOMEM;
-
- /* TODO: Add any other SDL-supported window attributes here */
- _ToBeWin(window)->SetTitle(otherBWin->Title());
-
- /* Start window loop and unlock the other window */
- _ToBeWin(window)->Show();
-
- otherBWin->UnlockLooper();
- return 0;
-}
-
-void BE_SetWindowTitle(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_SET_TITLE);
- msg.AddString("window-title", window->title);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
- /* FIXME: Icons not supported by Haiku */
-}
-
-void BE_SetWindowPosition(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_MOVE_WINDOW);
- msg.AddInt32("window-x", window->x);
- msg.AddInt32("window-y", window->y);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowSize(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_RESIZE_WINDOW);
- msg.AddInt32("window-w", window->w - 1);
- msg.AddInt32("window-h", window->h - 1);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
- BMessage msg(BWIN_SET_BORDERED);
- msg.AddBool("window-border", bordered != SDL_FALSE);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_ShowWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_SHOW_WINDOW);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_HideWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_HIDE_WINDOW);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_RaiseWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_SHOW_WINDOW); /* Activate this window and move to front */
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_MaximizeWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_MAXIMIZE_WINDOW);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_MinimizeWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_MINIMIZE_WINDOW);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_RestoreWindow(_THIS, SDL_Window * window) {
- BMessage msg(BWIN_RESTORE_WINDOW);
- _ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
- SDL_VideoDisplay * display, SDL_bool fullscreen) {
- /* Haiku tracks all video display information */
- BMessage msg(BWIN_FULLSCREEN);
- msg.AddBool("fullscreen", fullscreen);
- _ToBeWin(window)->PostMessage(&msg);
-
-}
-
-int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
- /* FIXME: Not Haiku supported */
- return -1;
-}
-
-int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
- /* FIXME: Not Haiku supported */
- return -1;
-}
-
-
-void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
- /* TODO: Implement this! */
-}
-
-void BE_DestroyWindow(_THIS, SDL_Window * window) {
- _ToBeWin(window)->LockLooper(); /* This MUST be locked */
- _GetBeApp()->ClearID(_ToBeWin(window));
- _ToBeWin(window)->Quit();
- window->driverdata = NULL;
-}
-
-SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
- struct SDL_SysWMinfo *info) {
- /* FIXME: What is the point of this? What information should be included? */
- return SDL_FALSE;
-}
-
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_HAIKU */
diff --git a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.h b/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.h
deleted file mode 100644
index f64530ab7b..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/haiku/SDL_bwindow.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BWINDOW_H
-#define SDL_BWINDOW_H
-
-
-#include "../SDL_sysvideo.h"
-
-
-extern int BE_CreateWindow(_THIS, SDL_Window *window);
-extern int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-extern void BE_SetWindowTitle(_THIS, SDL_Window * window);
-extern void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-extern void BE_SetWindowPosition(_THIS, SDL_Window * window);
-extern void BE_SetWindowSize(_THIS, SDL_Window * window);
-extern void BE_ShowWindow(_THIS, SDL_Window * window);
-extern void BE_HideWindow(_THIS, SDL_Window * window);
-extern void BE_RaiseWindow(_THIS, SDL_Window * window);
-extern void BE_MaximizeWindow(_THIS, SDL_Window * window);
-extern void BE_MinimizeWindow(_THIS, SDL_Window * window);
-extern void BE_RestoreWindow(_THIS, SDL_Window * window);
-extern void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
-extern void BE_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
-extern int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
-extern void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void BE_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
- struct SDL_SysWMinfo *info);
-
-
-
-#endif
-
diff --git a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirevents.c b/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirevents.c
deleted file mode 100644
index 708f8ffdec..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirevents.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer,
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_touch_c.h"
-#include "../../events/scancodes_xfree86.h"
-
-#include "SDL_mirevents.h"
-#include "SDL_mirwindow.h"
-
-#include
-
-#include "SDL_mirdyn.h"
-
-static void
-HandleKeyText(int32_t key_code)
-{
- char text[8];
- int size = 0;
-
- size = MIR_xkb_keysym_to_utf8(key_code, text, sizeof text);
-
- if (size > 0) {
- text[size] = '\0';
- SDL_SendKeyboardText(text);
- }
-}
-
-static void
-CheckKeyboardFocus(SDL_Window* sdl_window)
-{
- SDL_Window* keyboard_window = SDL_GetKeyboardFocus();
-
- if (keyboard_window != sdl_window)
- SDL_SetKeyboardFocus(sdl_window);
-}
-
-
-/* FIXME
- Mir still needs to implement its IM API, for now we assume
- a single key press produces a character.
-*/
-static void
-HandleKeyEvent(MirKeyEvent const ev, SDL_Window* window)
-{
- uint32_t scancode = SDL_SCANCODE_UNKNOWN;
- Uint8 key_state = ev.action == mir_key_action_up ? SDL_RELEASED : SDL_PRESSED;
-
- CheckKeyboardFocus(window);
-
- if (ev.scan_code < SDL_arraysize(xfree86_scancode_table2))
- scancode = xfree86_scancode_table2[ev.scan_code];
-
- if (scancode != SDL_SCANCODE_UNKNOWN)
- SDL_SendKeyboardKey(key_state, scancode);
-
- if (key_state == SDL_PRESSED)
- HandleKeyText(ev.key_code);
-}
-
-static void
-HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirMotionButton button_state)
-{
- static uint32_t last_sdl_button;
- uint32_t sdl_button;
-
- switch (button_state) {
- case mir_motion_button_primary:
- sdl_button = SDL_BUTTON_LEFT;
- break;
- case mir_motion_button_secondary:
- sdl_button = SDL_BUTTON_RIGHT;
- break;
- case mir_motion_button_tertiary:
- sdl_button = SDL_BUTTON_MIDDLE;
- break;
- case mir_motion_button_forward:
- sdl_button = SDL_BUTTON_X1;
- break;
- case mir_motion_button_back:
- sdl_button = SDL_BUTTON_X2;
- break;
- default:
- sdl_button = last_sdl_button;
- break;
- }
-
- last_sdl_button = sdl_button;
- SDL_SendMouseButton(sdl_window, 0, state, sdl_button);
-}
-
-static void
-HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
-{
- SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
-}
-
-static void
-HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
-{
- SDL_SendTouch(device_id, source_id, down, x, y, pressure);
-}
-
-static void
-HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure)
-{
- SDL_SendTouchMotion(device_id, source_id, x, y, pressure);
-}
-
-static void
-HandleMouseScroll(SDL_Window* sdl_window, int hscroll, int vscroll)
-{
- SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll, SDL_MOUSEWHEEL_NORMAL);
-}
-
-static void
-AddTouchDevice(int device_id)
-{
- if (SDL_AddTouch(device_id, "") < 0)
- SDL_SetError("Error: can't add touch %s, %d", __FILE__, __LINE__);
-}
-
-static void
-HandleTouchEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window)
-{
- int device_id = motion.device_id;
- int id = motion.pointer_coordinates[cord_index].id;
-
- int width = sdl_window->w;
- int height = sdl_window->h;
- float x = motion.pointer_coordinates[cord_index].x;
- float y = motion.pointer_coordinates[cord_index].y;
-
- float n_x = x / width;
- float n_y = y / height;
- float pressure = motion.pointer_coordinates[cord_index].pressure;
-
- AddTouchDevice(motion.device_id);
-
- switch (motion.action) {
- case mir_motion_action_down:
- case mir_motion_action_pointer_down:
- HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure);
- break;
- case mir_motion_action_up:
- case mir_motion_action_pointer_up:
- HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure);
- break;
- case mir_motion_action_hover_move:
- case mir_motion_action_move:
- HandleTouchMotion(device_id, id, n_x, n_y, pressure);
- break;
- default:
- break;
- }
-}
-
-static void
-HandleMouseEvent(MirMotionEvent const motion, int cord_index, SDL_Window* sdl_window)
-{
- SDL_SetMouseFocus(sdl_window);
-
- switch (motion.action) {
- case mir_motion_action_down:
- case mir_motion_action_pointer_down:
- HandleMouseButton(sdl_window, SDL_PRESSED, motion.button_state);
- break;
- case mir_motion_action_up:
- case mir_motion_action_pointer_up:
- HandleMouseButton(sdl_window, SDL_RELEASED, motion.button_state);
- break;
- case mir_motion_action_hover_move:
- case mir_motion_action_move:
- HandleMouseMotion(sdl_window,
- motion.pointer_coordinates[cord_index].x,
- motion.pointer_coordinates[cord_index].y);
- break;
- case mir_motion_action_outside:
- SDL_SetMouseFocus(NULL);
- break;
- case mir_motion_action_scroll:
- HandleMouseScroll(sdl_window,
- motion.pointer_coordinates[cord_index].hscroll,
- motion.pointer_coordinates[cord_index].vscroll);
- break;
- case mir_motion_action_cancel:
- case mir_motion_action_hover_enter:
- case mir_motion_action_hover_exit:
- break;
- default:
- break;
- }
-}
-
-static void
-HandleMotionEvent(MirMotionEvent const motion, SDL_Window* sdl_window)
-{
- int cord_index;
- for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) {
- if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
- HandleTouchEvent(motion, cord_index, sdl_window);
- }
- else {
- HandleMouseEvent(motion, cord_index, sdl_window);
- }
- }
-}
-
-void
-MIR_HandleInput(MirSurface* surface, MirEvent const* ev, void* context)
-{
- SDL_Window* window = (SDL_Window*)context;
- switch (ev->type) {
- case (mir_event_type_key):
- HandleKeyEvent(ev->key, window);
- break;
- case (mir_event_type_motion):
- HandleMotionEvent(ev->motion, window);
- break;
- default:
- break;
- }
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirmouse.c b/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirmouse.c
deleted file mode 100644
index bb8dc6c4e2..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirmouse.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer,
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_mirmouse.h"
-
-#include "../../events/SDL_mouse_c.h"
-#include "SDL_assert.h"
-
-#include "SDL_mirdyn.h"
-
-static SDL_Cursor*
-MIR_CreateDefaultCursor()
-{
- SDL_Cursor* cursor;
-
- cursor = SDL_calloc(1, sizeof(SDL_Cursor));
- if (cursor) {
- }
- else {
- SDL_OutOfMemory();
- }
-
- return cursor;
-}
-
-static SDL_Cursor*
-MIR_CreateCursor(SDL_Surface* sruface, int hot_x, int hot_y)
-{
- return MIR_CreateDefaultCursor();
-}
-
-static SDL_Cursor*
-MIR_CreateSystemCursor(SDL_SystemCursor id)
-{
- switch(id) {
- case SDL_SYSTEM_CURSOR_ARROW:
- break;
- case SDL_SYSTEM_CURSOR_IBEAM:
- break;
- case SDL_SYSTEM_CURSOR_WAIT:
- break;
- case SDL_SYSTEM_CURSOR_CROSSHAIR:
- break;
- case SDL_SYSTEM_CURSOR_WAITARROW:
- break;
- case SDL_SYSTEM_CURSOR_SIZENWSE:
- break;
- case SDL_SYSTEM_CURSOR_SIZENESW:
- break;
- case SDL_SYSTEM_CURSOR_SIZEWE:
- break;
- case SDL_SYSTEM_CURSOR_SIZENS:
- break;
- case SDL_SYSTEM_CURSOR_SIZEALL:
- break;
- case SDL_SYSTEM_CURSOR_NO:
- break;
- case SDL_SYSTEM_CURSOR_HAND:
- break;
- default:
- SDL_assert(0);
- return NULL;
- }
-
- return MIR_CreateDefaultCursor();
-}
-
-static void
-MIR_FreeCursor(SDL_Cursor* cursor)
-{
- if (cursor)
- SDL_free(cursor);
-}
-
-static int
-MIR_ShowCursor(SDL_Cursor* cursor)
-{
- return 0;
-}
-
-static void
-MIR_WarpMouse(SDL_Window* window, int x, int y)
-{
- SDL_Unsupported();
-}
-
-static int
-MIR_WarpMouseGlobal(int x, int y)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_SetRelativeMouseMode(SDL_bool enabled)
-{
- return SDL_Unsupported();
-}
-
-/* TODO Actually implement the cursor, need to wait for mir support */
-void
-MIR_InitMouse()
-{
- SDL_Mouse* mouse = SDL_GetMouse();
-
- mouse->CreateCursor = MIR_CreateCursor;
- mouse->ShowCursor = MIR_ShowCursor;
- mouse->FreeCursor = MIR_FreeCursor;
- mouse->WarpMouse = MIR_WarpMouse;
- mouse->WarpMouseGlobal = MIR_WarpMouseGlobal;
- mouse->CreateSystemCursor = MIR_CreateSystemCursor;
- mouse->SetRelativeMouseMode = MIR_SetRelativeMouseMode;
-
- SDL_SetDefaultCursor(MIR_CreateDefaultCursor());
-}
-
-void
-MIR_FiniMouse()
-{
- SDL_Mouse* mouse = SDL_GetMouse();
-
- MIR_FreeCursor(mouse->def_cursor);
- mouse->def_cursor = NULL;
-
- mouse->CreateCursor = NULL;
- mouse->ShowCursor = NULL;
- mouse->FreeCursor = NULL;
- mouse->WarpMouse = NULL;
- mouse->CreateSystemCursor = NULL;
- mouse->SetRelativeMouseMode = NULL;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirsym.h b/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirsym.h
deleted file mode 100644
index d0aaf70a32..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirsym.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* *INDENT-OFF* */
-
-SDL_MIR_MODULE(MIR_CLIENT)
-SDL_MIR_SYM(MirDisplayConfiguration*,mir_connection_create_display_config,(MirConnection *connection))
-SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))
-SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
-SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
-SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection))
-SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
-SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
-SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))
-SDL_MIR_SYM(MirEGLNativeWindowType,mir_surface_get_egl_native_window,(MirSurface *surface))
-SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
-SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))
-SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))
-SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface))
-SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
-SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))
-SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))
-SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state))
-SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))
-
-SDL_MIR_MODULE(XKBCOMMON)
-SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size))
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirvideo.c b/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirvideo.c
deleted file mode 100644
index b6160fd923..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirvideo.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer,
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_video.h"
-
-#include "SDL_mirframebuffer.h"
-#include "SDL_mirmouse.h"
-#include "SDL_miropengl.h"
-#include "SDL_mirvideo.h"
-#include "SDL_mirwindow.h"
-
-#include "SDL_mirdyn.h"
-
-#define MIR_DRIVER_NAME "mir"
-
-static int
-MIR_VideoInit(_THIS);
-
-static void
-MIR_VideoQuit(_THIS);
-
-static int
-MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect);
-
-static void
-MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* sdl_display);
-
-static int
-MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* sdl_display, SDL_DisplayMode* mode);
-
-static SDL_WindowShaper*
-MIR_CreateShaper(SDL_Window* window)
-{
- /* FIXME Im not sure if mir support this atm, will have to come back to this */
- return NULL;
-}
-
-static int
-MIR_SetWindowShape(SDL_WindowShaper* shaper, SDL_Surface* shape, SDL_WindowShapeMode* shape_mode)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_ResizeWindowShape(SDL_Window* window)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_Available()
-{
- int available = 0;
-
- if (SDL_MIR_LoadSymbols()) {
- /* !!! FIXME: try to make a MirConnection here. */
- available = 1;
- SDL_MIR_UnloadSymbols();
- }
-
- return available;
-}
-
-static void
-MIR_DeleteDevice(SDL_VideoDevice* device)
-{
- SDL_free(device);
- SDL_MIR_UnloadSymbols();
-}
-
-void
-MIR_PumpEvents(_THIS)
-{
-}
-
-static SDL_VideoDevice*
-MIR_CreateDevice(int device_index)
-{
- MIR_Data* mir_data;
- SDL_VideoDevice* device = NULL;
-
- if (!SDL_MIR_LoadSymbols()) {
- return NULL;
- }
-
- device = SDL_calloc(1, sizeof(SDL_VideoDevice));
- if (!device) {
- SDL_MIR_UnloadSymbols();
- SDL_OutOfMemory();
- return NULL;
- }
-
- mir_data = SDL_calloc(1, sizeof(MIR_Data));
- if (!mir_data) {
- SDL_free(device);
- SDL_MIR_UnloadSymbols();
- SDL_OutOfMemory();
- return NULL;
- }
-
- device->driverdata = mir_data;
-
- /* mirvideo */
- device->VideoInit = MIR_VideoInit;
- device->VideoQuit = MIR_VideoQuit;
- device->GetDisplayBounds = MIR_GetDisplayBounds;
- device->GetDisplayModes = MIR_GetDisplayModes;
- device->SetDisplayMode = MIR_SetDisplayMode;
- device->free = MIR_DeleteDevice;
-
- /* miropengles */
- device->GL_SwapWindow = MIR_GL_SwapWindow;
- device->GL_MakeCurrent = MIR_GL_MakeCurrent;
- device->GL_CreateContext = MIR_GL_CreateContext;
- device->GL_DeleteContext = MIR_GL_DeleteContext;
- device->GL_LoadLibrary = MIR_GL_LoadLibrary;
- device->GL_UnloadLibrary = MIR_GL_UnloadLibrary;
- device->GL_GetSwapInterval = MIR_GL_GetSwapInterval;
- device->GL_SetSwapInterval = MIR_GL_SetSwapInterval;
- device->GL_GetProcAddress = MIR_GL_GetProcAddress;
-
- /* mirwindow */
- device->CreateWindow = MIR_CreateWindow;
- device->DestroyWindow = MIR_DestroyWindow;
- device->GetWindowWMInfo = MIR_GetWindowWMInfo;
- device->SetWindowFullscreen = MIR_SetWindowFullscreen;
- device->MaximizeWindow = MIR_MaximizeWindow;
- device->MinimizeWindow = MIR_MinimizeWindow;
- device->RestoreWindow = MIR_RestoreWindow;
-
- device->CreateWindowFrom = NULL;
- device->SetWindowTitle = NULL;
- device->SetWindowIcon = NULL;
- device->SetWindowPosition = NULL;
- device->SetWindowSize = NULL;
- device->SetWindowMinimumSize = NULL;
- device->SetWindowMaximumSize = NULL;
- device->ShowWindow = NULL;
- device->HideWindow = NULL;
- device->RaiseWindow = NULL;
- device->SetWindowBordered = NULL;
- device->SetWindowGammaRamp = NULL;
- device->GetWindowGammaRamp = NULL;
- device->SetWindowGrab = NULL;
- device->OnWindowEnter = NULL;
-
- /* mirframebuffer */
- device->CreateWindowFramebuffer = MIR_CreateWindowFramebuffer;
- device->UpdateWindowFramebuffer = MIR_UpdateWindowFramebuffer;
- device->DestroyWindowFramebuffer = MIR_DestroyWindowFramebuffer;
-
- device->shape_driver.CreateShaper = MIR_CreateShaper;
- device->shape_driver.SetWindowShape = MIR_SetWindowShape;
- device->shape_driver.ResizeWindowShape = MIR_ResizeWindowShape;
-
- device->PumpEvents = MIR_PumpEvents;
-
- device->SuspendScreenSaver = NULL;
-
- device->StartTextInput = NULL;
- device->StopTextInput = NULL;
- device->SetTextInputRect = NULL;
-
- device->HasScreenKeyboardSupport = NULL;
- device->ShowScreenKeyboard = NULL;
- device->HideScreenKeyboard = NULL;
- device->IsScreenKeyboardShown = NULL;
-
- device->SetClipboardText = NULL;
- device->GetClipboardText = NULL;
- device->HasClipboardText = NULL;
-
- device->ShowMessageBox = NULL;
-
- return device;
-}
-
-VideoBootStrap MIR_bootstrap = {
- MIR_DRIVER_NAME, "SDL Mir video driver",
- MIR_Available, MIR_CreateDevice
-};
-
-static void
-MIR_SetCurrentDisplayMode(MirDisplayOutput const* out, SDL_VideoDisplay* display)
-{
- SDL_DisplayMode mode = {
- .format = SDL_PIXELFORMAT_RGB888,
- .w = out->modes[out->current_mode].horizontal_resolution,
- .h = out->modes[out->current_mode].vertical_resolution,
- .refresh_rate = out->modes[out->current_mode].refresh_rate,
- .driverdata = NULL
- };
-
- display->desktop_mode = mode;
- display->current_mode = mode;
-}
-
-static void
-MIR_AddAllModesFromDisplay(MirDisplayOutput const* out, SDL_VideoDisplay* display)
-{
- int n_mode;
- for (n_mode = 0; n_mode < out->num_modes; ++n_mode) {
- SDL_DisplayMode mode = {
- .format = SDL_PIXELFORMAT_RGB888,
- .w = out->modes[n_mode].horizontal_resolution,
- .h = out->modes[n_mode].vertical_resolution,
- .refresh_rate = out->modes[n_mode].refresh_rate,
- .driverdata = NULL
- };
-
- SDL_AddDisplayMode(display, &mode);
- }
-}
-
-static void
-MIR_InitDisplays(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
- int d;
-
- MirDisplayConfiguration* display_config = MIR_mir_connection_create_display_config(mir_data->connection);
-
- for (d = 0; d < display_config->num_outputs; d++) {
- MirDisplayOutput const* out = display_config->outputs + d;
-
- SDL_VideoDisplay display;
- SDL_zero(display);
-
- if (out->used &&
- out->connected &&
- out->num_modes &&
- out->current_mode < out->num_modes) {
-
- MIR_SetCurrentDisplayMode(out, &display);
- MIR_AddAllModesFromDisplay(out, &display);
-
- SDL_AddVideoDisplay(&display);
- }
- }
-
- MIR_mir_display_config_destroy(display_config);
-}
-
-int
-MIR_VideoInit(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
- mir_data->software = SDL_FALSE;
-
- if (!MIR_mir_connection_is_valid(mir_data->connection))
- return SDL_SetError("Failed to connect to the Mir Server");
-
- MIR_InitDisplays(_this);
- MIR_InitMouse();
-
- return 0;
-}
-
-void
-MIR_VideoQuit(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- MIR_FiniMouse();
-
- MIR_GL_DeleteContext(_this, NULL);
- MIR_GL_UnloadLibrary(_this);
-
- MIR_mir_connection_release(mir_data->connection);
-
- SDL_free(mir_data);
- _this->driverdata = NULL;
-}
-
-static int
-MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect)
-{
- MIR_Data* mir_data = _this->driverdata;
- int d;
-
- MirDisplayConfiguration* display_config = MIR_mir_connection_create_display_config(mir_data->connection);
-
- for (d = 0; d < display_config->num_outputs; d++) {
- MirDisplayOutput const* out = display_config->outputs + d;
-
- if (out->used &&
- out->connected &&
- out->num_modes &&
- out->current_mode < out->num_modes) {
-
- rect->x = out->position_x;
- rect->y = out->position_y;
- rect->w = out->modes->horizontal_resolution;
- rect->h = out->modes->vertical_resolution;
- }
- }
-
- MIR_mir_display_config_destroy(display_config);
-
- return 0;
-}
-
-static void
-MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* sdl_display)
-{
-}
-
-static int
-MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* sdl_display, SDL_DisplayMode* mode)
-{
- return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirwindow.c b/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirwindow.c
deleted file mode 100644
index 0eb54be014..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/mir/SDL_mirwindow.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer,
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "../SDL_egl_c.h"
-#include "../SDL_sysvideo.h"
-
-#include "SDL_mirevents.h"
-#include "SDL_mirwindow.h"
-
-#include "SDL_mirdyn.h"
-
-int
-IsSurfaceValid(MIR_Window* mir_window)
-{
- if (!MIR_mir_surface_is_valid(mir_window->surface)) {
- const char* error = MIR_mir_surface_get_error_message(mir_window->surface);
- return SDL_SetError("Failed to created a mir surface: %s", error);
- }
-
- return 0;
-}
-
-MirPixelFormat
-FindValidPixelFormat(MIR_Data* mir_data)
-{
- unsigned int pf_size = 32;
- unsigned int valid_formats;
- unsigned int f;
-
- MirPixelFormat formats[pf_size];
- MIR_mir_connection_get_available_surface_formats(mir_data->connection, formats,
- pf_size, &valid_formats);
-
- for (f = 0; f < valid_formats; f++) {
- MirPixelFormat cur_pf = formats[f];
-
- if (cur_pf == mir_pixel_format_abgr_8888 ||
- cur_pf == mir_pixel_format_xbgr_8888 ||
- cur_pf == mir_pixel_format_argb_8888 ||
- cur_pf == mir_pixel_format_xrgb_8888) {
-
- return cur_pf;
- }
- }
-
- return mir_pixel_format_invalid;
-}
-
-int
-MIR_CreateWindow(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_window;
- MIR_Data* mir_data;
-
- MirSurfaceParameters surfaceparm =
- {
- .name = "MirSurface",
- .width = window->w,
- .height = window->h,
- .pixel_format = mir_pixel_format_invalid,
- .buffer_usage = mir_buffer_usage_hardware,
- .output_id = mir_display_output_id_invalid
- };
-
- MirEventDelegate delegate = {
- MIR_HandleInput,
- window
- };
-
- mir_window = SDL_calloc(1, sizeof(MIR_Window));
- if (!mir_window)
- return SDL_OutOfMemory();
-
- mir_data = _this->driverdata;
- window->driverdata = mir_window;
-
- if (mir_data->software)
- surfaceparm.buffer_usage = mir_buffer_usage_software;
-
- if (window->x == SDL_WINDOWPOS_UNDEFINED)
- window->x = 0;
-
- if (window->y == SDL_WINDOWPOS_UNDEFINED)
- window->y = 0;
-
- mir_window->mir_data = mir_data;
- mir_window->sdl_window = window;
-
- surfaceparm.pixel_format = FindValidPixelFormat(mir_data);
- if (surfaceparm.pixel_format == mir_pixel_format_invalid) {
- return SDL_SetError("Failed to find a valid pixel format.");
- }
-
- mir_window->surface = MIR_mir_connection_create_surface_sync(mir_data->connection, &surfaceparm);
- if (!MIR_mir_surface_is_valid(mir_window->surface)) {
- const char* error = MIR_mir_surface_get_error_message(mir_window->surface);
- return SDL_SetError("Failed to created a mir surface: %s", error);
- }
-
- if (window->flags & SDL_WINDOW_OPENGL) {
- EGLNativeWindowType egl_native_window =
- (EGLNativeWindowType)MIR_mir_surface_get_egl_native_window(mir_window->surface);
-
- mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window);
-
- if (mir_window->egl_surface == EGL_NO_SURFACE) {
- return SDL_SetError("Failed to created a window surface %p",
- _this->egl_data->egl_display);
- }
- }
- else {
- mir_window->egl_surface = EGL_NO_SURFACE;
- }
-
- MIR_mir_surface_set_event_handler(mir_window->surface, &delegate);
-
- return 0;
-}
-
-void
-MIR_DestroyWindow(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
-
- if (mir_data) {
- SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
- MIR_mir_surface_release_sync(mir_window->surface);
-
- SDL_free(mir_window);
- }
- window->driverdata = NULL;
-}
-
-SDL_bool
-MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info)
-{
- if (info->version.major == SDL_MAJOR_VERSION &&
- info->version.minor == SDL_MINOR_VERSION) {
- MIR_Window* mir_window = window->driverdata;
-
- info->subsystem = SDL_SYSWM_MIR;
- info->info.mir.connection = mir_window->mir_data->connection;
- info->info.mir.surface = mir_window->surface;
-
- return SDL_TRUE;
- }
-
- return SDL_FALSE;
-}
-
-void
-MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
- SDL_VideoDisplay* display,
- SDL_bool fullscreen)
-{
- MIR_Window* mir_window = window->driverdata;
-
- if (IsSurfaceValid(mir_window) < 0)
- return;
-
- if (fullscreen) {
- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen);
- } else {
- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
- }
-}
-
-void
-MIR_MaximizeWindow(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_window = window->driverdata;
-
- if (IsSurfaceValid(mir_window) < 0)
- return;
-
- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized);
-}
-
-void
-MIR_MinimizeWindow(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_window = window->driverdata;
-
- if (IsSurfaceValid(mir_window) < 0)
- return;
-
- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized);
-}
-
-void
-MIR_RestoreWindow(_THIS, SDL_Window * window)
-{
- MIR_Window* mir_window = window->driverdata;
-
- if (IsSurfaceValid(mir_window) < 0)
- return;
-
- MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitvideo.m b/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitvideo.m
deleted file mode 100644
index 4f3c7dc432..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitvideo.m
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#import
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "SDL_hints.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_uikitvideo.h"
-#include "SDL_uikitevents.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-#include "SDL_uikitopengles.h"
-
-#define UIKITVID_DRIVER_NAME "uikit"
-
-/* Initialization/Query functions */
-static int UIKit_VideoInit(_THIS);
-static void UIKit_VideoQuit(_THIS);
-
-/* DUMMY driver bootstrap functions */
-
-static int
-UIKit_Available(void)
-{
- return 1;
-}
-
-static void UIKit_DeleteDevice(SDL_VideoDevice * device)
-{
- SDL_free(device);
-}
-
-static SDL_VideoDevice *
-UIKit_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
- if (!device) {
- SDL_free(device);
- SDL_OutOfMemory();
- return (0);
- }
-
- /* Set the function pointers */
- device->VideoInit = UIKit_VideoInit;
- device->VideoQuit = UIKit_VideoQuit;
- device->GetDisplayModes = UIKit_GetDisplayModes;
- device->SetDisplayMode = UIKit_SetDisplayMode;
- device->PumpEvents = UIKit_PumpEvents;
- device->SuspendScreenSaver = UIKit_SuspendScreenSaver;
- device->CreateWindow = UIKit_CreateWindow;
- device->SetWindowTitle = UIKit_SetWindowTitle;
- device->ShowWindow = UIKit_ShowWindow;
- device->HideWindow = UIKit_HideWindow;
- device->RaiseWindow = UIKit_RaiseWindow;
- device->SetWindowBordered = UIKit_SetWindowBordered;
- device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
- device->DestroyWindow = UIKit_DestroyWindow;
- device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
-
-#if SDL_IPHONE_KEYBOARD
- device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport;
- device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard;
- device->HideScreenKeyboard = UIKit_HideScreenKeyboard;
- device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown;
- device->SetTextInputRect = UIKit_SetTextInputRect;
-#endif
-
- /* OpenGL (ES) functions */
- device->GL_MakeCurrent = UIKit_GL_MakeCurrent;
- device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize;
- device->GL_SwapWindow = UIKit_GL_SwapWindow;
- device->GL_CreateContext = UIKit_GL_CreateContext;
- device->GL_DeleteContext = UIKit_GL_DeleteContext;
- device->GL_GetProcAddress = UIKit_GL_GetProcAddress;
- device->GL_LoadLibrary = UIKit_GL_LoadLibrary;
- device->free = UIKit_DeleteDevice;
-
- device->gl_config.accelerated = 1;
-
- return device;
-}
-
-VideoBootStrap UIKIT_bootstrap = {
- UIKITVID_DRIVER_NAME, "SDL UIKit video driver",
- UIKit_Available, UIKit_CreateDevice
-};
-
-
-int
-UIKit_VideoInit(_THIS)
-{
- _this->gl_config.driver_loaded = 1;
-
- if (UIKit_InitModes(_this) < 0) {
- return -1;
- }
- return 0;
-}
-
-void
-UIKit_VideoQuit(_THIS)
-{
- UIKit_QuitModes(_this);
-}
-
-void
-UIKit_SuspendScreenSaver(_THIS)
-{
- @autoreleasepool {
- /* Ignore ScreenSaver API calls if the idle timer hint has been set. */
- /* FIXME: The idle timer hint should be deprecated for SDL 2.1. */
- if (SDL_GetHint(SDL_HINT_IDLE_TIMER_DISABLED) == NULL) {
- UIApplication *app = [UIApplication sharedApplication];
-
- /* Prevent the display from dimming and going to sleep. */
- app.idleTimerDisabled = (_this->suspend_screensaver != SDL_FALSE);
- }
- }
-}
-
-BOOL
-UIKit_IsSystemVersionAtLeast(double version)
-{
- return [[UIDevice currentDevice].systemVersion doubleValue] >= version;
-}
-
-CGRect
-UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen)
-{
- BOOL hasiOS7 = UIKit_IsSystemVersionAtLeast(7.0);
-
- if (hasiOS7 || (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN))) {
- /* The view should always show behind the status bar in iOS 7+. */
- return screen.bounds;
- } else {
- return screen.applicationFrame;
- }
-}
-
-/*
- * iOS log support.
- *
- * This doesn't really have aything to do with the interfaces of the SDL video
- * subsystem, but we need to stuff this into an Objective-C source code file.
- */
-
-void SDL_NSLog(const char *text)
-{
- NSLog(@"%s", text);
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitviewcontroller.h b/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitviewcontroller.h
deleted file mode 100644
index c78396802e..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/uikit/SDL_uikitviewcontroller.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
- */
-
-#import
-
-#include "../SDL_sysvideo.h"
-
-#include "SDL_touch.h"
-
-#if SDL_IPHONE_KEYBOARD
-@interface SDL_uikitviewcontroller : UIViewController
-#else
-@interface SDL_uikitviewcontroller : UIViewController
-#endif
-
-@property (nonatomic, assign) SDL_Window *window;
-
-- (instancetype)initWithSDLWindow:(SDL_Window *)_window;
-
-- (void)setAnimationCallback:(int)interval
- callback:(void (*)(void*))callback
- callbackParam:(void*)callbackParam;
-
-- (void)startAnimation;
-- (void)stopAnimation;
-
-- (void)doLoop:(CADisplayLink*)sender;
-
-- (void)loadView;
-- (void)viewDidLayoutSubviews;
-- (NSUInteger)supportedInterfaceOrientations;
-- (BOOL)prefersStatusBarHidden;
-
-#if SDL_IPHONE_KEYBOARD
-- (void)showKeyboard;
-- (void)hideKeyboard;
-- (void)initKeyboard;
-- (void)deinitKeyboard;
-
-- (void)keyboardWillShow:(NSNotification *)notification;
-- (void)keyboardWillHide:(NSNotification *)notification;
-
-- (void)updateKeyboard;
-
-@property (nonatomic, assign, getter=isKeyboardVisible) BOOL keyboardVisible;
-@property (nonatomic, assign) SDL_Rect textInputRect;
-@property (nonatomic, assign) int keyboardHeight;
-#endif
-
-@end
-
-#if SDL_IPHONE_KEYBOARD
-SDL_bool UIKit_HasScreenKeyboardSupport(_THIS);
-void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window);
-void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window);
-SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window);
-void UIKit_SetTextInputRect(_THIS, SDL_Rect *rect);
-#endif
diff --git a/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandevents.c b/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandevents.c
deleted file mode 100644
index 53b0ac9078..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandevents.c
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_WAYLAND
-
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/scancodes_xfree86.h"
-
-#include "SDL_waylandvideo.h"
-#include "SDL_waylandevents_c.h"
-#include "SDL_waylandwindow.h"
-
-#include "SDL_waylanddyn.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-struct SDL_WaylandInput {
- SDL_VideoData *display;
- struct wl_seat *seat;
- struct wl_pointer *pointer;
- struct wl_keyboard *keyboard;
- SDL_WindowData *pointer_focus;
- SDL_WindowData *keyboard_focus;
-
- /* Last motion location */
- wl_fixed_t sx_w;
- wl_fixed_t sy_w;
-
- struct {
- struct xkb_keymap *keymap;
- struct xkb_state *state;
- } xkb;
-};
-
-void
-Wayland_PumpEvents(_THIS)
-{
- SDL_VideoData *d = _this->driverdata;
- struct pollfd pfd[1];
-
- pfd[0].fd = WAYLAND_wl_display_get_fd(d->display);
- pfd[0].events = POLLIN;
- poll(pfd, 1, 0);
-
- if (pfd[0].revents & POLLIN)
- WAYLAND_wl_display_dispatch(d->display);
- else
- WAYLAND_wl_display_dispatch_pending(d->display);
-}
-
-static void
-pointer_handle_enter(void *data, struct wl_pointer *pointer,
- uint32_t serial, struct wl_surface *surface,
- wl_fixed_t sx_w, wl_fixed_t sy_w)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window;
-
- if (!surface) {
- /* enter event for a window we've just destroyed */
- return;
- }
-
- /* This handler will be called twice in Wayland 1.4
- * Once for the window surface which has valid user data
- * and again for the mouse cursor surface which does not have valid user data
- * We ignore the later
- */
-
- window = (SDL_WindowData *)wl_surface_get_user_data(surface);
-
- if (window) {
- input->pointer_focus = window;
- SDL_SetMouseFocus(window->sdlwindow);
- }
-}
-
-static void
-pointer_handle_leave(void *data, struct wl_pointer *pointer,
- uint32_t serial, struct wl_surface *surface)
-{
- struct SDL_WaylandInput *input = data;
-
- if (input->pointer_focus) {
- SDL_SetMouseFocus(NULL);
- input->pointer_focus = NULL;
- }
-}
-
-static void
-pointer_handle_motion(void *data, struct wl_pointer *pointer,
- uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window = input->pointer_focus;
- input->sx_w = sx_w;
- input->sy_w = sy_w;
- if (input->pointer_focus) {
- const int sx = wl_fixed_to_int(sx_w);
- const int sy = wl_fixed_to_int(sy_w);
- SDL_SendMouseMotion(window->sdlwindow, 0, 0, sx, sy);
- }
-}
-
-static SDL_bool
-ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial)
-{
- SDL_WindowData *window_data = input->pointer_focus;
- SDL_Window *window = window_data->sdlwindow;
-
- if (window->hit_test) {
- const SDL_Point point = { wl_fixed_to_int(input->sx_w), wl_fixed_to_int(input->sy_w) };
- const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data);
- static const uint32_t directions[] = {
- WL_SHELL_SURFACE_RESIZE_TOP_LEFT, WL_SHELL_SURFACE_RESIZE_TOP,
- WL_SHELL_SURFACE_RESIZE_TOP_RIGHT, WL_SHELL_SURFACE_RESIZE_RIGHT,
- WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, WL_SHELL_SURFACE_RESIZE_BOTTOM,
- WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT, WL_SHELL_SURFACE_RESIZE_LEFT
- };
- switch (rc) {
- case SDL_HITTEST_DRAGGABLE:
- wl_shell_surface_move(window_data->shell_surface, input->seat, serial);
- return SDL_TRUE;
-
- case SDL_HITTEST_RESIZE_TOPLEFT:
- case SDL_HITTEST_RESIZE_TOP:
- case SDL_HITTEST_RESIZE_TOPRIGHT:
- case SDL_HITTEST_RESIZE_RIGHT:
- case SDL_HITTEST_RESIZE_BOTTOMRIGHT:
- case SDL_HITTEST_RESIZE_BOTTOM:
- case SDL_HITTEST_RESIZE_BOTTOMLEFT:
- case SDL_HITTEST_RESIZE_LEFT:
- wl_shell_surface_resize(window_data->shell_surface, input->seat, serial, directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]);
- return SDL_TRUE;
-
- default: return SDL_FALSE;
- }
- }
-
- return SDL_FALSE;
-}
-
-static void
-pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
- uint32_t time, uint32_t button, uint32_t state_w)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window = input->pointer_focus;
- enum wl_pointer_button_state state = state_w;
- uint32_t sdl_button;
-
- if (input->pointer_focus) {
- switch (button) {
- case BTN_LEFT:
- sdl_button = SDL_BUTTON_LEFT;
- if (ProcessHitTest(data, serial)) {
- return; /* don't pass this event on to app. */
- }
- break;
- case BTN_MIDDLE:
- sdl_button = SDL_BUTTON_MIDDLE;
- break;
- case BTN_RIGHT:
- sdl_button = SDL_BUTTON_RIGHT;
- break;
- case BTN_SIDE:
- sdl_button = SDL_BUTTON_X1;
- break;
- case BTN_EXTRA:
- sdl_button = SDL_BUTTON_X2;
- break;
- default:
- return;
- }
-
- SDL_SendMouseButton(window->sdlwindow, 0,
- state ? SDL_PRESSED : SDL_RELEASED, sdl_button);
- }
-}
-
-static void
-pointer_handle_axis(void *data, struct wl_pointer *pointer,
- uint32_t time, uint32_t axis, wl_fixed_t value)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window = input->pointer_focus;
- enum wl_pointer_axis a = axis;
- int x, y;
-
- if (input->pointer_focus) {
- switch (a) {
- case WL_POINTER_AXIS_VERTICAL_SCROLL:
- x = 0;
- y = wl_fixed_to_int(value);
- break;
- case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
- x = wl_fixed_to_int(value);
- y = 0;
- break;
- default:
- return;
- }
-
- SDL_SendMouseWheel(window->sdlwindow, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
- }
-}
-
-static const struct wl_pointer_listener pointer_listener = {
- pointer_handle_enter,
- pointer_handle_leave,
- pointer_handle_motion,
- pointer_handle_button,
- pointer_handle_axis,
-};
-
-static void
-keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
- uint32_t format, int fd, uint32_t size)
-{
- struct SDL_WaylandInput *input = data;
- char *map_str;
-
- if (!data) {
- close(fd);
- return;
- }
-
- if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
- close(fd);
- return;
- }
-
- map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
- if (map_str == MAP_FAILED) {
- close(fd);
- return;
- }
-
- input->xkb.keymap = WAYLAND_xkb_keymap_new_from_string(input->display->xkb_context,
- map_str,
- XKB_KEYMAP_FORMAT_TEXT_V1,
- 0);
- munmap(map_str, size);
- close(fd);
-
- if (!input->xkb.keymap) {
- fprintf(stderr, "failed to compile keymap\n");
- return;
- }
-
- input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap);
- if (!input->xkb.state) {
- fprintf(stderr, "failed to create XKB state\n");
- WAYLAND_xkb_keymap_unref(input->xkb.keymap);
- input->xkb.keymap = NULL;
- return;
- }
-}
-
-static void
-keyboard_handle_enter(void *data, struct wl_keyboard *keyboard,
- uint32_t serial, struct wl_surface *surface,
- struct wl_array *keys)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window;
-
- if (!surface) {
- /* enter event for a window we've just destroyed */
- return;
- }
-
- window = wl_surface_get_user_data(surface);
-
- input->keyboard_focus = window;
- window->keyboard_device = input;
- if (window) {
- SDL_SetKeyboardFocus(window->sdlwindow);
- }
-}
-
-static void
-keyboard_handle_leave(void *data, struct wl_keyboard *keyboard,
- uint32_t serial, struct wl_surface *surface)
-{
- SDL_SetKeyboardFocus(NULL);
-}
-
-static void
-keyboard_handle_key(void *data, struct wl_keyboard *keyboard,
- uint32_t serial, uint32_t time, uint32_t key,
- uint32_t state_w)
-{
- struct SDL_WaylandInput *input = data;
- SDL_WindowData *window = input->keyboard_focus;
- enum wl_keyboard_key_state state = state_w;
- const xkb_keysym_t *syms;
- uint32_t scancode;
- char text[8];
- int size;
-
- if (key < SDL_arraysize(xfree86_scancode_table2)) {
- scancode = xfree86_scancode_table2[key];
-
- // TODO when do we get WL_KEYBOARD_KEY_STATE_REPEAT?
- if (scancode != SDL_SCANCODE_UNKNOWN)
- SDL_SendKeyboardKey(state == WL_KEYBOARD_KEY_STATE_PRESSED ?
- SDL_PRESSED : SDL_RELEASED, scancode);
- }
-
- if (!window || window->keyboard_device != input || !input->xkb.state)
- return;
-
- // TODO can this happen?
- if (WAYLAND_xkb_state_key_get_syms(input->xkb.state, key + 8, &syms) != 1)
- return;
-
- if (state) {
- size = WAYLAND_xkb_keysym_to_utf8(syms[0], text, sizeof text);
-
- if (size > 0) {
- text[size] = 0;
- SDL_SendKeyboardText(text);
- }
- }
-}
-
-static void
-keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard,
- uint32_t serial, uint32_t mods_depressed,
- uint32_t mods_latched, uint32_t mods_locked,
- uint32_t group)
-{
- struct SDL_WaylandInput *input = data;
-
- WAYLAND_xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched,
- mods_locked, 0, 0, group);
-}
-
-static const struct wl_keyboard_listener keyboard_listener = {
- keyboard_handle_keymap,
- keyboard_handle_enter,
- keyboard_handle_leave,
- keyboard_handle_key,
- keyboard_handle_modifiers,
-};
-
-static void
-seat_handle_capabilities(void *data, struct wl_seat *seat,
- enum wl_seat_capability caps)
-{
- struct SDL_WaylandInput *input = data;
-
- if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) {
- input->pointer = wl_seat_get_pointer(seat);
- input->display->pointer = input->pointer;
- wl_pointer_set_user_data(input->pointer, input);
- wl_pointer_add_listener(input->pointer, &pointer_listener,
- input);
- } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) {
- wl_pointer_destroy(input->pointer);
- input->pointer = NULL;
- }
-
- if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) {
- input->keyboard = wl_seat_get_keyboard(seat);
- wl_keyboard_set_user_data(input->keyboard, input);
- wl_keyboard_add_listener(input->keyboard, &keyboard_listener,
- input);
- } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) {
- wl_keyboard_destroy(input->keyboard);
- input->keyboard = NULL;
- }
-}
-
-static const struct wl_seat_listener seat_listener = {
- seat_handle_capabilities,
-};
-
-void
-Wayland_display_add_input(SDL_VideoData *d, uint32_t id)
-{
- struct SDL_WaylandInput *input;
-
- input = SDL_calloc(1, sizeof *input);
- if (input == NULL)
- return;
-
- input->display = d;
- input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, 1);
- input->sx_w = wl_fixed_from_int(0);
- input->sy_w = wl_fixed_from_int(0);
- d->input = input;
-
- wl_seat_add_listener(input->seat, &seat_listener, input);
- wl_seat_set_user_data(input->seat, input);
-
- WAYLAND_wl_display_flush(d->display);
-}
-
-void Wayland_display_destroy_input(SDL_VideoData *d)
-{
- struct SDL_WaylandInput *input = d->input;
-
- if (!input)
- return;
-
- if (input->keyboard)
- wl_keyboard_destroy(input->keyboard);
-
- if (input->pointer)
- wl_pointer_destroy(input->pointer);
-
- if (input->seat)
- wl_seat_destroy(input->seat);
-
- if (input->xkb.state)
- WAYLAND_xkb_state_unref(input->xkb.state);
-
- if (input->xkb.keymap)
- WAYLAND_xkb_keymap_unref(input->xkb.keymap);
-
- SDL_free(input);
- d->input = NULL;
-}
-
-#endif /* SDL_VIDEO_DRIVER_WAYLAND */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandwindow.c b/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandwindow.c
deleted file mode 100644
index b59759a7c0..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/wayland/SDL_waylandwindow.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_windowevents_c.h"
-#include "../SDL_egl_c.h"
-#include "SDL_waylandwindow.h"
-#include "SDL_waylandvideo.h"
-#include "SDL_waylandtouch.h"
-#include "SDL_waylanddyn.h"
-
-static void
-handle_ping(void *data, struct wl_shell_surface *shell_surface,
- uint32_t serial)
-{
- wl_shell_surface_pong(shell_surface, serial);
-}
-
-static void
-handle_configure(void *data, struct wl_shell_surface *shell_surface,
- uint32_t edges, int32_t width, int32_t height)
-{
- SDL_WindowData *wind = (SDL_WindowData *)data;
- SDL_Window *window = wind->sdlwindow;
- struct wl_region *region;
-
- window->w = width;
- window->h = height;
- WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
-
- region = wl_compositor_create_region(wind->waylandData->compositor);
- wl_region_add(region, 0, 0, window->w, window->h);
- wl_surface_set_opaque_region(wind->surface, region);
- wl_region_destroy(region);
- SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
-}
-
-static void
-handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
-{
-}
-
-static const struct wl_shell_surface_listener shell_surface_listener = {
- handle_ping,
- handle_configure,
- handle_popup_done
-};
-
-#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
-static void
-handle_onscreen_visibility(void *data,
- struct qt_extended_surface *qt_extended_surface, int32_t visible)
-{
-}
-
-static void
-handle_set_generic_property(void *data,
- struct qt_extended_surface *qt_extended_surface, const char *name,
- struct wl_array *value)
-{
-}
-
-static void
-handle_close(void *data, struct qt_extended_surface *qt_extended_surface)
-{
- SDL_WindowData *window = (SDL_WindowData *)data;
- SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
-}
-
-static const struct qt_extended_surface_listener extended_surface_listener = {
- handle_onscreen_visibility,
- handle_set_generic_property,
- handle_close,
-};
-#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
-
-SDL_bool
-Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
-{
- SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
- info->info.wl.display = data->waylandData->display;
- info->info.wl.surface = data->surface;
- info->info.wl.shell_surface = data->shell_surface;
- info->subsystem = SDL_SYSWM_WAYLAND;
-
- return SDL_TRUE;
-}
-
-int
-Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
-{
- return 0; /* just succeed, the real work is done elsewhere. */
-}
-
-void Wayland_ShowWindow(_THIS, SDL_Window *window)
-{
- SDL_WindowData *wind = window->driverdata;
-
- if (window->flags & SDL_WINDOW_FULLSCREEN)
- wl_shell_surface_set_fullscreen(wind->shell_surface,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
- 0, (struct wl_output *)window->fullscreen_mode.driverdata);
- else
- wl_shell_surface_set_toplevel(wind->shell_surface);
-
- WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
-}
-
-void
-Wayland_SetWindowFullscreen(_THIS, SDL_Window * window,
- SDL_VideoDisplay * _display, SDL_bool fullscreen)
-{
- SDL_WindowData *wind = window->driverdata;
-
- if (fullscreen)
- wl_shell_surface_set_fullscreen(wind->shell_surface,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE,
- 0, (struct wl_output *)_display->driverdata);
- else
- wl_shell_surface_set_toplevel(wind->shell_surface);
-
- WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
-}
-
-int Wayland_CreateWindow(_THIS, SDL_Window *window)
-{
- SDL_WindowData *data;
- SDL_VideoData *c;
- struct wl_region *region;
-
- data = calloc(1, sizeof *data);
- if (data == NULL)
- return SDL_OutOfMemory();
-
- c = _this->driverdata;
- window->driverdata = data;
-
- if (!(window->flags & SDL_WINDOW_OPENGL)) {
- SDL_GL_LoadLibrary(NULL);
- window->flags |= SDL_WINDOW_OPENGL;
- }
-
- if (window->x == SDL_WINDOWPOS_UNDEFINED) {
- window->x = 0;
- }
- if (window->y == SDL_WINDOWPOS_UNDEFINED) {
- window->y = 0;
- }
-
- data->waylandData = c;
- data->sdlwindow = window;
-
- data->surface =
- wl_compositor_create_surface(c->compositor);
- wl_surface_set_user_data(data->surface, data);
- data->shell_surface = wl_shell_get_shell_surface(c->shell,
- data->surface);
-#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
- if (c->surface_extension) {
- data->extended_surface = qt_surface_extension_get_extended_surface(
- c->surface_extension, data->surface);
- }
-#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
-
- data->egl_window = WAYLAND_wl_egl_window_create(data->surface,
- window->w, window->h);
-
- /* Create the GLES window surface */
- data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->egl_window);
-
- if (data->egl_surface == EGL_NO_SURFACE) {
- return SDL_SetError("failed to create a window surface");
- }
-
- if (data->shell_surface) {
- wl_shell_surface_set_user_data(data->shell_surface, data);
- wl_shell_surface_add_listener(data->shell_surface,
- &shell_surface_listener, data);
- }
-
-#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
- if (data->extended_surface) {
- qt_extended_surface_set_user_data(data->extended_surface, data);
- qt_extended_surface_add_listener(data->extended_surface,
- &extended_surface_listener, data);
- }
-#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
-
- region = wl_compositor_create_region(c->compositor);
- wl_region_add(region, 0, 0, window->w, window->h);
- wl_surface_set_opaque_region(data->surface, region);
- wl_region_destroy(region);
-
- WAYLAND_wl_display_flush(c->display);
-
- return 0;
-}
-
-void Wayland_SetWindowSize(_THIS, SDL_Window * window)
-{
- SDL_VideoData *data = _this->driverdata;
- SDL_WindowData *wind = window->driverdata;
- struct wl_region *region;
-
- WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
-
- region =wl_compositor_create_region(data->compositor);
- wl_region_add(region, 0, 0, window->w, window->h);
- wl_surface_set_opaque_region(wind->surface, region);
- wl_region_destroy(region);
-}
-
-void Wayland_DestroyWindow(_THIS, SDL_Window *window)
-{
- SDL_VideoData *data = _this->driverdata;
- SDL_WindowData *wind = window->driverdata;
-
- if (data) {
- SDL_EGL_DestroySurface(_this, wind->egl_surface);
- WAYLAND_wl_egl_window_destroy(wind->egl_window);
-
- if (wind->shell_surface)
- wl_shell_surface_destroy(wind->shell_surface);
-
-#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
- if (wind->extended_surface)
- qt_extended_surface_destroy(wind->extended_surface);
-#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
- wl_surface_destroy(wind->surface);
-
- SDL_free(wind);
- WAYLAND_wl_display_flush(data->display);
- }
- window->driverdata = NULL;
-}
-
-#endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/windows/SDL_windowsmessagebox.c b/3rdparty/sdl2-2.0.4/src/video/windows/SDL_windowsmessagebox.c
deleted file mode 100644
index b39df32fc6..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/windows/SDL_windowsmessagebox.c
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_assert.h"
-#include "SDL_windowsvideo.h"
-
-
-#ifndef SS_EDITCONTROL
-#define SS_EDITCONTROL 0x2000
-#endif
-
-/* Display a Windows message box */
-
-#pragma pack(push, 1)
-
-typedef struct
-{
- WORD dlgVer;
- WORD signature;
- DWORD helpID;
- DWORD exStyle;
- DWORD style;
- WORD cDlgItems;
- short x;
- short y;
- short cx;
- short cy;
-} DLGTEMPLATEEX;
-
-typedef struct
-{
- DWORD helpID;
- DWORD exStyle;
- DWORD style;
- short x;
- short y;
- short cx;
- short cy;
- DWORD id;
-} DLGITEMTEMPLATEEX;
-
-#pragma pack(pop)
-
-typedef struct
-{
- DLGTEMPLATEEX* lpDialog;
- Uint8 *data;
- size_t size;
- size_t used;
-} WIN_DialogData;
-
-
-static INT_PTR MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)
-{
- switch ( iMessage ) {
- case WM_COMMAND:
- /* Return the ID of the button that was pushed */
- EndDialog(hDlg, LOWORD(wParam));
- return TRUE;
-
- default:
- break;
- }
- return FALSE;
-}
-
-static SDL_bool ExpandDialogSpace(WIN_DialogData *dialog, size_t space)
-{
- size_t size = dialog->size;
-
- if (size == 0) {
- size = space;
- } else {
- while ((dialog->used + space) > size) {
- size *= 2;
- }
- }
- if (size > dialog->size) {
- void *data = SDL_realloc(dialog->data, size);
- if (!data) {
- SDL_OutOfMemory();
- return SDL_FALSE;
- }
- dialog->data = data;
- dialog->size = size;
- dialog->lpDialog = (DLGTEMPLATEEX*)dialog->data;
- }
- return SDL_TRUE;
-}
-
-static SDL_bool AlignDialogData(WIN_DialogData *dialog, size_t size)
-{
- size_t padding = (dialog->used % size);
-
- if (!ExpandDialogSpace(dialog, padding)) {
- return SDL_FALSE;
- }
-
- dialog->used += padding;
-
- return SDL_TRUE;
-}
-
-static SDL_bool AddDialogData(WIN_DialogData *dialog, const void *data, size_t size)
-{
- if (!ExpandDialogSpace(dialog, size)) {
- return SDL_FALSE;
- }
-
- SDL_memcpy(dialog->data+dialog->used, data, size);
- dialog->used += size;
-
- return SDL_TRUE;
-}
-
-static SDL_bool AddDialogString(WIN_DialogData *dialog, const char *string)
-{
- WCHAR *wstring;
- WCHAR *p;
- size_t count;
- SDL_bool status;
-
- if (!string) {
- string = "";
- }
-
- wstring = WIN_UTF8ToString(string);
- if (!wstring) {
- return SDL_FALSE;
- }
-
- /* Find out how many characters we have, including null terminator */
- count = 0;
- for (p = wstring; *p; ++p) {
- ++count;
- }
- ++count;
-
- status = AddDialogData(dialog, wstring, count*sizeof(WCHAR));
- SDL_free(wstring);
- return status;
-}
-
-static int s_BaseUnitsX;
-static int s_BaseUnitsY;
-static void Vec2ToDLU(short *x, short *y)
-{
- SDL_assert(s_BaseUnitsX != 0); /* we init in WIN_ShowMessageBox(), which is the only public function... */
-
- *x = MulDiv(*x, 4, s_BaseUnitsX);
- *y = MulDiv(*y, 8, s_BaseUnitsY);
-}
-
-
-static SDL_bool AddDialogControl(WIN_DialogData *dialog, WORD type, DWORD style, DWORD exStyle, int x, int y, int w, int h, int id, const char *caption)
-{
- DLGITEMTEMPLATEEX item;
- WORD marker = 0xFFFF;
- WORD extraData = 0;
-
- SDL_zero(item);
- item.style = style;
- item.exStyle = exStyle;
- item.x = x;
- item.y = y;
- item.cx = w;
- item.cy = h;
- item.id = id;
-
- Vec2ToDLU(&item.x, &item.y);
- Vec2ToDLU(&item.cx, &item.cy);
-
- if (!AlignDialogData(dialog, sizeof(DWORD))) {
- return SDL_FALSE;
- }
- if (!AddDialogData(dialog, &item, sizeof(item))) {
- return SDL_FALSE;
- }
- if (!AddDialogData(dialog, &marker, sizeof(marker))) {
- return SDL_FALSE;
- }
- if (!AddDialogData(dialog, &type, sizeof(type))) {
- return SDL_FALSE;
- }
- if (!AddDialogString(dialog, caption)) {
- return SDL_FALSE;
- }
- if (!AddDialogData(dialog, &extraData, sizeof(extraData))) {
- return SDL_FALSE;
- }
- ++dialog->lpDialog->cDlgItems;
-
- return SDL_TRUE;
-}
-
-static SDL_bool AddDialogStatic(WIN_DialogData *dialog, int x, int y, int w, int h, const char *text)
-{
- DWORD style = WS_VISIBLE | WS_CHILD | SS_LEFT | SS_NOPREFIX | SS_EDITCONTROL;
- return AddDialogControl(dialog, 0x0082, style, 0, x, y, w, h, -1, text);
-}
-
-static SDL_bool AddDialogButton(WIN_DialogData *dialog, int x, int y, int w, int h, const char *text, int id, SDL_bool isDefault)
-{
- DWORD style = WS_VISIBLE | WS_CHILD;
- if (isDefault) {
- style |= BS_DEFPUSHBUTTON;
- } else {
- style |= BS_PUSHBUTTON;
- }
- return AddDialogControl(dialog, 0x0080, style, 0, x, y, w, h, id, text);
-}
-
-static void FreeDialogData(WIN_DialogData *dialog)
-{
- SDL_free(dialog->data);
- SDL_free(dialog);
-}
-
-static WIN_DialogData *CreateDialogData(int w, int h, const char *caption)
-{
- WIN_DialogData *dialog;
- DLGTEMPLATEEX dialogTemplate;
- WORD WordToPass;
-
- SDL_zero(dialogTemplate);
- dialogTemplate.dlgVer = 1;
- dialogTemplate.signature = 0xffff;
- dialogTemplate.style = (WS_CAPTION | DS_CENTER | DS_SHELLFONT);
- dialogTemplate.x = 0;
- dialogTemplate.y = 0;
- dialogTemplate.cx = w;
- dialogTemplate.cy = h;
- Vec2ToDLU(&dialogTemplate.cx, &dialogTemplate.cy);
-
- dialog = (WIN_DialogData *)SDL_calloc(1, sizeof(*dialog));
- if (!dialog) {
- return NULL;
- }
-
- if (!AddDialogData(dialog, &dialogTemplate, sizeof(dialogTemplate))) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* No menu */
- WordToPass = 0;
- if (!AddDialogData(dialog, &WordToPass, 2)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* No custom class */
- if (!AddDialogData(dialog, &WordToPass, 2)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* title */
- if (!AddDialogString(dialog, caption)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* Font stuff */
- {
- /*
- * We want to use the system messagebox font.
- */
- BYTE ToPass;
-
- NONCLIENTMETRICSA NCM;
- NCM.cbSize = sizeof(NCM);
- SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &NCM, 0);
-
- /* Font size - convert to logical font size for dialog parameter. */
- {
- HDC ScreenDC = GetDC(NULL);
- int LogicalPixelsY = GetDeviceCaps(ScreenDC, LOGPIXELSY);
- if (!LogicalPixelsY) /* This can happen if the application runs out of GDI handles */
- LogicalPixelsY = 72;
- WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / LogicalPixelsY);
- ReleaseDC(NULL, ScreenDC);
- }
-
- if (!AddDialogData(dialog, &WordToPass, 2)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* Font weight */
- WordToPass = (WORD)NCM.lfMessageFont.lfWeight;
- if (!AddDialogData(dialog, &WordToPass, 2)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* italic? */
- ToPass = NCM.lfMessageFont.lfItalic;
- if (!AddDialogData(dialog, &ToPass, 1)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* charset? */
- ToPass = NCM.lfMessageFont.lfCharSet;
- if (!AddDialogData(dialog, &ToPass, 1)) {
- FreeDialogData(dialog);
- return NULL;
- }
-
- /* font typeface. */
- if (!AddDialogString(dialog, NCM.lfMessageFont.lfFaceName)) {
- FreeDialogData(dialog);
- return NULL;
- }
- }
-
- return dialog;
-}
-
-int
-WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
- WIN_DialogData *dialog;
- int i, x, y;
- UINT_PTR which;
- const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
- HFONT DialogFont;
- SIZE Size;
- RECT TextSize;
- wchar_t* wmessage;
- TEXTMETRIC TM;
-
-
- const int ButtonWidth = 88;
- const int ButtonHeight = 26;
- const int TextMargin = 16;
- const int ButtonMargin = 12;
-
-
- /* Jan 25th, 2013 - dant@fleetsa.com
- *
- *
- * I've tried to make this more reasonable, but I've run in to a lot
- * of nonsense.
- *
- * The original issue is the code was written in pixels and not
- * dialog units (DLUs). All DialogBox functions use DLUs, which
- * vary based on the selected font (yay).
- *
- * According to MSDN, the most reliable way to convert is via
- * MapDialogUnits, which requires an HWND, which we don't have
- * at time of template creation.
- *
- * We do however have:
- * The system font (DLU width 8 for me)
- * The font we select for the dialog (DLU width 6 for me)
- *
- * Based on experimentation, *neither* of these return the value
- * actually used. Stepping in to MapDialogUnits(), the conversion
- * is fairly clear, and uses 7 for me.
- *
- * As a result, some of this is hacky to ensure the sizing is
- * somewhat correct.
- *
- * Honestly, a long term solution is to use CreateWindow, not CreateDialog.
- *
-
- *
- * In order to get text dimensions we need to have a DC with the desired font.
- * I'm assuming a dialog box in SDL is rare enough we can to the create.
- */
- HDC FontDC = CreateCompatibleDC(0);
-
- {
- /* Create a duplicate of the font used in system message boxes. */
- LOGFONT lf;
- NONCLIENTMETRICS NCM;
- NCM.cbSize = sizeof(NCM);
- SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &NCM, 0);
- lf = NCM.lfMessageFont;
- DialogFont = CreateFontIndirect(&lf);
- }
-
- /* Select the font in to our DC */
- SelectObject(FontDC, DialogFont);
-
- {
- /* Get the metrics to try and figure our DLU conversion. */
- GetTextMetrics(FontDC, &TM);
- s_BaseUnitsX = TM.tmAveCharWidth + 1;
- s_BaseUnitsY = TM.tmHeight;
- }
-
- /* Measure the *pixel* size of the string. */
- wmessage = WIN_UTF8ToString(messageboxdata->message);
- SDL_zero(TextSize);
- Size.cx = DrawText(FontDC, wmessage, -1, &TextSize, DT_CALCRECT);
-
- /* Add some padding for hangs, etc. */
- TextSize.right += 2;
- TextSize.bottom += 2;
-
- /* Done with the DC, and the string */
- DeleteDC(FontDC);
- SDL_free(wmessage);
-
- /* Increase the size of the dialog by some border spacing around the text. */
- Size.cx = TextSize.right - TextSize.left;
- Size.cy = TextSize.bottom - TextSize.top;
- Size.cx += TextMargin * 2;
- Size.cy += TextMargin * 2;
-
- /* Ensure the size is wide enough for all of the buttons. */
- if (Size.cx < messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin)
- Size.cx = messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin;
-
- /* Add vertical space for the buttons and border. */
- Size.cy += ButtonHeight + TextMargin;
-
- dialog = CreateDialogData(Size.cx, Size.cy, messageboxdata->title);
- if (!dialog) {
- return -1;
- }
-
- if (!AddDialogStatic(dialog, TextMargin, TextMargin, TextSize.right - TextSize.left, TextSize.bottom - TextSize.top, messageboxdata->message)) {
- FreeDialogData(dialog);
- return -1;
- }
-
- /* Align the buttons to the right/bottom. */
- x = Size.cx - ButtonWidth - ButtonMargin;
- y = Size.cy - ButtonHeight - ButtonMargin;
- for (i = 0; i < messageboxdata->numbuttons; ++i) {
- SDL_bool isDefault;
-
- if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
- isDefault = SDL_TRUE;
- } else {
- isDefault = SDL_FALSE;
- }
- if (!AddDialogButton(dialog, x, y, ButtonWidth, ButtonHeight, buttons[i].text, i, isDefault)) {
- FreeDialogData(dialog);
- return -1;
- }
- x -= ButtonWidth + ButtonMargin;
- }
-
- /* FIXME: If we have a parent window, get the Instance and HWND for them */
- which = DialogBoxIndirect(NULL, (DLGTEMPLATE*)dialog->lpDialog, NULL, (DLGPROC)MessageBoxDialogProc);
- *buttonid = buttons[which].buttonid;
-
- FreeDialogData(dialog);
- return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/src/video/x11/imKStoUCS.h b/3rdparty/sdl2-2.0.4/src/video/x11/imKStoUCS.h
deleted file mode 100644
index cc684c2e3f..0000000000
--- a/3rdparty/sdl2-2.0.4/src/video/x11/imKStoUCS.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _imKStoUCS_h
-#define _imKStoUCS_h
-
-/* Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is fur-
-nished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the XFree86 Project shall not
-be used in advertising or otherwise to promote the sale, use or other deal-
-ings in this Software without prior written authorization from the XFree86
-Project.
-*/
-
-extern unsigned int X11_KeySymToUcs4(KeySym keysym);
-
-#endif /* _imKStoUCS_h */
diff --git a/3rdparty/sdl2-2.0.4/test/axis.bmp b/3rdparty/sdl2-2.0.4/test/axis.bmp
deleted file mode 100644
index c7addd3ed9..0000000000
Binary files a/3rdparty/sdl2-2.0.4/test/axis.bmp and /dev/null differ
diff --git a/3rdparty/sdl2-2.0.4/test/controllermap.c b/3rdparty/sdl2-2.0.4/test/controllermap.c
deleted file mode 100644
index 3fb30d68a3..0000000000
--- a/3rdparty/sdl2-2.0.4/test/controllermap.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely.
-*/
-
-/* Game controller mapping generator */
-/* Gabriel Jacobo */
-
-#include
-#include
-#include
-
-#include "SDL.h"
-
-#ifndef SDL_JOYSTICK_DISABLED
-
-#ifdef __IPHONEOS__
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 480
-#else
-#define SCREEN_WIDTH 512
-#define SCREEN_HEIGHT 317
-#endif
-
-#define MAP_WIDTH 512
-#define MAP_HEIGHT 317
-
-#define MARKER_BUTTON 1
-#define MARKER_AXIS 2
-
-typedef struct MappingStep
-{
- int x, y;
- double angle;
- int marker;
- char *field;
- int axis, button, hat, hat_value;
- char mapping[4096];
-}MappingStep;
-
-
-SDL_Texture *
-LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
-{
- SDL_Surface *temp;
- SDL_Texture *texture;
-
- /* Load the sprite image */
- temp = SDL_LoadBMP(file);
- if (temp == NULL) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
- return NULL;
- }
-
- /* Set transparent pixel as the pixel at (0,0) */
- if (transparent) {
- if (temp->format->palette) {
- SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *) temp->pixels);
- } else {
- switch (temp->format->BitsPerPixel) {
- case 15:
- SDL_SetColorKey(temp, SDL_TRUE,
- (*(Uint16 *) temp->pixels) & 0x00007FFF);
- break;
- case 16:
- SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *) temp->pixels);
- break;
- case 24:
- SDL_SetColorKey(temp, SDL_TRUE,
- (*(Uint32 *) temp->pixels) & 0x00FFFFFF);
- break;
- case 32:
- SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *) temp->pixels);
- break;
- }
- }
- }
-
- /* Create textures from the image */
- texture = SDL_CreateTextureFromSurface(renderer, temp);
- if (!texture) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
- SDL_FreeSurface(temp);
- return NULL;
- }
- SDL_FreeSurface(temp);
-
- /* We're ready to roll. :) */
- return texture;
-}
-
-static SDL_bool
-WatchJoystick(SDL_Joystick * joystick)
-{
- SDL_Window *window = NULL;
- SDL_Renderer *screen = NULL;
- SDL_Texture *background, *button, *axis, *marker;
- const char *name = NULL;
- SDL_bool retval = SDL_FALSE;
- SDL_bool done = SDL_FALSE, next=SDL_FALSE;
- SDL_Event event;
- SDL_Rect dst;
- int s, _s;
- Uint8 alpha=200, alpha_step = -1;
- Uint32 alpha_ticks = 0;
- char mapping[4096], temp[4096];
- MappingStep *step, *prev_step;
- MappingStep steps[] = {
- {342, 132, 0.0, MARKER_BUTTON, "x", -1, -1, -1, -1, ""},
- {387, 167, 0.0, MARKER_BUTTON, "a", -1, -1, -1, -1, ""},
- {431, 132, 0.0, MARKER_BUTTON, "b", -1, -1, -1, -1, ""},
- {389, 101, 0.0, MARKER_BUTTON, "y", -1, -1, -1, -1, ""},
- {174, 132, 0.0, MARKER_BUTTON, "back", -1, -1, -1, -1, ""},
- {233, 132, 0.0, MARKER_BUTTON, "guide", -1, -1, -1, -1, ""},
- {289, 132, 0.0, MARKER_BUTTON, "start", -1, -1, -1, -1, ""},
- {116, 217, 0.0, MARKER_BUTTON, "dpleft", -1, -1, -1, -1, ""},
- {154, 249, 0.0, MARKER_BUTTON, "dpdown", -1, -1, -1, -1, ""},
- {186, 217, 0.0, MARKER_BUTTON, "dpright", -1, -1, -1, -1, ""},
- {154, 188, 0.0, MARKER_BUTTON, "dpup", -1, -1, -1, -1, ""},
- {77, 40, 0.0, MARKER_BUTTON, "leftshoulder", -1, -1, -1, -1, ""},
- {91, 0, 0.0, MARKER_BUTTON, "lefttrigger", -1, -1, -1, -1, ""},
- {396, 36, 0.0, MARKER_BUTTON, "rightshoulder", -1, -1, -1, -1, ""},
- {375, 0, 0.0, MARKER_BUTTON, "righttrigger", -1, -1, -1, -1, ""},
- {75, 154, 0.0, MARKER_BUTTON, "leftstick", -1, -1, -1, -1, ""},
- {305, 230, 0.0, MARKER_BUTTON, "rightstick", -1, -1, -1, -1, ""},
- {75, 154, 0.0, MARKER_AXIS, "leftx", -1, -1, -1, -1, ""},
- {75, 154, 90.0, MARKER_AXIS, "lefty", -1, -1, -1, -1, ""},
- {305, 230, 0.0, MARKER_AXIS, "rightx", -1, -1, -1, -1, ""},
- {305, 230, 90.0, MARKER_AXIS, "righty", -1, -1, -1, -1, ""},
- };
-
- /* Create a window to display joystick axis position */
- window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED,
- SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
- SCREEN_HEIGHT, 0);
- if (window == NULL) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
- return SDL_FALSE;
- }
-
- screen = SDL_CreateRenderer(window, -1, 0);
- if (screen == NULL) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError());
- SDL_DestroyWindow(window);
- return SDL_FALSE;
- }
-
- background = LoadTexture(screen, "controllermap.bmp", SDL_FALSE);
- button = LoadTexture(screen, "button.bmp", SDL_TRUE);
- axis = LoadTexture(screen, "axis.bmp", SDL_TRUE);
- SDL_RaiseWindow(window);
-
- /* scale for platforms that don't give you the window size you asked for. */
- SDL_RenderSetLogicalSize(screen, SCREEN_WIDTH, SCREEN_HEIGHT);
-
- /* Print info about the joystick we are watching */
- name = SDL_JoystickName(joystick);
- SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick),
- name ? name : "Unknown Joystick");
- SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n",
- SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
- SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick));
-
- SDL_Log("\n\n\
- ====================================================================================\n\
- Press the buttons on your controller when indicated\n\
- (Your controller may look different than the picture)\n\
- If you want to correct a mistake, press backspace or the back button on your device\n\
- To skip a button, press SPACE or click/touch the screen\n\
- To exit, press ESC\n\
- ====================================================================================\n");
-
- /* Initialize mapping with GUID and name */
- SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), temp, SDL_arraysize(temp));
- SDL_snprintf(mapping, SDL_arraysize(mapping), "%s,%s,platform:%s,",
- temp, name ? name : "Unknown Joystick", SDL_GetPlatform());
-
- /* Loop, getting joystick events! */
- for(s=0; smapping, mapping, SDL_arraysize(step->mapping));
- step->axis = -1;
- step->button = -1;
- step->hat = -1;
- step->hat_value = -1;
-
- switch(step->marker) {
- case MARKER_AXIS:
- marker = axis;
- break;
- case MARKER_BUTTON:
- marker = button;
- break;
- default:
- break;
- }
-
- dst.x = step->x;
- dst.y = step->y;
- SDL_QueryTexture(marker, NULL, NULL, &dst.w, &dst.h);
- next=SDL_FALSE;
-
- SDL_SetRenderDrawColor(screen, 0xFF, 0xFF, 0xFF, SDL_ALPHA_OPAQUE);
-
- while (!done && !next) {
- if (SDL_GetTicks() - alpha_ticks > 5) {
- alpha_ticks = SDL_GetTicks();
- alpha += alpha_step;
- if (alpha == 255) {
- alpha_step = -1;
- }
- if (alpha < 128) {
- alpha_step = 1;
- }
- }
-
- SDL_RenderClear(screen);
- SDL_RenderCopy(screen, background, NULL, NULL);
- SDL_SetTextureAlphaMod(marker, alpha);
- SDL_SetTextureColorMod(marker, 10, 255, 21);
- SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, 0);
- SDL_RenderPresent(screen);
-
- if (SDL_PollEvent(&event)) {
- switch (event.type) {
- case SDL_JOYAXISMOTION:
- if ((event.jaxis.value > 20000 || event.jaxis.value < -20000) && event.jaxis.value != -32768) {
- for (_s = 0; _s < s; _s++) {
- if (steps[_s].axis == event.jaxis.axis) {
- break;
- }
- }
- if (_s == s) {
- step->axis = event.jaxis.axis;
- SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
- SDL_snprintf(temp, SDL_arraysize(temp), ":a%u,", event.jaxis.axis);
- SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
- s++;
- next=SDL_TRUE;
- }
- }
-
- break;
- case SDL_JOYHATMOTION:
- if (event.jhat.value == SDL_HAT_CENTERED) {
- break; /* ignore centering, we're probably just coming back to the center from the previous item we set. */
- }
- for (_s = 0; _s < s; _s++) {
- if (steps[_s].hat == event.jhat.hat && steps[_s].hat_value == event.jhat.value) {
- break;
- }
- }
- if (_s == s) {
- step->hat = event.jhat.hat;
- step->hat_value = event.jhat.value;
- SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
- SDL_snprintf(temp, SDL_arraysize(temp), ":h%u.%u,", event.jhat.hat, event.jhat.value );
- SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
- s++;
- next=SDL_TRUE;
- }
- break;
- case SDL_JOYBALLMOTION:
- break;
- case SDL_JOYBUTTONUP:
- for (_s = 0; _s < s; _s++) {
- if (steps[_s].button == event.jbutton.button) {
- break;
- }
- }
- if (_s == s) {
- step->button = event.jbutton.button;
- SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
- SDL_snprintf(temp, SDL_arraysize(temp), ":b%u,", event.jbutton.button);
- SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
- s++;
- next=SDL_TRUE;
- }
- break;
- case SDL_FINGERDOWN:
- case SDL_MOUSEBUTTONDOWN:
- /* Skip this step */
- s++;
- next=SDL_TRUE;
- break;
- case SDL_KEYDOWN:
- if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
- /* Undo! */
- if (s > 0) {
- prev_step = &steps[--s];
- SDL_strlcpy(mapping, prev_step->mapping, SDL_arraysize(prev_step->mapping));
- next = SDL_TRUE;
- }
- break;
- }
- if (event.key.keysym.sym == SDLK_SPACE) {
- /* Skip this step */
- s++;
- next=SDL_TRUE;
- break;
- }
-
- if ((event.key.keysym.sym != SDLK_ESCAPE)) {
- break;
- }
- /* Fall through to signal quit */
- case SDL_QUIT:
- done = SDL_TRUE;
- break;
- default:
- break;
- }
- }
- }
-
- }
-
- if (s == SDL_arraysize(steps) ) {
- SDL_Log("Mapping:\n\n%s\n\n", mapping);
- /* Print to stdout as well so the user can cat the output somewhere */
- printf("%s\n", mapping);
- }
-
- while(SDL_PollEvent(&event)) {};
-
- SDL_DestroyRenderer(screen);
- SDL_DestroyWindow(window);
- return retval;
-}
-
-int
-main(int argc, char *argv[])
-{
- const char *name;
- int i;
- SDL_Joystick *joystick;
-
- /* Enable standard application logging */
- SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
-
- /* Initialize SDL (Note: video is required to start event loop) */
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
- exit(1);
- }
-
- /* Print information about the joysticks */
- SDL_Log("There are %d joysticks attached\n", SDL_NumJoysticks());
- for (i = 0; i < SDL_NumJoysticks(); ++i) {
- name = SDL_JoystickNameForIndex(i);
- SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick");
- joystick = SDL_JoystickOpen(i);
- if (joystick == NULL) {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i,
- SDL_GetError());
- } else {
- char guid[64];
- SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick),
- guid, sizeof (guid));
- SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick));
- SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joystick));
- SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick));
- SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
- SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
- SDL_Log(" guid: %s\n", guid);
- SDL_JoystickClose(joystick);
- }
- }
-
-#ifdef __ANDROID__
- if (SDL_NumJoysticks() > 0) {
-#else
- if (argv[1]) {
-#endif
- SDL_bool reportederror = SDL_FALSE;
- SDL_bool keepGoing = SDL_TRUE;
- SDL_Event event;
- int device;
-#ifdef __ANDROID__
- device = 0;
-#else
- device = atoi(argv[1]);
-#endif
- joystick = SDL_JoystickOpen(device);
-
- while ( keepGoing ) {
- if (joystick == NULL) {
- if ( !reportederror ) {
- SDL_Log("Couldn't open joystick %d: %s\n", device, SDL_GetError());
- keepGoing = SDL_FALSE;
- reportederror = SDL_TRUE;
- }
- } else {
- reportederror = SDL_FALSE;
- keepGoing = WatchJoystick(joystick);
- SDL_JoystickClose(joystick);
- }
-
- joystick = NULL;
- if (keepGoing) {
- SDL_Log("Waiting for attach\n");
- }
- while (keepGoing) {
- SDL_WaitEvent(&event);
- if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN)
- || (event.type == SDL_MOUSEBUTTONDOWN)) {
- keepGoing = SDL_FALSE;
- } else if (event.type == SDL_JOYDEVICEADDED) {
- joystick = SDL_JoystickOpen(device);
- break;
- }
- }
- }
- }
- else {
- SDL_Log("\n\nUsage: ./controllermap number\nFor example: ./controllermap 0\nOr: ./controllermap 0 >> gamecontrollerdb.txt");
- }
- SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
-
- return 0;
-}
-
-#else
-
-int
-main(int argc, char *argv[])
-{
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Joystick support.\n");
- exit(1);
-}
-
-#endif
diff --git a/3rdparty/sdl2-2.0.4/test/testime.c b/3rdparty/sdl2-2.0.4/test/testime.c
deleted file mode 100644
index d6e7ea1f26..0000000000
--- a/3rdparty/sdl2-2.0.4/test/testime.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely.
-*/
-/* A simple program to test the Input Method support in the SDL library (2.0+) */
-
-#include
-#include
-#include
-
-#include "SDL.h"
-#ifdef HAVE_SDL_TTF
-#include "SDL_ttf.h"
-#endif
-
-#include "SDL_test_common.h"
-
-#define DEFAULT_PTSIZE 30
-#define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf"
-#define MAX_TEXT_LENGTH 256
-
-static SDLTest_CommonState *state;
-static SDL_Rect textRect, markedRect;
-static SDL_Color lineColor = {0,0,0,0};
-static SDL_Color backColor = {255,255,255,0};
-static SDL_Color textColor = {0,0,0,0};
-static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
-static int cursor = 0;
-#ifdef HAVE_SDL_TTF
-static TTF_Font *font;
-#endif
-
-size_t utf8_length(unsigned char c)
-{
- c = (unsigned char)(0xff & c);
- if (c < 0x80)
- return 1;
- else if ((c >> 5) ==0x6)
- return 2;
- else if ((c >> 4) == 0xe)
- return 3;
- else if ((c >> 3) == 0x1e)
- return 4;
- else
- return 0;
-}
-
-char *utf8_next(char *p)
-{
- size_t len = utf8_length(*p);
- size_t i = 0;
- if (!len)
- return 0;
-
- for (; i < len; ++i)
- {
- ++p;
- if (!*p)
- return 0;
- }
- return p;
-}
-
-char *utf8_advance(char *p, size_t distance)
-{
- size_t i = 0;
- for (; i < distance && p; ++i)
- {
- p = utf8_next(p);
- }
- return p;
-}
-
-void usage()
-{
- SDL_Log("usage: testime [--font fontfile]\n");
- exit(0);
-}
-
-void InitInput()
-{
-
- /* Prepare a rect for text input */
- textRect.x = textRect.y = 100;
- textRect.w = DEFAULT_WINDOW_WIDTH - 2 * textRect.x;
- textRect.h = 50;
-
- text[0] = 0;
- markedRect = textRect;
- markedText[0] = 0;
-
- SDL_StartTextInput();
-}
-
-void CleanupVideo()
-{
- SDL_StopTextInput();
-#ifdef HAVE_SDL_TTF
- TTF_CloseFont(font);
- TTF_Quit();
-#endif
-}
-
-
-void _Redraw(SDL_Renderer * renderer) {
- int w = 0, h = textRect.h;
- SDL_Rect cursorRect, underlineRect;
-
- SDL_SetRenderDrawColor(renderer, 255,255,255,255);
- SDL_RenderFillRect(renderer,&textRect);
-
-#ifdef HAVE_SDL_TTF
- if (*text)
- {
- SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, textColor);
- SDL_Rect dest = {textRect.x, textRect.y, textSur->w, textSur->h };
-
- SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer,textSur);
- SDL_FreeSurface(textSur);
-
- SDL_RenderCopy(renderer,texture,NULL,&dest);
- SDL_DestroyTexture(texture);
- TTF_SizeUTF8(font, text, &w, &h);
- }
-#endif
-
- markedRect.x = textRect.x + w;
- markedRect.w = textRect.w - w;
- if (markedRect.w < 0)
- {
- /* Stop text input because we cannot hold any more characters */
- SDL_StopTextInput();
- return;
- }
- else
- {
- SDL_StartTextInput();
- }
-
- cursorRect = markedRect;
- cursorRect.w = 2;
- cursorRect.h = h;
-
- SDL_SetRenderDrawColor(renderer, 255,255,255,255);
- SDL_RenderFillRect(renderer,&markedRect);
-
- if (markedText[0])
- {
-#ifdef HAVE_SDL_TTF
- if (cursor)
- {
- char *p = utf8_advance(markedText, cursor);
- char c = 0;
- if (!p)
- p = &markedText[strlen(markedText)];
-
- c = *p;
- *p = 0;
- TTF_SizeUTF8(font, markedText, &w, 0);
- cursorRect.x += w;
- *p = c;
- }
- SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, markedText, textColor);
- SDL_Rect dest = {markedRect.x, markedRect.y, textSur->w, textSur->h };
- TTF_SizeUTF8(font, markedText, &w, &h);
- SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer,textSur);
- SDL_FreeSurface(textSur);
-
- SDL_RenderCopy(renderer,texture,NULL,&dest);
- SDL_DestroyTexture(texture);
-#endif
-
- underlineRect = markedRect;
- underlineRect.y += (h - 2);
- underlineRect.h = 2;
- underlineRect.w = w;
-
- SDL_SetRenderDrawColor(renderer, 0,0,0,0);
- SDL_RenderFillRect(renderer,&markedRect);
- }
-
- SDL_SetRenderDrawColor(renderer, 0,0,0,0);
- SDL_RenderFillRect(renderer,&cursorRect);
-
- SDL_SetTextInputRect(&markedRect);
-}
-
-void Redraw() {
- int i;
- for (i = 0; i < state->num_windows; ++i) {
- SDL_Renderer *renderer = state->renderers[i];
- if (state->windows[i] == NULL)
- continue;
- SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
- SDL_RenderClear(renderer);
-
- _Redraw(renderer);
-
- SDL_RenderPresent(renderer);
- }
-}
-
-int main(int argc, char *argv[]) {
- int i, done;
- SDL_Event event;
- const char *fontname = DEFAULT_FONT;
-
- /* Enable standard application logging */
- SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
-
- /* Initialize test framework */
- state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
- if (!state) {
- return 1;
- }
- for (i = 1; i < argc;i++) {
- SDLTest_CommonArg(state, i);
- }
- for (argc--, argv++; argc > 0; argc--, argv++)
- {
- if (strcmp(argv[0], "--help") == 0) {
- usage();
- return 0;
- }
-
- else if (strcmp(argv[0], "--font") == 0)
- {
- argc--;
- argv++;
-
- if (argc > 0)
- fontname = argv[0];
- else {
- usage();
- return 0;
- }
- }
- }
-
- if (!SDLTest_CommonInit(state)) {
- return 2;
- }
-
-
-#ifdef HAVE_SDL_TTF
- /* Initialize fonts */
- TTF_Init();
-
- font = TTF_OpenFont(fontname, DEFAULT_PTSIZE);
- if (! font)
- {
- SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to find font: %s\n", TTF_GetError());
- exit(-1);
- }
-#endif
-
- SDL_Log("Using font: %s\n", fontname);
- atexit(SDL_Quit);
-
- InitInput();
- /* Create the windows and initialize the renderers */
- for (i = 0; i < state->num_windows; ++i) {
- SDL_Renderer *renderer = state->renderers[i];
- SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE);
- SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
- SDL_RenderClear(renderer);
- }
- Redraw();
- /* Main render loop */
- done = 0;
- while (!done) {
- /* Check for events */
- while (SDL_PollEvent(&event)) {
- SDLTest_CommonEvent(state, &event, &done);
- switch(event.type) {
- case SDL_KEYDOWN: {
- switch (event.key.keysym.sym)
- {
- case SDLK_RETURN:
- text[0]=0x00;
- Redraw();
- break;
- case SDLK_BACKSPACE:
- {
- size_t textlen = SDL_strlen(text);
-
- do {
- if (textlen==0)
- {
- break;
- }
- if ((text[textlen-1] & 0x80) == 0x00)
- {
- /* One byte */
- text[textlen-1]=0x00;
- break;
- }
- if ((text[textlen-1] & 0xC0) == 0x80)
- {
- /* Byte from the multibyte sequence */
- text[textlen-1]=0x00;
- textlen--;
- }
- if ((text[textlen-1] & 0xC0) == 0xC0)
- {
- /* First byte of multibyte sequence */
- text[textlen-1]=0x00;
- break;
- }
- } while(1);
-
- Redraw();
- }
- break;
- }
-
- if (done)
- {
- break;
- }
-
- SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08X = %s\n",
- event.key.keysym.scancode,
- SDL_GetScancodeName(event.key.keysym.scancode),
- event.key.keysym.sym, SDL_GetKeyName(event.key.keysym.sym));
- break;
-
- case SDL_TEXTINPUT:
- if (event.text.text[0] == '\0' || event.text.text[0] == '\n' ||
- markedRect.w < 0)
- break;
-
- SDL_Log("Keyboard: text input \"%s\"\n", event.text.text);
-
- if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text))
- SDL_strlcat(text, event.text.text, sizeof(text));
-
- SDL_Log("text inputed: %s\n", text);
-
- /* After text inputed, we can clear up markedText because it */
- /* is committed */
- markedText[0] = 0;
- Redraw();
- break;
-
- case SDL_TEXTEDITING:
- SDL_Log("text editing \"%s\", selected range (%d, %d)\n",
- event.edit.text, event.edit.start, event.edit.length);
-
- strcpy(markedText, event.edit.text);
- cursor = event.edit.start;
- Redraw();
- break;
- }
- break;
-
- }
- }
- }
- CleanupVideo();
- SDLTest_CommonQuit(state);
- return 0;
-}
-
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/3rdparty/sdl2-2.0.4/test/testplatform.c b/3rdparty/sdl2-2.0.4/test/testplatform.c
deleted file mode 100644
index 14acac4b11..0000000000
--- a/3rdparty/sdl2-2.0.4/test/testplatform.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- Copyright (C) 1997-2016 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely.
-*/
-
-#include
-
-#include "SDL.h"
-
-/*
- * Watcom C flags these as Warning 201: "Unreachable code" if you just
- * compare them directly, so we push it through a function to keep the
- * compiler quiet. --ryan.
- */
-static int
-badsize(size_t sizeoftype, size_t hardcodetype)
-{
- return sizeoftype != hardcodetype;
-}
-
-int
-TestTypes(SDL_bool verbose)
-{
- int error = 0;
-
- if (badsize(sizeof(Uint8), 1)) {
- if (verbose)
- SDL_Log("sizeof(Uint8) != 1, instead = %u\n",
- (unsigned int)sizeof(Uint8));
- ++error;
- }
- if (badsize(sizeof(Uint16), 2)) {
- if (verbose)
- SDL_Log("sizeof(Uint16) != 2, instead = %u\n",
- (unsigned int)sizeof(Uint16));
- ++error;
- }
- if (badsize(sizeof(Uint32), 4)) {
- if (verbose)
- SDL_Log("sizeof(Uint32) != 4, instead = %u\n",
- (unsigned int)sizeof(Uint32));
- ++error;
- }
- if (badsize(sizeof(Uint64), 8)) {
- if (verbose)
- SDL_Log("sizeof(Uint64) != 8, instead = %u\n",
- (unsigned int)sizeof(Uint64));
- ++error;
- }
- if (verbose && !error)
- SDL_Log("All data types are the expected size.\n");
-
- return (error ? 1 : 0);
-}
-
-int
-TestEndian(SDL_bool verbose)
-{
- int error = 0;
- Uint16 value = 0x1234;
- int real_byteorder;
- Uint16 value16 = 0xCDAB;
- Uint16 swapped16 = 0xABCD;
- Uint32 value32 = 0xEFBEADDE;
- Uint32 swapped32 = 0xDEADBEEF;
- Uint64 value64, swapped64;
-
- value64 = 0xEFBEADDE;
- value64 <<= 32;
- value64 |= 0xCDAB3412;
- swapped64 = 0x1234ABCD;
- swapped64 <<= 32;
- swapped64 |= 0xDEADBEEF;
-
- if (verbose) {
- SDL_Log("Detected a %s endian machine.\n",
- (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big");
- }
- if ((*((char *) &value) >> 4) == 0x1) {
- real_byteorder = SDL_BIG_ENDIAN;
- } else {
- real_byteorder = SDL_LIL_ENDIAN;
- }
- if (real_byteorder != SDL_BYTEORDER) {
- if (verbose) {
- SDL_Log("Actually a %s endian machine!\n",
- (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big");
- }
- ++error;
- }
- if (verbose) {
- SDL_Log("Value 16 = 0x%X, swapped = 0x%X\n", value16,
- SDL_Swap16(value16));
- }
- if (SDL_Swap16(value16) != swapped16) {
- if (verbose) {
- SDL_Log("16 bit value swapped incorrectly!\n");
- }
- ++error;
- }
- if (verbose) {
- SDL_Log("Value 32 = 0x%X, swapped = 0x%X\n", value32,
- SDL_Swap32(value32));
- }
- if (SDL_Swap32(value32) != swapped32) {
- if (verbose) {
- SDL_Log("32 bit value swapped incorrectly!\n");
- }
- ++error;
- }
- if (verbose) {
- SDL_Log("Value 64 = 0x%"SDL_PRIX64", swapped = 0x%"SDL_PRIX64"\n", value64,
- SDL_Swap64(value64));
- }
- if (SDL_Swap64(value64) != swapped64) {
- if (verbose) {
- SDL_Log("64 bit value swapped incorrectly!\n");
- }
- ++error;
- }
- return (error ? 1 : 0);
-}
-
-
-int
-TestCPUInfo(SDL_bool verbose)
-{
- if (verbose) {
- SDL_Log("CPU count: %d\n", SDL_GetCPUCount());
- SDL_Log("CPU cache line size: %d\n", SDL_GetCPUCacheLineSize());
- SDL_Log("RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected");
- SDL_Log("AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected");
- SDL_Log("MMX %s\n", SDL_HasMMX()? "detected" : "not detected");
- SDL_Log("3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected");
- SDL_Log("SSE %s\n", SDL_HasSSE()? "detected" : "not detected");
- SDL_Log("SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected");
- SDL_Log("SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected");
- SDL_Log("SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected");
- SDL_Log("SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected");
- SDL_Log("AVX %s\n", SDL_HasAVX()? "detected" : "not detected");
- SDL_Log("System RAM %d MB\n", SDL_GetSystemRAM());
- }
- return (0);
-}
-
-int
-TestAssertions(SDL_bool verbose)
-{
- SDL_assert(1);
- SDL_assert_release(1);
- SDL_assert_paranoid(1);
- SDL_assert(0 || 1);
- SDL_assert_release(0 || 1);
- SDL_assert_paranoid(0 || 1);
-
-#if 0 /* enable this to test assertion failures. */
- SDL_assert_release(1 == 2);
- SDL_assert_release(5 < 4);
- SDL_assert_release(0 && "This is a test");
-#endif
-
- {
- const SDL_AssertData *item = SDL_GetAssertionReport();
- while (item) {
- SDL_Log("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
- item->condition, item->function, item->filename,
- item->linenum, item->trigger_count,
- item->always_ignore ? "yes" : "no");
- item = item->next;
- }
- }
- return (0);
-}
-
-int
-main(int argc, char *argv[])
-{
- SDL_bool verbose = SDL_TRUE;
- int status = 0;
-
- /* Enable standard application logging */
- SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
-
- if (argv[1] && (SDL_strcmp(argv[1], "-q") == 0)) {
- verbose = SDL_FALSE;
- }
- if (verbose) {
- SDL_Log("This system is running %s\n", SDL_GetPlatform());
- }
-
- status += TestTypes(verbose);
- status += TestEndian(verbose);
- status += TestCPUInfo(verbose);
- status += TestAssertions(verbose);
-
- return status;
-}
diff --git a/3rdparty/sdl2-2.0.4/Android.mk b/3rdparty/sdl2-2.0.9/Android.mk
old mode 100755
new mode 100644
similarity index 66%
rename from 3rdparty/sdl2-2.0.4/Android.mk
rename to 3rdparty/sdl2-2.0.9/Android.mk
index 13d765f579..9ce879a111
--- a/3rdparty/sdl2-2.0.4/Android.mk
+++ b/3rdparty/sdl2-2.0.9/Android.mk
@@ -20,7 +20,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
- $(LOCAL_PATH)/src/atomic/SDL_atomic.c \
+ $(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
@@ -28,13 +28,16 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
- $(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
@@ -44,11 +47,18 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
+LOCAL_SHARED_LIBRARIES := hidapi
+
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
+ifeq ($(NDK_DEBUG),1)
+ cmd-strip :=
+endif
+
include $(BUILD_SHARED_LIBRARY)
###########################
@@ -61,9 +71,40 @@ LOCAL_MODULE := SDL2_static
LOCAL_MODULE_FILENAME := libSDL2
-LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(LOCAL_PATH)/src/main/android/SDL_android_main.c)
-
LOCAL_LDLIBS :=
-LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
+LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
+
+include $(BUILD_STATIC_LIBRARY)
+
+###########################
+#
+# SDL main static library
+#
+###########################
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+
+LOCAL_MODULE := SDL2_main
+
+LOCAL_MODULE_FILENAME := libSDL2main
include $(BUILD_STATIC_LIBRARY)
+
+###########################
+#
+# hidapi library
+#
+###########################
+
+include $(CLEAR_VARS)
+
+LOCAL_CPPFLAGS += -std=c++11
+
+LOCAL_SRC_FILES := src/hidapi/android/hid.cpp
+
+LOCAL_MODULE := libhidapi
+LOCAL_LDLIBS := -llog
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/3rdparty/sdl2-2.0.4/BUGS.txt b/3rdparty/sdl2-2.0.9/BUGS.txt
similarity index 64%
rename from 3rdparty/sdl2-2.0.4/BUGS.txt
rename to 3rdparty/sdl2-2.0.9/BUGS.txt
index 7ef5538752..57d953ffea 100644
--- a/3rdparty/sdl2-2.0.4/BUGS.txt
+++ b/3rdparty/sdl2-2.0.9/BUGS.txt
@@ -1,15 +1,15 @@
Bugs are now managed in the SDL bug tracker, here:
- http://bugzilla.libsdl.org/
+ https://bugzilla.libsdl.org/
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
-You may also find help on the SDL mailing list. Subscription information:
+You may also find help at the SDL forums/mailing list:
- http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
+ https://discourse.libsdl.org/
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
bugs discussed on the mailing list may be forgotten or missed.
diff --git a/3rdparty/sdl2-2.0.4/CMakeLists.txt b/3rdparty/sdl2-2.0.9/CMakeLists.txt
old mode 100755
new mode 100644
similarity index 74%
rename from 3rdparty/sdl2-2.0.4/CMakeLists.txt
rename to 3rdparty/sdl2-2.0.9/CMakeLists.txt
index 74356b60f0..0128c7ac7d
--- a/3rdparty/sdl2-2.0.4/CMakeLists.txt
+++ b/3rdparty/sdl2-2.0.9/CMakeLists.txt
@@ -2,19 +2,32 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there")
endif()
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.11)
project(SDL2 C)
+
+# !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property
+# !!! FIXME: for the SDL2 shared library (so you get an
+# !!! FIXME: install_name ("soname") of "@rpath/libSDL-whatever.dylib"
+# !!! FIXME: instead of "/usr/local/lib/libSDL-whatever.dylib"), but I'm
+# !!! FIXME: punting for now and leaving the existing behavior. Until this
+# !!! FIXME: properly resolved, this line silences a warning in CMake 3.0+.
+# !!! FIXME: remove it and this comment entirely once the problem is
+# !!! FIXME: properly resolved.
+#cmake_policy(SET CMP0042 OLD)
+
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckIncludeFiles)
include(CheckIncludeFile)
include(CheckSymbolExists)
+include(CheckCSourceCompiles)
include(CheckCSourceRuns)
include(CheckCCompilerFlag)
include(CheckTypeSize)
include(CheckStructHasMember)
include(CMakeDependentOption)
include(FindPkgConfig)
+include(GNUInstallDirs)
set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
@@ -29,10 +42,19 @@ include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 0)
-set(SDL_MICRO_VERSION 4)
+set(SDL_MICRO_VERSION 9)
set(SDL_INTERFACE_AGE 0)
-set(SDL_BINARY_AGE 4)
+set(SDL_BINARY_AGE 9)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
+# the following should match the versions in Xcode project file:
+set(DYLIB_CURRENT_VERSION 10.0.0)
+set(DYLIB_COMPATIBILITY_VERSION 1.0.0)
+
+# Set defaults preventing destination file conflicts
+set(SDL_CMAKE_DEBUG_POSTFIX "d"
+ CACHE STRING "Name suffix for debug builds")
+
+mark_as_advanced(CMAKE_IMPORT_LIBRARY_SUFFIX SDL_CMAKE_DEBUG_POSTFIX)
# Calculate a libtool-like version number
math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}")
@@ -125,7 +147,9 @@ endif()
# Default option knobs
if(APPLE OR ARCH_64)
- set(OPT_DEF_SSEMATH ON)
+ if(NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm")
+ set(OPT_DEF_SSEMATH ON)
+ endif()
endif()
if(UNIX OR MINGW OR MSYS)
set(OPT_DEF_LIBC ON)
@@ -145,10 +169,16 @@ else()
set(OPT_DEF_ASM FALSE)
endif()
+if(USE_GCC OR USE_CLANG)
+ set(OPT_DEF_GCC_ATOMICS ON)
+endif()
+
# Default flags, if not set otherwise
if("$ENV{CFLAGS}" STREQUAL "")
- if(USE_GCC OR USE_CLANG)
- set(CMAKE_C_FLAGS "-g -O3")
+ if(CMAKE_BUILD_TYPE STREQUAL "")
+ if(USE_GCC OR USE_CLANG)
+ set(CMAKE_C_FLAGS "-g -O3")
+ endif()
endif()
else()
set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
@@ -183,8 +213,14 @@ endif()
set(SDL_LIBS "-lSDL2")
set(SDL_CFLAGS "")
-# Emscripten toolchain has a nonempty default value for this, and the checks
-# in this file need to change that, so remember the original value, and
+# When building shared lib for Windows with MinGW,
+# avoid the DLL having a "lib" prefix
+if(WINDOWS)
+ set(CMAKE_SHARED_LIBRARY_PREFIX "")
+endif()
+
+# Emscripten toolchain has a nonempty default value for this, and the checks
+# in this file need to change that, so remember the original value, and
# restore back to that afterwards. For check_function_exists() to work in
# Emscripten, this value must be at its default value.
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
@@ -192,7 +228,7 @@ set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CYGWIN)
# We build SDL on cygwin without the UNIX emulation layer
include_directories("-I/usr/include/mingw")
- set(CMAKE_REQUIRED_FLAGS "-mno-cygwin")
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mno-cygwin")
check_c_source_compiles("int main(int argc, char **argv) {}"
HAVE_GCC_NO_CYGWIN)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
@@ -206,13 +242,18 @@ endif()
add_definitions(-DUSING_GENERATED_CONFIG_H)
# General includes
include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
+if(USE_GCC OR USE_CLANG)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter ${SDL2_SOURCE_DIR}/src/video/khronos")
+else()
+ include_directories(${SDL2_SOURCE_DIR}/src/video/khronos)
+endif()
# All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
# you only need to have a platform override them if they are disabling.
set(OPT_DEF_ASM TRUE)
if(EMSCRIPTEN)
# Set up default values for the currently supported set of subsystems:
- # Emscripten/Javascript does not have assembly support, a dynamic library
+ # Emscripten/Javascript does not have assembly support, a dynamic library
# loading architecture, low-level CPU inspection or multithreading.
set(OPT_DEF_ASM FALSE)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
@@ -229,7 +270,7 @@ endif()
set(SDL_SUBSYSTEMS
Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
- File Loadso CPUinfo Filesystem Dlopen)
+ File Loadso CPUinfo Filesystem Dlopen Sensor)
foreach(_SUB ${SDL_SUBSYSTEMS})
string(TOUPPER ${_SUB} _OPT)
if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
@@ -241,20 +282,19 @@ endforeach()
option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
#set_option(DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
set_option(LIBC "Use the system C library" ${OPT_DEF_LIBC})
-set_option(GCC_ATOMICS "Use gcc builtin atomics" ${USE_GCC})
+set_option(GCC_ATOMICS "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS})
set_option(ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM})
set_option(SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
set_option(MMX "Use MMX assembly routines" ${OPT_DEF_ASM})
set_option(3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
set_option(SSE "Use SSE assembly routines" ${OPT_DEF_ASM})
set_option(SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
+set_option(SSE3 "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH})
set_option(ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM})
set_option(DISKAUDIO "Support the disk writer audio driver" ON)
set_option(DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF)
dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
-set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
-dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(VIDEO_DUMMY "Use dummy video driver" ON)
set_option(VIDEO_OPENGL "Include OpenGL support" ON)
set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON)
@@ -264,6 +304,8 @@ set_option(SDL_DLOPEN "Use dlopen for shared object loading" ${SDL_DLOP
set_option(OSS "Support the OSS audio API" ${UNIX_SYS})
set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS})
dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF)
+set_option(JACK "Support the JACK audio API" ${UNIX_SYS})
+dep_option(JACK_SHARED "Dynamically load JACK audio support" ON "JACK" OFF)
set_option(ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS})
dep_option(ESD_SHARED "Dynamically load ESD audio support" ON "ESD" OFF)
set_option(PULSEAUDIO "Use PulseAudio" ${UNIX_SYS})
@@ -273,6 +315,10 @@ dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" O
set_option(NAS "Support the NAS audio API" ${UNIX_SYS})
set_option(NAS_SHARED "Dynamically load NAS audio API" ${UNIX_SYS})
set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS})
+set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
+dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
+set_option(LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS})
+dep_option(LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "LIBSAMPLERATE" OFF)
set_option(RPATH "Use an rpath when linking SDL" ${UNIX_SYS})
set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF)
set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS})
@@ -291,14 +337,21 @@ foreach(_SUB ${SDL_X11_OPTIONS})
endforeach()
set_option(VIDEO_COCOA "Use Cocoa video driver" ${APPLE})
set_option(DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
+set_option(WASAPI "Use the Windows WASAPI audio driver" ${WINDOWS})
set_option(RENDER_D3D "Enable the Direct3D render driver" ${WINDOWS})
set_option(VIDEO_VIVANTE "Use Vivante EGL video driver" ${UNIX_SYS})
+dep_option(VIDEO_VULKAN "Enable Vulkan support" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
+set_option(VIDEO_KMSDRM "Use KMS DRM video driver" ${UNIX_SYS})
+dep_option(KMSDRM_SHARED "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF)
# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
# The options below are for compatibility to configure's default behaviour.
set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
+dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF)
+set_option(SDL_TEST "Build the test directory" OFF)
+
# General source files
file(GLOB SOURCE_FILES
${SDL2_SOURCE_DIR}/src/*.c
@@ -314,7 +367,8 @@ file(GLOB SOURCE_FILES
${SDL2_SOURCE_DIR}/src/stdlib/*.c
${SDL2_SOURCE_DIR}/src/thread/*.c
${SDL2_SOURCE_DIR}/src/timer/*.c
- ${SDL2_SOURCE_DIR}/src/video/*.c)
+ ${SDL2_SOURCE_DIR}/src/video/*.c
+ ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
if(ASSERTIONS STREQUAL "auto")
@@ -334,6 +388,24 @@ set(HAVE_ASSERTIONS ${ASSERTIONS})
# Compiler option evaluation
if(USE_GCC OR USE_CLANG)
+ # Check for -Wall first, so later things can override pieces of it.
+ check_c_compiler_flag(-Wall HAVE_GCC_WALL)
+ if(HAVE_GCC_WALL)
+ list(APPEND EXTRA_CFLAGS "-Wall")
+ if(HAIKU)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
+ endif()
+ endif()
+
+ check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+ if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+ check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
+ if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
+ list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement")
+ endif()
+ list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")
+ endif()
+
if(DEPENDENCY_TRACKING)
check_c_source_compiles("
#if !defined(__GNUC__) || __GNUC__ < 3
@@ -375,23 +447,22 @@ if(USE_GCC OR USE_CLANG)
endif()
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
- check_c_compiler_flag(-Wall HAVE_GCC_WALL)
- if(HAVE_GCC_WALL)
- list(APPEND EXTRA_CFLAGS "-Wall")
- if(HAIKU)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
- endif()
- endif()
check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
if(HAVE_GCC_WSHADOW)
list(APPEND EXTRA_CFLAGS "-Wshadow")
endif()
- set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
- check_c_compiler_flag("" HAVE_NO_UNDEFINED)
- set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
- if(HAVE_NO_UNDEFINED)
- list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
+ if(APPLE)
+ list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
+ list(APPEND EXTRA_LDFLAGS "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}")
+ list(APPEND EXTRA_LDFLAGS "-Wl,-current_version,${DYLIB_CURRENT_VERSION}")
+ else()
+ set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
+ check_c_compiler_flag("" HAVE_NO_UNDEFINED)
+ set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
+ if(HAVE_NO_UNDEFINED)
+ list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
+ endif()
endif()
endif()
@@ -487,15 +558,43 @@ if(ASSEMBLY)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
endif()
- if(SSEMATH)
- if(SSE OR SSE2)
+ if(SSE3)
+ set(CMAKE_REQUIRED_FLAGS "-msse3")
+ check_c_source_compiles("
+ #ifdef __MINGW32__
+ #include <_mingw.h>
+ #ifdef __MINGW64_VERSION_MAJOR
+ #include
+ #else
+ #include
+ #endif
+ #else
+ #include
+ #endif
+ #ifndef __SSE3__
+ #error Assembler CPP flag not enabled
+ #endif
+ int main(int argc, char **argv) { }" HAVE_SSE3)
+ if(HAVE_SSE3)
+ list(APPEND EXTRA_CFLAGS "-msse3")
+ endif()
+ set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
+ endif()
+
+ if(NOT SSEMATH)
+ if(SSE OR SSE2 OR SSE3)
if(USE_GCC)
- list(APPEND EXTRA_CFLAGS "-mfpmath=387")
+ check_c_compiler_flag(-mfpmath=387 HAVE_FP_387)
+ if(HAVE_FP_387)
+ list(APPEND EXTRA_CFLAGS "-mfpmath=387")
+ endif()
endif()
set(HAVE_SSEMATH TRUE)
endif()
endif()
+ check_include_file("immintrin.h" HAVE_IMMINTRIN_H)
+
if(ALTIVEC)
set(CMAKE_REQUIRED_FLAGS "-maltivec")
check_c_source_compiles("
@@ -528,12 +627,13 @@ if(ASSEMBLY)
endif()
set(HAVE_SSE TRUE)
set(HAVE_SSE2 TRUE)
+ set(HAVE_SSE3 TRUE)
set(SDL_ASSEMBLY_ROUTINES 1)
endif()
# TODO:
#else()
# if(USE_GCC OR USE_CLANG)
-# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
+# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-sse3" "-mno-mmx")
# endif()
endif()
@@ -542,7 +642,7 @@ endif()
if(LIBC)
if(WINDOWS AND NOT MINGW)
set(HAVE_LIBC TRUE)
- foreach(_HEADER stdio.h string.h ctype.h math.h)
+ foreach(_HEADER stdio.h string.h wchar.h ctype.h math.h limits.h)
string(TOUPPER "HAVE_${_HEADER}" _UPPER)
string(REPLACE "." "_" _HAVE_H ${_UPPER})
set(${_HAVE_H} 1)
@@ -550,10 +650,13 @@ if(LIBC)
set(HAVE_SIGNAL_H 1)
foreach(_FN
malloc calloc realloc free qsort abs memset memcpy memmove memcmp
+ wcslen wcscmp
strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
- _stricmp _strnicmp sscanf atan atan2 acos asin ceil copysign cos
- cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
+ _stricmp _strnicmp sscanf
+ acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf
+ copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf
+ log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
string(TOUPPER ${_FN} _UPPER)
set(HAVE_${_UPPER} 1)
endforeach()
@@ -567,8 +670,8 @@ if(LIBC)
set(HAVE_LIBC TRUE)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
foreach(_HEADER
- stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h
- strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
+ stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h
+ strings.h wchar.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h libunwind.h)
string(TOUPPER "HAVE_${_HEADER}" _UPPER)
string(REPLACE "." "_" _HAVE_H ${_UPPER})
check_include_file("${_HEADER}" ${_HAVE_H})
@@ -584,11 +687,11 @@ if(LIBC)
foreach(_FN
strtod malloc calloc realloc free getenv setenv putenv unsetenv
qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
- strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
+ _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
- vsscanf vsnprintf fseeko fseeko64 sigaction setjmp
- nanosleep sysconf sysctlbyname
+ vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp
+ nanosleep sysconf sysctlbyname getauxval poll
)
string(TOUPPER ${_FN} _UPPER)
set(_HAVEVAR "HAVE_${_UPPER}")
@@ -652,6 +755,10 @@ if(SDL_HAPTIC)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
endif()
+if(SDL_SENSOR)
+ file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${SENSOR_SOURCES})
+endif()
if(SDL_POWER)
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
@@ -698,8 +805,19 @@ endif()
if(ANDROID)
file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES})
+
+ # SDL_spinlock.c Needs to be compiled in ARM mode.
+ # There seems to be no better way currently to set the ARM mode.
+ # see: https://issuetracker.google.com/issues/62264618
+ # Another option would be to set ARM mode to all compiled files
+ check_c_compiler_flag(-marm HAVE_ARM_MODE)
+ if(HAVE_ARM_MODE)
+ set_source_files_properties(${SDL2_SOURCE_DIR}/src/atomic/SDL_spinlock.c PROPERTIES COMPILE_FLAGS -marm)
+ endif()
+
file(GLOB ANDROID_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/android/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_MAIN_SOURCES})
+ set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${ANDROID_MAIN_SOURCES})
+
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_ANDROID 1)
file(GLOB ANDROID_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/android/*.c)
@@ -712,33 +830,84 @@ if(ANDROID)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
endif()
+ if(SDL_HAPTIC)
+ set(SDL_HAPTIC_ANDROID 1)
+ file(GLOB ANDROID_HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/android/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_HAPTIC_SOURCES})
+ set(HAVE_SDL_HAPTIC TRUE)
+ endif()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_ANDROID 1)
- file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c)
+ file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
endif()
+ if(SDL_LOADSO)
+ set(SDL_LOADSO_DLOPEN 1)
+ file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
+ set(HAVE_SDL_LOADSO TRUE)
+ endif()
if(SDL_POWER)
set(SDL_POWER_ANDROID 1)
file(GLOB ANDROID_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
endif()
+ if(SDL_TIMERS)
+ set(SDL_TIMER_UNIX 1)
+ file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
+ set(HAVE_SDL_TIMERS TRUE)
+ endif()
+ if(SDL_SENSOR)
+ set(SDL_SENSOR_ANDROID 1)
+ set(HAVE_SDL_SENSORS TRUE)
+ file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_SENSOR_SOURCES})
+ endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_ANDROID 1)
file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_VIDEO_SOURCES})
set(HAVE_SDL_VIDEO TRUE)
+ # Core stuff
+ find_library(ANDROID_DL_LIBRARY dl)
+ find_library(ANDROID_LOG_LIBRARY log)
+ find_library(ANDROID_LIBRARY_LIBRARY android)
+ list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_LOG_LIBRARY} ${ANDROID_LIBRARY_LIBRARY})
+ add_definitions(-DGL_GLEXT_PROTOTYPES)
+
#enable gles
if(VIDEO_OPENGLES)
set(SDL_VIDEO_OPENGL_EGL 1)
set(HAVE_VIDEO_OPENGLES TRUE)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
+
+ find_library(OpenGLES1_LIBRARY GLESv1_CM)
+ find_library(OpenGLES2_LIBRARY GLESv2)
+ list(APPEND EXTRA_LIBS ${OpenGLES1_LIBRARY} ${OpenGLES2_LIBRARY})
+ endif()
+
+ CHECK_C_SOURCE_COMPILES("
+ #if defined(__ARM_ARCH) && __ARM_ARCH < 7
+ #error Vulkan doesn't work on this configuration
+ #endif
+ int main()
+ {
+ return 0;
+ }
+ " VULKAN_PASSED_ANDROID_CHECKS)
+ if(NOT VULKAN_PASSED_ANDROID_CHECKS)
+ set(VIDEO_VULKAN OFF)
+ message(STATUS "Vulkan doesn't work on this configuration")
endif()
endif()
- list(APPEND EXTRA_LDFLAGS "-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit")
+
+ CheckPTHREAD()
+
endif()
# Platform-specific options and settings
@@ -770,6 +939,16 @@ if(EMSCRIPTEN)
set(SOURCE_FILES ${SOURCE_FILES} ${EM_POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
endif()
+ if(SDL_TIMERS)
+ set(SDL_TIMER_UNIX 1)
+ file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
+ set(HAVE_SDL_TIMERS TRUE)
+
+ if(CLOCK_GETTIME)
+ set(HAVE_CLOCK_GETTIME 1)
+ endif()
+ endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1)
file(GLOB EM_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/emscripten/*.c)
@@ -784,17 +963,17 @@ if(EMSCRIPTEN)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
endif()
endif()
-elseif(UNIX AND NOT APPLE)
+elseif(UNIX AND NOT APPLE AND NOT ANDROID)
if(SDL_AUDIO)
if(SYSV5 OR SOLARIS OR HPUX)
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${SUN_AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
- elseif(NETBSD OR OPENBSD)
- set(SDL_AUDIO_DRIVER_BSD 1)
- file(GLOB BSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/bsd/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${BSD_AUDIO_SOURCES})
+ elseif(NETBSD)
+ set(SDL_AUDIO_DRIVER_NETBSD 1)
+ file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${NETBSD_AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
elseif(AIX)
set(SDL_AUDIO_DRIVER_PAUDIO 1)
@@ -804,12 +983,14 @@ elseif(UNIX AND NOT APPLE)
endif()
CheckOSS()
CheckALSA()
+ CheckJACK()
CheckPulseAudio()
CheckESD()
CheckARTS()
CheckNAS()
CheckSNDIO()
CheckFusionSound()
+ CheckLibSampleRate()
endif()
if(SDL_VIDEO)
@@ -822,6 +1003,12 @@ elseif(UNIX AND NOT APPLE)
CheckOpenGLESX11()
CheckWayland()
CheckVivante()
+ CheckKMSDRM()
+ endif()
+
+ if(UNIX)
+ file(GLOB CORE_UNIX_SOURCES ${SDL2_SOURCE_DIR}/src/core/unix/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${CORE_UNIX_SOURCES})
endif()
if(LINUX)
@@ -836,15 +1023,15 @@ elseif(UNIX AND NOT APPLE)
#include
#include
- int main(int argc, char **argv)
+ int main(int argc, char **argv)
{
struct kbentry kbe;
kbe.kb_table = KG_CTRL;
ioctl(0, KDGKBENT, &kbe);
}" HAVE_INPUT_KD)
- file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/linux/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES})
+ file(GLOB CORE_LINUX_SOURCES ${SDL2_SOURCE_DIR}/src/core/linux/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${CORE_LINUX_SOURCES})
if(HAVE_INPUT_EVENTS)
set(SDL_INPUT_LINUXEV 1)
@@ -863,8 +1050,29 @@ elseif(UNIX AND NOT APPLE)
check_include_file("libudev.h" HAVE_LIBUDEV_H)
- # !!! FIXME: this needs pkg-config to find the include path, I think.
- check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H)
+ if(PKG_CONFIG_FOUND)
+ pkg_search_module(DBUS dbus-1 dbus)
+ if(DBUS_FOUND)
+ set(HAVE_DBUS_DBUS_H TRUE)
+ include_directories(${DBUS_INCLUDE_DIRS})
+ list(APPEND EXTRA_LIBS ${DBUS_LIBRARIES})
+ endif()
+
+ pkg_search_module(IBUS ibus-1.0 ibus)
+ if(IBUS_FOUND)
+ set(HAVE_IBUS_IBUS_H TRUE)
+ include_directories(${IBUS_INCLUDE_DIRS})
+ list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
+ endif()
+ if(HAVE_LIBUNWIND_H)
+ # We've already found the header, so REQUIRE the lib to be present
+ pkg_search_module(UNWIND REQUIRED libunwind)
+ pkg_search_module(UNWIND_GENERIC REQUIRED libunwind-generic)
+ list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
+ endif()
+ endif()
+
+ check_include_file("fcitx/frontend.h" HAVE_FCITX_FRONTEND_H)
endif()
if(INPUT_TSLIB)
@@ -881,7 +1089,7 @@ elseif(UNIX AND NOT APPLE)
CheckUSBHID() # seems to be BSD specific - limit the test to BSD only?
if(LINUX AND NOT ANDROID)
set(SDL_JOYSTICK_LINUX 1)
- file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c)
+ file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
endif()
@@ -933,7 +1141,14 @@ elseif(UNIX AND NOT APPLE)
if(RPATH)
set(SDL_RLD_FLAGS "")
if(BSDI OR FREEBSD OR LINUX OR NETBSD)
- set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
+ set(CMAKE_REQUIRED_FLAGS "-Wl,--enable-new-dtags")
+ check_c_compiler_flag("" HAVE_ENABLE_NEW_DTAGS)
+ set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
+ if(HAVE_ENABLE_NEW_DTAGS)
+ set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir} -Wl,--enable-new-dtags")
+ else()
+ set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
+ endif()
elseif(SOLARIS)
set(SDL_RLD_FLAGS "-R\${libdir}")
endif()
@@ -953,9 +1168,9 @@ elseif(WINDOWS)
if(MSVC)
# Prevent codegen that would use the VC runtime libraries.
- add_definitions(/GS-)
+ set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-")
if(NOT ARCH_64)
- add_definitions(/arch:SSE)
+ set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE")
endif()
endif()
@@ -977,6 +1192,16 @@ elseif(WINDOWS)
#include
#include
int main(int argc, char **argv) { }" HAVE_XINPUT_H)
+ check_c_source_compiles("
+ #include
+ #include
+ XINPUT_GAMEPAD_EX x1;
+ int main(int argc, char **argv) { }" HAVE_XINPUT_GAMEPAD_EX)
+ check_c_source_compiles("
+ #include
+ #include
+ XINPUT_STATE_EX s1;
+ int main(int argc, char **argv) { }" HAVE_XINPUT_STATE_EX)
else()
check_include_file(xinput.h HAVE_XINPUT_H)
endif()
@@ -986,9 +1211,8 @@ elseif(WINDOWS)
check_include_file(ddraw.h HAVE_DDRAW_H)
check_include_file(dsound.h HAVE_DSOUND_H)
check_include_file(dinput.h HAVE_DINPUT_H)
- check_include_file(xaudio2.h HAVE_XAUDIO2_H)
check_include_file(dxgi.h HAVE_DXGI_H)
- if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
+ if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
set(HAVE_DIRECTX TRUE)
if(NOT CMAKE_COMPILER_IS_MINGW AND NOT USE_WINSDK_DIRECTX)
# TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
@@ -999,6 +1223,11 @@ elseif(WINDOWS)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
endif()
+ # headers needed elsewhere ...
+ check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
+ check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
+ check_include_file(endpointvolume.h HAVE_ENDPOINTVOLUME_H)
+
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_WINMM 1)
file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
@@ -1011,10 +1240,10 @@ elseif(WINDOWS)
set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
endif()
- if(HAVE_XAUDIO2_H)
- set(SDL_AUDIO_DRIVER_XAUDIO2 1)
- file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES})
+ if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
+ set(SDL_AUDIO_DRIVER_WASAPI 1)
+ file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES})
endif()
endif()
@@ -1063,7 +1292,7 @@ elseif(WINDOWS)
endif()
# Libraries for Win32 native and MinGW
- list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
+ list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 shell32)
# TODO: in configure.in the check for timers is set on
# cygwin | mingw32* - does this include mingw32CE?
@@ -1105,7 +1334,7 @@ elseif(WINDOWS)
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
if(HAVE_DINPUT_H)
set(SDL_JOYSTICK_DINPUT 1)
- list(APPEND EXTRA_LIBS dinput8 dxguid)
+ list(APPEND EXTRA_LIBS dinput8)
if(CMAKE_COMPILER_IS_MINGW)
list(APPEND EXTRA_LIBS dxerr8)
elseif (NOT USE_WINSDK_DIRECTX)
@@ -1147,15 +1376,25 @@ elseif(WINDOWS)
list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
endif()
elseif(APPLE)
- # TODO: rework this for proper MacOS X, iOS and Darwin support
+ # TODO: rework this all for proper MacOS X, iOS and Darwin support
+
+ # We always need these libs on macOS at the moment.
+ # !!! FIXME: we need Carbon for some very old API calls in
+ # !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
+ # !!! FIXME: how to dump those.
+ if(NOT IOS)
+ set(SDL_FRAMEWORK_COCOA 1)
+ set(SDL_FRAMEWORK_CARBON 1)
+ endif()
# Requires the darwin file implementation
if(SDL_FILE)
file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m)
set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
+ # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
set(HAVE_SDL_FILE TRUE)
- set(SDL_FRAMEWORK_COCOA 1)
+ # !!! FIXME: why is COREVIDEO inside this if() block?
set(SDL_FRAMEWORK_COREVIDEO 1)
else()
message_error("SDL_FILE must be enabled to build on MacOS X")
@@ -1163,16 +1402,22 @@ elseif(APPLE)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_COREAUDIO 1)
- file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
+ file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m)
+ # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
+ set_source_files_properties(${AUDIO_SOURCES} PROPERTIES LANGUAGE C)
set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE)
set(SDL_FRAMEWORK_COREAUDIO 1)
- set(SDL_FRAMEWORK_AUDIOUNIT 1)
+ set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
endif()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_IOKIT 1)
- file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
+ if (IOS)
+ file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
+ else()
+ file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
@@ -1181,7 +1426,12 @@ elseif(APPLE)
if(SDL_HAPTIC)
set(SDL_HAPTIC_IOKIT 1)
- file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
+ if (IOS)
+ file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
+ set(SDL_HAPTIC_DUMMY 1)
+ else()
+ file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
set(HAVE_SDL_HAPTIC TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
@@ -1193,10 +1443,13 @@ elseif(APPLE)
if(SDL_POWER)
set(SDL_POWER_MACOSX 1)
- file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
+ if (IOS)
+ file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
+ else()
+ file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
+ endif()
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
- set(SDL_FRAMEWORK_CARBON 1)
set(SDL_FRAMEWORK_IOKIT 1)
endif()
@@ -1210,6 +1463,7 @@ elseif(APPLE)
if(SDL_FILESYSTEM)
set(SDL_FILESYSTEM_COCOA 1)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m)
+ # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
set_source_files_properties(${FILESYSTEM_SOURCES} PROPERTIES LANGUAGE C)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
set(HAVE_SDL_FILESYSTEM TRUE)
@@ -1240,19 +1494,32 @@ elseif(APPLE)
find_library(COREAUDIO CoreAudio)
list(APPEND EXTRA_LIBS ${COREAUDIO})
endif()
- if(SDL_FRAMEWORK_AUDIOUNIT)
- find_library(AUDIOUNIT AudioUnit)
- list(APPEND EXTRA_LIBS ${AUDIOUNIT})
+ if(SDL_FRAMEWORK_AUDIOTOOLBOX)
+ find_library(AUDIOTOOLBOX AudioToolbox)
+ list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX})
endif()
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
if(SDL_VIDEO)
- CheckCOCOA()
- if(VIDEO_OPENGL)
- set(SDL_VIDEO_OPENGL 1)
- set(SDL_VIDEO_OPENGL_CGL 1)
- set(SDL_VIDEO_RENDER_OGL 1)
- set(HAVE_VIDEO_OPENGL TRUE)
+ if (IOS)
+ set(SDL_VIDEO_DRIVER_UIKIT 1)
+ file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m)
+ set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES})
+ else()
+ CheckCOCOA()
+ if(VIDEO_OPENGL)
+ set(SDL_VIDEO_OPENGL 1)
+ set(SDL_VIDEO_OPENGL_CGL 1)
+ set(SDL_VIDEO_RENDER_OGL 1)
+ set(HAVE_VIDEO_OPENGL TRUE)
+ endif()
+
+ if(VIDEO_OPENGLES)
+ set(SDL_VIDEO_OPENGL_EGL 1)
+ set(SDL_VIDEO_OPENGL_ES2 1)
+ set(SDL_VIDEO_RENDER_OGL_ES2 1)
+ set(HAVE_VIDEO_OPENGLES TRUE)
+ endif()
endif()
endif()
@@ -1289,6 +1556,11 @@ elseif(HAIKU)
CheckPTHREAD()
endif()
+if(VIDEO_VULKAN)
+ set(SDL_VIDEO_VULKAN 1)
+ set(HAVE_VIDEO_VULKAN TRUE)
+endif()
+
# Dummies
# configure.in does it differently:
# if not have X
@@ -1298,7 +1570,7 @@ endif()
# This leads to missing internal references on building, since the
# src/X/*.c does not get included.
if(NOT HAVE_SDL_JOYSTICK)
- set(SDL_JOYSTICK_DISABLED 1)
+ set(SDL_JOYSTICK_DUMMY 1)
if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
@@ -1306,10 +1578,15 @@ if(NOT HAVE_SDL_JOYSTICK)
endif()
endif()
if(NOT HAVE_SDL_HAPTIC)
- set(SDL_HAPTIC_DISABLED 1)
+ set(SDL_HAPTIC_DUMMY 1)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
endif()
+if(NOT HAVE_SDL_SENSORS)
+ set(SDL_SENSOR_DUMMY 1)
+ file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
+endif()
if(NOT HAVE_SDL_LOADSO)
set(SDL_LOADSO_DISABLED 1)
file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
@@ -1439,6 +1716,9 @@ message(STATUS " EXTRA_LIBS: ${EXTRA_LIBS}")
message(STATUS "")
message(STATUS " Build Shared Library: ${SDL_SHARED}")
message(STATUS " Build Static Library: ${SDL_STATIC}")
+if(SDL_STATIC)
+ message(STATUS " Build Static Library with Position Independent Code: ${SDL_STATIC_PIC}")
+endif()
message(STATUS "")
if(UNIX)
message(STATUS "If something was not detected, although the libraries")
@@ -1452,11 +1732,19 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
# Always build SDLmain
add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
+target_include_directories(SDL2main PUBLIC "$" $)
set(_INSTALL_LIBS "SDL2main")
+if (NOT ANDROID)
+ set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
+endif()
if(SDL_SHARED)
- add_library(SDL2 SHARED ${SOURCE_FILES})
- if(UNIX)
+ add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
+ if(APPLE)
+ set_target_properties(SDL2 PROPERTIES
+ MACOSX_RPATH 1
+ OUTPUT_NAME "SDL2-${LT_RELEASE}")
+ elseif(UNIX AND NOT ANDROID)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
@@ -1467,7 +1755,7 @@ if(SDL_SHARED)
SOVERSION ${LT_REVISION}
OUTPUT_NAME "SDL2")
endif()
- if(MSVC)
+ if(MSVC AND NOT LIBC)
# Don't try to link with the default set of libraries.
set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
@@ -1475,13 +1763,24 @@ if(SDL_SHARED)
endif()
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
+ target_include_directories(SDL2 PUBLIC "$" $)
+ if (NOT ANDROID)
+ set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
+ endif()
endif()
if(SDL_STATIC)
set (BUILD_SHARED_LIBS FALSE)
add_library(SDL2-static STATIC ${SOURCE_FILES})
- set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
- if(MSVC)
+ if (NOT SDL_SHARED OR NOT WIN32)
+ set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
+ # Note: Apparently, OUTPUT_NAME must really be unique; even when
+ # CMAKE_IMPORT_LIBRARY_SUFFIX or the like are given. Otherwise
+ # the static build may race with the import lib and one will get
+ # clobbered, when the suffix is realized via subsequent rename.
+ endif()
+ set_target_properties(SDL2-static PROPERTIES POSITION_INDEPENDENT_CODE ${SDL_STATIC_PIC})
+ if(MSVC AND NOT LIBC)
set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
@@ -1490,14 +1789,55 @@ if(SDL_STATIC)
# libraries - do we need to consider this?
set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
+ target_include_directories(SDL2-static PUBLIC "$" $)
+ if (NOT ANDROID)
+ set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
+ endif()
+endif()
+
+##### Tests #####
+
+if(SDL_TEST)
+ file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
+ add_library(SDL2_test STATIC ${TEST_SOURCES})
+
+ add_subdirectory(test)
endif()
##### Installation targets #####
-install(TARGETS ${_INSTALL_LIBS}
+install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
LIBRARY DESTINATION "lib${LIB_SUFFIX}"
ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
RUNTIME DESTINATION bin)
+##### Export files #####
+if (APPLE)
+ set(PKG_PREFIX "SDL2.framework/Resources")
+elseif (WINDOWS)
+ set(PKG_PREFIX "cmake")
+else ()
+ set(PKG_PREFIX "lib/cmake/SDL2")
+endif ()
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file("${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake"
+ VERSION ${SDL_VERSION}
+ COMPATIBILITY AnyNewerVersion
+)
+
+install(EXPORT SDL2Targets
+ FILE SDL2Targets.cmake
+ NAMESPACE SDL2::
+ DESTINATION ${PKG_PREFIX}
+)
+install(
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake
+ ${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake
+ DESTINATION ${PKG_PREFIX}
+ COMPONENT Devel
+)
+
file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
foreach(_FNAME ${BIN_INCLUDE_FILES})
@@ -1507,12 +1847,24 @@ endforeach()
list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
-if(NOT WINDOWS OR CYGWIN)
+string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
+if (UPPER_BUILD_TYPE MATCHES DEBUG)
+ set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
+else()
+ set(SOPOSTFIX "")
+endif()
+
+if(NOT (WINDOWS OR CYGWIN))
if(SDL_SHARED)
- install(CODE "
- execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
- \"libSDL2-2.0.so\" \"libSDL2.so\")")
- install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}")
+ set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
+ get_target_property(SONAME SDL2 OUTPUT_NAME)
+ if(NOT ANDROID)
+ install(CODE "
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\")"
+ WORKING_DIR "${SDL2_BINARY_DIR}")
+ install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
+ endif()
endif()
if(FREEBSD)
# FreeBSD uses ${PREFIX}/libdata/pkgconfig
@@ -1523,15 +1875,17 @@ if(NOT WINDOWS OR CYGWIN)
endif()
install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin)
# TODO: what about the .spec file? Is it only needed for RPM creation?
- install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal")
+ install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal")
endif()
##### Uninstall target #####
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
+if(NOT TARGET uninstall)
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY)
-add_custom_target(uninstall
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+ add_custom_target(uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+endif()
diff --git a/3rdparty/sdl2-2.0.4/COPYING.txt b/3rdparty/sdl2-2.0.9/COPYING.txt
similarity index 91%
rename from 3rdparty/sdl2-2.0.4/COPYING.txt
rename to 3rdparty/sdl2-2.0.9/COPYING.txt
index 04f14eed55..44a60ed73e 100644
--- a/3rdparty/sdl2-2.0.4/COPYING.txt
+++ b/3rdparty/sdl2-2.0.9/COPYING.txt
@@ -1,6 +1,6 @@
Simple DirectMedia Layer
-Copyright (C) 1997-2016 Sam Lantinga
+Copyright (C) 1997-2018 Sam Lantinga
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/3rdparty/sdl2-2.0.4/CREDITS.txt b/3rdparty/sdl2-2.0.9/CREDITS.txt
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/CREDITS.txt
rename to 3rdparty/sdl2-2.0.9/CREDITS.txt
diff --git a/3rdparty/sdl2-2.0.4/INSTALL.txt b/3rdparty/sdl2-2.0.9/INSTALL.txt
similarity index 81%
rename from 3rdparty/sdl2-2.0.4/INSTALL.txt
rename to 3rdparty/sdl2-2.0.9/INSTALL.txt
index 2df10bdd70..398fc1191f 100644
--- a/3rdparty/sdl2-2.0.4/INSTALL.txt
+++ b/3rdparty/sdl2-2.0.9/INSTALL.txt
@@ -5,7 +5,7 @@ To compile and install SDL:
* Read VisualC.html
Windows with gcc, either native or cross-compiling:
- * Read the FAQ at http://wiki.libsdl.org/moin.fcg/FAQWindows
+ * Read the FAQ at https://wiki.libsdl.org/moin.fcg/FAQWindows
* Run './configure; make; make install'
Mac OS X with Xcode:
@@ -27,14 +27,14 @@ To compile and install SDL:
* Read docs/README-cmake.md
2. Look at the example programs in ./test, and check out the online
- documentation at http://wiki.libsdl.org/
+ documentation at https://wiki.libsdl.org/
3. Join the SDL developer mailing list by sending E-mail to
sdl-request@libsdl.org
and put "subscribe" in the subject of the message.
Or alternatively you can use the web interface:
- http://www.libsdl.org/mailing-list.php
+ https://www.libsdl.org/mailing-list.php
That's it!
Sam Lantinga
diff --git a/3rdparty/sdl2-2.0.4/Makefile.in b/3rdparty/sdl2-2.0.9/Makefile.in
similarity index 84%
rename from 3rdparty/sdl2-2.0.4/Makefile.in
rename to 3rdparty/sdl2-2.0.9/Makefile.in
index b66e0f5e24..4eb6e63239 100644
--- a/3rdparty/sdl2-2.0.4/Makefile.in
+++ b/3rdparty/sdl2-2.0.9/Makefile.in
@@ -3,6 +3,7 @@
top_builddir = .
srcdir = @srcdir@
objects = build
+gen = gen
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
@@ -31,15 +32,19 @@ WINDRES = @WINDRES@
TARGET = libSDL2.la
OBJECTS = @OBJECTS@
+GEN_HEADERS = @GEN_HEADERS@
+GEN_OBJECTS = @GEN_OBJECTS@
VERSION_OBJECTS = @VERSION_OBJECTS@
-SDLMAIN_TARGET = libSDL2main.a
+SDLMAIN_TARGET = libSDL2main.la
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
-SDLTEST_TARGET = libSDL2_test.a
+SDLTEST_TARGET = libSDL2_test.la
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
-SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
+WAYLAND_SCANNER = @WAYLAND_SCANNER@
+
+SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
GEN_DIST = SDL2.spec
ifneq ($V,1)
@@ -48,6 +53,7 @@ RUN_CMD_CC = @echo " CC " $@;
RUN_CMD_CXX = @echo " CXX " $@;
RUN_CMD_LTLINK = @echo " LTLINK" $@;
RUN_CMD_RANLIB = @echo " RANLIB" $@;
+RUN_CMD_GEN = @echo " GEN " $@;
LIBTOOL += --quiet
endif
@@ -95,6 +101,7 @@ HDRS = \
SDL_render.h \
SDL_rwops.h \
SDL_scancode.h \
+ SDL_sensor.h \
SDL_shape.h \
SDL_stdinc.h \
SDL_surface.h \
@@ -106,6 +113,7 @@ HDRS = \
SDL_types.h \
SDL_version.h \
SDL_video.h \
+ SDL_vulkan.h \
begin_code.h \
close_code.h
@@ -115,14 +123,12 @@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
-LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(srcdir)/configure: $(srcdir)/configure.in
- @echo "Warning, configure.in is out of date"
- #(cd $(srcdir) && sh autogen.sh && sh configure)
- @sleep 3
+ @echo "Warning, configure is out of date, please re-run autogen.sh"
Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@
@@ -137,16 +143,14 @@ update-revision:
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
-$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
- $(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
- $(RUN_CMD_RANLIB)$(RANLIB) $@
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
- $(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
- $(RUN_CMD_RANLIB)$(RANLIB) $@
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
install: all install-bin install-hdrs install-lib install-data
install-bin:
@@ -167,10 +171,8 @@ install-hdrs: update-revision
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
- $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
- $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
install-data:
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
@@ -200,6 +202,7 @@ uninstall-data:
clean:
rm -rf $(objects)
+ rm -rf $(gen)
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
distclean: clean
diff --git a/3rdparty/sdl2-2.0.4/Makefile.minimal b/3rdparty/sdl2-2.0.9/Makefile.minimal
similarity index 94%
rename from 3rdparty/sdl2-2.0.4/Makefile.minimal
rename to 3rdparty/sdl2-2.0.9/Makefile.minimal
index 6ec1ce81cb..7f02649740 100644
--- a/3rdparty/sdl2-2.0.4/Makefile.minimal
+++ b/3rdparty/sdl2-2.0.9/Makefile.minimal
@@ -22,6 +22,8 @@ SOURCES = \
src/filesystem/dummy/*.c \
src/render/*.c \
src/render/software/*.c \
+ src/sensor/*.c \
+ src/sensor/dummy/*.c \
src/stdlib/*.c \
src/thread/*.c \
src/thread/generic/*.c \
diff --git a/3rdparty/sdl2-2.0.9/Makefile.os2 b/3rdparty/sdl2-2.0.9/Makefile.os2
new file mode 100644
index 0000000000..95c5cef591
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/Makefile.os2
@@ -0,0 +1,126 @@
+# Open Watcom makefile to build SDL2.dll for OS/2:
+# wmake -f Makefile.os2
+
+LIBNAME = SDL2
+VERSION = 2.0.9
+DESCRIPTION = Simple DirectMedia Layer 2
+
+LIBHOME = .
+LIBPATH = $(LIBHOME)/lib
+DLLFILE = $(LIBHOME)/$(LIBNAME).dll
+LIBFILE = $(LIBHOME)/$(LIBNAME).lib
+LNKFILE = $(LIBNAME).lnk
+
+INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
+INCPATH+= -I"$(LIBHOME)/h"
+INCPATH+= -Iinclude
+
+LIBS = mmpm2.lib libuls.lib libconv.lib
+
+CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
+# max warnings:
+CFLAGS+= -wx
+# building dll:
+CFLAGS+= -bd
+# the include paths :
+CFLAGS+= $(INCPATH)
+# building SDL itself:
+CFLAGS+= -DBUILD_SDL
+
+SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
+SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
+SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
+SRCS+= SDL_rwops.c SDL_power.c
+SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
+SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
+ SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
+ SDL_sensor.c SDL_touch.c
+SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
+SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
+ SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
+ SDL_render_sw.c SDL_rotate.c
+SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
+ SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
+ SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
+ SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
+
+SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
+SRCS+= SDL_systimer.c
+SRCS+= SDL_sysloadso.c
+SRCS+= SDL_sysfilesystem.c
+SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
+SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
+SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
+SRCS+= SDL_dummysensor.c
+
+SRCS+= SDL_dynapi.c
+
+OBJS = $(SRCS:.c=.obj)
+
+.extensions:
+.extensions: .lib .dll .obj .c .asm
+
+.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
+.c: ./src/haptic/dummy;./src/joystick/dummy;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
+.c: ./src/loadso/dummy;./src/filesystem/dummy;./src/timer/dummy;./src/thread/generic;
+
+all: $(DLLFILE) $(LIBFILE) .symbolic
+
+$(DLLFILE): $(OBJS) $(LNKFILE)
+ @echo * Linking: $@
+ wlink @$(LNKFILE)
+
+$(LIBFILE): $(DLLFILE)
+ @echo * Creating LIB file: $@
+ wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
+
+.c.obj:
+ wcc386 $(CFLAGS) -fo=$^@ $<
+
+SDL_cpuinfo.obj: SDL_cpuinfo.c
+ wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_rwops.obj: SDL_rwops.c
+ wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
+
+SDL_blendfillrect.obj: SDL_blendfillrect.c
+ wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_blendline.obj: SDL_blendline.c
+ wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_blendpoint.obj: SDL_blendpoint.c
+ wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
+
+SDL_RLEaccel.obj: SDL_RLEaccel.c
+ wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
+
+$(LNKFILE):
+ @echo * Creating linker file: $@
+ @%create $@
+ @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
+ @%append $@ NAME $(DLLFILE)
+ @for %i in ($(OBJS)) do @%append $@ FILE %i
+ @%append $@ LIBPATH $(%LIB);$(LIBPATH)
+ @for %i in ($(LIBS)) do @%append $@ LIB %i
+ @%append $@ OPTION QUIET
+ @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
+ @%append $@ OPTION MAP=$(LIBHOME)/$^&.map
+ @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
+ @%append $@ OPTION QUIET
+ @%append $@ OPTION ELIMINATE
+ @%append $@ OPTION MANYAUTODATA
+ @%append $@ OPTION OSNAME='OS/2 and eComStation'
+ @%append $@ OPTION SHOWDEAD
+
+clean: .SYMBOLIC
+ @ echo * Clean: $(LIBNAME)
+ @if exist *.obj rm *.obj
+ @if exist *.err rm *.err
+ @if exist $(LNKFILE) rm $(LNKFILE)
+
+distclean: .SYMBOLIC clean
+ @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
+ @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
+ @if exist $(LIBFILE) rm $(LIBFILE)
+ @if exist $(DLLFILE) rm $(DLLFILE)
diff --git a/3rdparty/sdl2-2.0.9/Makefile.pandora b/3rdparty/sdl2-2.0.9/Makefile.pandora
new file mode 100644
index 0000000000..f4cb66848b
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/Makefile.pandora
@@ -0,0 +1,60 @@
+# Makefile to build the pandora SDL library
+
+AR = arm-none-linux-gnueabi-ar
+RANLIB = arm-none-linux-gnueabi-ranlib
+CC = arm-none-linux-gnueabi-gcc
+CXX = arm-none-linux-gnueabi-g++
+STRIP = arm-none-linux-gnueabi-strip
+
+CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
+ -mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
+ -I./include -I$(PNDSDK)/usr/include
+
+TARGET = libSDL.a
+
+SOURCES =
+ ./src/*.c \
+ ./src/atomic/*.c \
+ ./src/audio/*.c \
+ ./src/audio/disk/*.c \
+ ./src/audio/dsp/*.c \
+ ./src/audio/dummy/*.c \
+ ./src/cpuinfo/*.c \
+ ./src/events/*.c \
+ ./src/file/*.c \
+ ./src/filesystem/unix/*.c \
+ ./src/haptic/*.c \
+ ./src/haptic/linux/*.c \
+ ./src/joystick/*.c \
+ ./src/joystick/linux/*.c \
+ ./src/loadso/dlopen/*.c \
+ ./src/power/*.c \
+ ./src/sensor/*.c \
+ ./src/sensor/dummy/*.c \
+ ./src/stdlib/*.c \
+ ./src/thread/*.c \
+ ./src/thread/pthread/SDL_syscond.c \
+ ./src/thread/pthread/SDL_sysmutex.c \
+ ./src/thread/pthread/SDL_syssem.c \
+ ./src/thread/pthread/SDL_systhread.c \
+ ./src/timer/*.c \
+ ./src/timer/unix/*.c \
+ ./src/video/*.c \
+ ./src/video/dummy/*.c \
+ ./src/video/pandora/SDL_pandora.o \
+ ./src/video/pandora/SDL_pandora_events.o \
+ ./src/video/x11/*.c \
+
+
+OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
+
+CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h)
+
+all: $(TARGET)
+
+$(TARGET): $(CONFIG_H) $(OBJECTS)
+ $(AR) crv $@ $^
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TARGET) $(OBJECTS)
diff --git a/3rdparty/sdl2-2.0.4/Makefile.psp b/3rdparty/sdl2-2.0.9/Makefile.psp
similarity index 96%
rename from 3rdparty/sdl2-2.0.4/Makefile.psp
rename to 3rdparty/sdl2-2.0.9/Makefile.psp
index 5e7dcd29ae..de0e50e2ff 100644
--- a/3rdparty/sdl2-2.0.4/Makefile.psp
+++ b/3rdparty/sdl2-2.0.9/Makefile.psp
@@ -42,6 +42,8 @@ OBJS= src/SDL.o \
src/render/software/SDL_drawpoint.o \
src/render/software/SDL_render_sw.o \
src/render/software/SDL_rotate.o \
+ src/sensor/SDL_sensor.o \
+ src/sensor/dummy/SDL_dummysensor.o \
src/stdlib/SDL_getenv.o \
src/stdlib/SDL_iconv.o \
src/stdlib/SDL_malloc.o \
@@ -49,6 +51,7 @@ OBJS= src/SDL.o \
src/stdlib/SDL_stdlib.o \
src/stdlib/SDL_string.o \
src/thread/SDL_thread.o \
+ src/thread/generic/SDL_systls.o \
src/thread/psp/SDL_syssem.o \
src/thread/psp/SDL_systhread.o \
src/thread/psp/SDL_sysmutex.o \
diff --git a/3rdparty/sdl2-2.0.4/Makefile.wiz b/3rdparty/sdl2-2.0.9/Makefile.wiz
similarity index 66%
rename from 3rdparty/sdl2-2.0.4/Makefile.wiz
rename to 3rdparty/sdl2-2.0.9/Makefile.wiz
index bb7705789f..8ed58ee761 100644
--- a/3rdparty/sdl2-2.0.4/Makefile.wiz
+++ b/3rdparty/sdl2-2.0.9/Makefile.wiz
@@ -9,17 +9,36 @@ STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
-TARGET_STATIC = libSDL13.a
-TARGET_SHARED = libSDL13.so
-
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
- ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
- ./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
- ./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
- ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
- ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
- ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
- ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
+TARGET_STATIC = libSDL2.a
+TARGET_SHARED = libSDL2.so
+
+SOURCES = \
+ ./src/*.c \
+ ./src/audio/*.c \
+ ./src/audio/disk/*.c \
+ ./src/audio/dsp/*.c \
+ ./src/audio/dummy/*.c \
+ ./src/cpuinfo/*.c \
+ ./src/events/*.c \
+ ./src/file/*.c \
+ ./src/haptic/*.c \
+ ./src/haptic/linux/*.c \
+ ./src/joystick/*.c \
+ ./src/joystick/linux/*.c \
+ ./src/loadso/dlopen/*.c \
+ ./src/sensor/*.c \
+ ./src/sensor/dummy/*.c \
+ ./src/stdlib/*.c \
+ ./src/thread/*.c \
+ ./src/thread/pthread/SDL_syscond.c \
+ ./src/thread/pthread/SDL_sysmutex.c \
+ ./src/thread/pthread/SDL_syssem.c \
+ ./src/thread/pthread/SDL_systhread.c \
+ ./src/timer/*.c \
+ ./src/timer/unix/*.c \
+ ./src/video/*.c \
+ ./src/video/dummy/*.c \
+ ./src/video/pandora/*.c \
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
@@ -43,7 +62,7 @@ clean:
install:
mkdir -p $(WIZSDK)/lib
- mkdir -p $(WIZSDK)/include/SDL13
+ mkdir -p $(WIZSDK)/include/SDL2
cp -f $(TARGET_STATIC) $(WIZSDK)/lib
cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib
rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
@@ -57,5 +76,5 @@ install:
ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0
- cp -f include/*.h $(WIZSDK)/include/SDL13/
- cp -f include/*.h ../../toolchain/include/SDL13/
+ cp -f include/*.h $(WIZSDK)/include/SDL2/
+ cp -f include/*.h ../../toolchain/include/SDL2/
diff --git a/3rdparty/sdl2-2.0.4/README-SDL.txt b/3rdparty/sdl2-2.0.9/README-SDL.txt
similarity index 86%
rename from 3rdparty/sdl2-2.0.4/README-SDL.txt
rename to 3rdparty/sdl2-2.0.9/README-SDL.txt
index 0630395e5d..2984b145ee 100644
--- a/3rdparty/sdl2-2.0.4/README-SDL.txt
+++ b/3rdparty/sdl2-2.0.9/README-SDL.txt
@@ -2,11 +2,11 @@
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
-designed to make it easy to write multi-media software, such as games and
-emulators.
+designed to make it easy to write multi-media software, such as games
+and emulators.
The Simple DirectMedia Layer library source code is available from:
-http://www.libsdl.org/
+https://www.libsdl.org/
This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html
diff --git a/3rdparty/sdl2-2.0.4/README.txt b/3rdparty/sdl2-2.0.9/README.txt
similarity index 93%
rename from 3rdparty/sdl2-2.0.4/README.txt
rename to 3rdparty/sdl2-2.0.9/README.txt
index 84c335c2bd..e8630c713a 100644
--- a/3rdparty/sdl2-2.0.4/README.txt
+++ b/3rdparty/sdl2-2.0.9/README.txt
@@ -6,7 +6,7 @@
Version 2.0
---
-http://www.libsdl.org/
+https://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
diff --git a/3rdparty/sdl2-2.0.4/SDL2.spec b/3rdparty/sdl2-2.0.9/SDL2.spec
similarity index 99%
rename from 3rdparty/sdl2-2.0.4/SDL2.spec
rename to 3rdparty/sdl2-2.0.9/SDL2.spec
index 0fe57540f1..67e819690c 100644
--- a/3rdparty/sdl2-2.0.4/SDL2.spec
+++ b/3rdparty/sdl2-2.0.9/SDL2.spec
@@ -1,6 +1,6 @@
Summary: Simple DirectMedia Layer
Name: SDL2
-Version: 2.0.4
+Version: 2.0.9
Release: 2
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
URL: http://www.libsdl.org/
diff --git a/3rdparty/sdl2-2.0.4/SDL2.spec.in b/3rdparty/sdl2-2.0.9/SDL2.spec.in
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/SDL2.spec.in
rename to 3rdparty/sdl2-2.0.9/SDL2.spec.in
diff --git a/3rdparty/sdl2-2.0.9/SDL2Config.cmake b/3rdparty/sdl2-2.0.9/SDL2Config.cmake
new file mode 100644
index 0000000000..4a5f646020
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/SDL2Config.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
diff --git a/3rdparty/sdl2-2.0.4/TODO.txt b/3rdparty/sdl2-2.0.9/TODO.txt
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/TODO.txt
rename to 3rdparty/sdl2-2.0.9/TODO.txt
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2-WinRT.nuspec b/3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2-WinRT.nuspec
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2-WinRT.nuspec
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2-WinRT.nuspec
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2-WinRT.targets b/3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2-WinRT.targets
similarity index 90%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2-WinRT.targets
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2-WinRT.targets
index f0b9e97318..b9f274b1a2 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2-WinRT.targets
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2-WinRT.targets
@@ -2,7 +2,6 @@
- WinRT80
WinRT81
WinPhone80
WinPhone81
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec b/3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets b/3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets
diff --git a/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln
new file mode 100644
index 0000000000..e3ab7f7245
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.ActiveCfg = Debug|ARM
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.Build.0 = Debug|ARM
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.ActiveCfg = Debug|x64
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.Build.0 = Debug|x64
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.ActiveCfg = Debug|Win32
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.Build.0 = Debug|Win32
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.ActiveCfg = Release|ARM
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.Build.0 = Release|ARM
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.ActiveCfg = Release|x64
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.Build.0 = Release|x64
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.ActiveCfg = Release|Win32
+ {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
similarity index 93%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
index 305a3ca5f1..ede896fe30 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
@@ -67,6 +67,7 @@
+
@@ -81,12 +82,10 @@
-
-
-
+
@@ -99,6 +98,7 @@
+
@@ -118,7 +118,7 @@
-
+
@@ -133,10 +133,14 @@
+
+
+
+
@@ -155,11 +159,14 @@
+
+
+
@@ -172,8 +179,8 @@
-
-
+
+
true
true
true
@@ -210,6 +217,7 @@
+
@@ -250,11 +258,11 @@
true
true
+
-
@@ -265,9 +273,12 @@
+
+
+
@@ -303,6 +314,7 @@
+
true
true
@@ -311,6 +323,14 @@
true
true
+
+ true
+ true
+ true
+ true
+ true
+ true
+
true
true
@@ -359,6 +379,7 @@
true
true
+
{89e9b32e-a86a-47c3-a948-d2b1622925ce}
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
similarity index 89%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
index b8c6d712d9..7a26d851a0 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
@@ -174,9 +174,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -186,9 +183,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -270,9 +264,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -396,10 +387,46 @@
Source Files
-
-
-
-
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Header Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
Source Files
@@ -434,7 +461,7 @@
Source Files
-
+
Source Files
@@ -542,9 +569,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -710,10 +734,40 @@
Source Files
-
-
-
-
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
Source Files
diff --git a/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln
new file mode 100644
index 0000000000..8157755cd7
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-WinPhone81", "SDL-WinPhone81.vcxproj", "{48FADC0E-964D-4DAB-BCED-372E0AD19577}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|Win32 = Debug|Win32
+ Release|ARM = Release|ARM
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Debug|ARM.ActiveCfg = Debug|ARM
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Debug|ARM.Build.0 = Debug|ARM
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Debug|Win32.Build.0 = Debug|Win32
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Release|ARM.ActiveCfg = Release|ARM
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Release|ARM.Build.0 = Release|ARM
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Release|Win32.ActiveCfg = Release|Win32
+ {48FADC0E-964D-4DAB-BCED-372E0AD19577}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
similarity index 90%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
index 573bc4286c..a7df73bd42 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
@@ -59,6 +59,7 @@
+
@@ -73,11 +74,10 @@
-
-
+
@@ -88,6 +88,7 @@
+
@@ -102,7 +103,7 @@
-
+
@@ -117,10 +118,14 @@
+
+
+
+
@@ -138,11 +143,14 @@
+
+
+
@@ -155,8 +163,8 @@
-
-
+
+
true
true
true
@@ -184,6 +192,7 @@
+
@@ -215,11 +224,11 @@
true
true
+
-
@@ -230,9 +239,12 @@
+
+
+
@@ -269,12 +281,19 @@
+
true
true
true
true
+
+ true
+ true
+ true
+ true
+
true
true
@@ -311,6 +330,7 @@
true
true
+
{48fadc0e-964d-4dab-bced-372e0ad19577}
@@ -395,7 +415,7 @@
Console
false
false
- DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies)
+ DXGI.lib;d3d11.lib;mmdevapi.lib;%(AdditionalDependencies)
@@ -409,7 +429,7 @@
Console
false
false
- DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies)
+ DXGI.lib;d3d11.lib;mmdevapi.lib;%(AdditionalDependencies)
@@ -423,7 +443,7 @@
Console
false
false
- DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies)
+ DXGI.lib;d3d11.lib;mmdevapi.lib;%(AdditionalDependencies)
@@ -437,7 +457,7 @@
Console
false
false
- DXGI.lib;d3d11.lib;xaudio2.lib;%(AdditionalDependencies)
+ DXGI.lib;d3d11.lib;mmdevapi.lib;%(AdditionalDependencies)
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
similarity index 89%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
index 907e1bfb7f..dba8edd3f1 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
@@ -174,9 +174,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -186,7 +183,7 @@
Source Files
-
+
Source Files
@@ -255,9 +252,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -381,6 +375,36 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Header Files
+
+
+ Source Files
+
@@ -413,10 +437,10 @@
Source Files
-
+
Source Files
-
+
Source Files
@@ -512,9 +536,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -686,5 +707,29 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln
new file mode 100644
index 0000000000..2099f262dc
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-WinRT81", "SDL-WinRT81.vcxproj", "{C8DF6173-06A1-4F56-A9BC-2002596B30E9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|ARM = Release|ARM
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|ARM.ActiveCfg = Debug|ARM
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|ARM.Build.0 = Debug|ARM
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|Win32.Build.0 = Debug|Win32
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|x64.ActiveCfg = Debug|x64
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Debug|x64.Build.0 = Debug|x64
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|ARM.ActiveCfg = Release|ARM
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|ARM.Build.0 = Release|ARM
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|Win32.ActiveCfg = Release|Win32
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|Win32.Build.0 = Release|Win32
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|x64.ActiveCfg = Release|x64
+ {C8DF6173-06A1-4F56-A9BC-2002596B30E9}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
similarity index 90%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
index a56516ead6..84b06d5d02 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
@@ -67,6 +67,7 @@
+
@@ -81,11 +82,10 @@
-
-
+
@@ -98,6 +98,7 @@
+
@@ -117,7 +118,7 @@
-
+
@@ -132,10 +133,14 @@
+
+
+
+
@@ -152,11 +157,14 @@
+
+
+
@@ -169,8 +177,8 @@
-
-
+
+
true
true
true
@@ -207,6 +215,7 @@
+
@@ -247,11 +256,11 @@
true
true
+
-
@@ -262,9 +271,12 @@
+
+
+
@@ -301,6 +313,7 @@
+
true
true
@@ -309,6 +322,14 @@
true
true
+
+ true
+ true
+ true
+ true
+ true
+ true
+
true
true
@@ -357,6 +378,7 @@
true
true
+
{c8df6173-06a1-4f56-a9bc-2002596b30e9}
@@ -470,7 +492,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
@@ -484,7 +506,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
@@ -498,7 +520,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
@@ -512,7 +534,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
@@ -526,7 +548,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
@@ -540,7 +562,7 @@
Console
false
false
- xinput.lib;xaudio2.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
+ xinput.lib;mmdevapi.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib;kernel32.lib;%(AdditionalDependencies)
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
similarity index 89%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
index a36811dd4b..6a52b1caae 100644
--- a/3rdparty/sdl2-2.0.4/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
+++ b/3rdparty/sdl2-2.0.9/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
@@ -174,9 +174,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -186,7 +183,7 @@
Source Files
-
+
Source Files
@@ -255,9 +252,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -387,12 +381,48 @@
Source Files
-
-
-
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Header Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -425,10 +455,10 @@
Source Files
-
+
Source Files
-
+
Source Files
@@ -524,9 +554,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -692,9 +719,6 @@
Source Files
-
-
-
Source Files
@@ -710,5 +734,38 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/Logo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/Logo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/Logo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/Logo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Package.appxmanifest b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Package.appxmanifest
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/Package.appxmanifest
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/Package.appxmanifest
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/Logo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/Logo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/Logo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/Logo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Package.appxmanifest b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Package.appxmanifest
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/Package.appxmanifest
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/Package.appxmanifest
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx b/3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx
rename to 3rdparty/sdl2-2.0.9/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx
diff --git a/3rdparty/sdl2-2.0.4/VisualC.html b/3rdparty/sdl2-2.0.9/VisualC.html
similarity index 97%
rename from 3rdparty/sdl2-2.0.4/VisualC.html
rename to 3rdparty/sdl2-2.0.9/VisualC.html
index 89035d6776..0631832e80 100644
--- a/3rdparty/sdl2-2.0.4/VisualC.html
+++ b/3rdparty/sdl2-2.0.9/VisualC.html
@@ -21,7 +21,7 @@
There are different solution files for the various
- versions of the IDE. Please use the appropiate version
+ versions of the IDE. Please use the appropriate version
2008, 2010, 2012 or 2013.
@@ -101,7 +101,7 @@
files to project")
Instead of adding the files to your project it is more
- desireable to add them to the linker options: Project|Properties|Linker|Command
+ desirable to add them to the linker options: Project|Properties|Linker|Command
Line and type the names of the libraries to link with in the "Additional
Options:" box. Note: This must be done for each build
configuration (e.g. Release,Debug).
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDL.sln b/3rdparty/sdl2-2.0.9/VisualC/SDL.sln
similarity index 92%
rename from 3rdparty/sdl2-2.0.4/VisualC/SDL.sln
rename to 3rdparty/sdl2-2.0.9/VisualC/SDL.sln
index a15f16beaf..22692b1f6a 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/SDL.sln
+++ b/3rdparty/sdl2-2.0.9/VisualC/SDL.sln
@@ -48,6 +48,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\controllermap\controllermap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvulkan", "tests\testvulkan\testvulkan.vcxproj", "{0D604DFD-AAB6-442C-9368-F91A344146AB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testyuv", "tests\testyuv\testyuv.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C97635682}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -240,6 +244,22 @@ Global
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64
{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.Build.0 = Debug|Win32
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|x64.ActiveCfg = Debug|x64
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|x64.Build.0 = Debug|x64
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|Win32.ActiveCfg = Release|Win32
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|Win32.Build.0 = Release|Win32
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|x64.ActiveCfg = Release|x64
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|x64.Build.0 = Release|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|Win32.ActiveCfg = Debug|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|Win32.Build.0 = Debug|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|x64.ActiveCfg = Debug|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|x64.Build.0 = Debug|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|Win32.ActiveCfg = Release|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|Win32.Build.0 = Release|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|x64.ActiveCfg = Release|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -265,5 +285,7 @@ Global
{55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
+ {0D604DFD-AAB6-442C-9368-F91A344146AB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
EndGlobalSection
EndGlobal
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj
similarity index 87%
rename from 3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj
index 595e2d4430..505adcd27b 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -78,6 +78,19 @@
AllRules.ruleset
+ C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)
+
+
+ D:\dev\steam\rel\streaming_client\SDL\src\hidapi\hidapi;$(IncludePath)
+
+
+ D:\dev\steam\rel\streaming_client\SDL\src\hidapi\hidapi;$(IncludePath)
+
+
+ D:\dev\steam\rel\streaming_client\SDL\src\hidapi\hidapi;$(IncludePath)
+
+
+ D:\dev\steam\rel\streaming_client\SDL\src\hidapi\hidapi;$(IncludePath)
@@ -108,7 +121,7 @@
_DEBUG;%(PreprocessorDefinitions)
- winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
true
true
Windows
@@ -139,7 +152,7 @@
_DEBUG;%(PreprocessorDefinitions)
- winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
true
true
Windows
@@ -173,7 +186,7 @@
NDEBUG;%(PreprocessorDefinitions)
- winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
true
true
Windows
@@ -205,7 +218,7 @@
NDEBUG;%(PreprocessorDefinitions)
- winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
+ setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)
true
true
Windows
@@ -263,6 +276,7 @@
+
@@ -286,77 +300,90 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
@@ -364,17 +391,63 @@
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -390,16 +463,52 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -410,81 +519,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
@@ -493,14 +541,9 @@
+
-
-
-
-
-
-
-
+
@@ -508,4 +551,4 @@
-
+
\ No newline at end of file
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj.filters b/3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj.filters
similarity index 88%
rename from 3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj.filters
rename to 3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj.filters
index a2ba2cb5cc..75a9e4fb9d 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/SDL/SDL.vcxproj.filters
+++ b/3rdparty/sdl2-2.0.9/VisualC/SDL/SDL.vcxproj.filters
@@ -1,444 +1,479 @@
-
-
-
-
- {395b3af0-33d0-411b-b153-de1676bf1ef8}
-
-
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
- API Headers
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+ {395b3af0-33d0-411b-b153-de1676bf1ef8}
+
+
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+ API Headers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/SDLmain/SDLmain.vcxproj
similarity index 99%
rename from 3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/SDLmain/SDLmain.vcxproj
index 239a76ef9f..adf5b8d707 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/SDLmain/SDLmain.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC/SDLmain/SDLmain.vcxproj
@@ -1,4 +1,4 @@
-
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/SDLtest/SDLtest.vcxproj
similarity index 97%
rename from 3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/SDLtest/SDLtest.vcxproj
index 6190a7dfa7..e2e39f935f 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/SDLtest/SDLtest.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC/SDLtest/SDLtest.vcxproj
@@ -164,9 +164,10 @@
+
-
\ No newline at end of file
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/clean.sh b/3rdparty/sdl2-2.0.9/VisualC/clean.sh
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/clean.sh
rename to 3rdparty/sdl2-2.0.9/VisualC/clean.sh
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/checkkeys/checkkeys.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/checkkeys/checkkeys.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/checkkeys/checkkeys.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/checkkeys/checkkeys.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/controllermap/controllermap.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/controllermap/controllermap.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/controllermap/controllermap.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/controllermap/controllermap.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/loopwave/loopwave.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/loopwave/loopwave.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/loopwave/loopwave.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/loopwave/loopwave.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testatomic/testatomic.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testatomic/testatomic.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testatomic/testatomic.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testatomic/testatomic.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testautomation/testautomation.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testautomation/testautomation.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testautomation/testautomation.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testautomation/testautomation.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testdraw2/testdraw2.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testdraw2/testdraw2.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testdraw2/testdraw2.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testdraw2/testdraw2.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testfile/testfile.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testfile/testfile.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testfile/testfile.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testfile/testfile.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgesture/testgesture.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testgesture/testgesture.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testgesture/testgesture.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testgesture/testgesture.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgl2/testgl2.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testgl2/testgl2.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testgl2/testgl2.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testgl2/testgl2.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testgles2/testgles2.vcxproj
similarity index 95%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testgles2/testgles2.vcxproj
index 186f6affd6..f1c633a439 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testgles2/testgles2.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC/tests/testgles2/testgles2.vcxproj
@@ -189,6 +189,12 @@
false
true
+
+ {da956fd3-e143-46f2-9fe5-c77bebc56b1a}
+ false
+ false
+ true
+
@@ -196,4 +202,4 @@
-
\ No newline at end of file
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testjoystick/testjoystick.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testjoystick/testjoystick.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testjoystick/testjoystick.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testjoystick/testjoystick.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testoverlay2/testoverlay2.vcxproj
similarity index 97%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testoverlay2/testoverlay2.vcxproj
index b17f64c015..6879544b6b 100644
--- a/3rdparty/sdl2-2.0.4/VisualC/tests/testoverlay2/testoverlay2.vcxproj
+++ b/3rdparty/sdl2-2.0.9/VisualC/tests/testoverlay2/testoverlay2.vcxproj
@@ -212,8 +212,9 @@
+
-
\ No newline at end of file
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testplatform/testplatform.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testplatform/testplatform.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testplatform/testplatform.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testplatform/testplatform.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testpower/testpower.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testpower/testpower.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testpower/testpower.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testpower/testpower.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testrendertarget/testrendertarget.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testrendertarget/testrendertarget.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testrendertarget/testrendertarget.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testrendertarget/testrendertarget.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testrumble/testrumble.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testrumble/testrumble.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testrumble/testrumble.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testrumble/testrumble.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testscale/testscale.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testscale/testscale.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testscale/testscale.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testscale/testscale.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testshape/testshape.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testshape/testshape.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testshape/testshape.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testshape/testshape.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/tests/testsprite2/testsprite2.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testsprite2/testsprite2.vcxproj
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/tests/testsprite2/testsprite2.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/tests/testsprite2/testsprite2.vcxproj
diff --git a/3rdparty/sdl2-2.0.9/VisualC/tests/testvulkan/testvulkan.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testvulkan/testvulkan.vcxproj
new file mode 100644
index 0000000000..6cf0fdb0dc
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/VisualC/tests/testvulkan/testvulkan.vcxproj
@@ -0,0 +1,199 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {0D604DFD-AAB6-442C-9368-F91A344146AB}
+ testvulkan
+
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.40219.1
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Debug/testvulkan.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Debug/testvulkan.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)
+ MultiThreadedDebugDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Release/testvulkan.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Release/testvulkan.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ {da956fd3-e142-46f2-9dd5-c78bebb56b7a}
+ false
+
+
+ {da956fd3-e143-46f2-9fe5-c77bebc56b1a}
+ false
+
+
+ {81ce8daf-ebb2-4761-8e45-b71abcca8c68}
+ false
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/sdl2-2.0.9/VisualC/tests/testyuv/testyuv.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/tests/testyuv/testyuv.vcxproj
new file mode 100644
index 0000000000..c5738c67dc
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/VisualC/tests/testyuv/testyuv.vcxproj
@@ -0,0 +1,229 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}
+ testyuv
+
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.40219.1
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Release/testyuv.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Release/testyuv.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Debug/testyuv.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Debug/testyuv.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDebugDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ {81ce8daf-ebb2-4761-8e45-b71abcca8c68}
+ false
+ false
+ true
+
+
+ {da956fd3-e142-46f2-9dd5-c78bebb56b7a}
+ false
+ false
+ true
+
+
+ {da956fd3-e143-46f2-9fe5-c77bebc56b1a}
+ false
+ false
+ true
+
+
+
+
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/sdl2-2.0.4/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj
old mode 100755
new mode 100644
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj
diff --git a/3rdparty/sdl2-2.0.4/VisualC/visualtest/visualtest_VS2012.vcxproj b/3rdparty/sdl2-2.0.9/VisualC/visualtest/visualtest_VS2012.vcxproj
old mode 100755
new mode 100644
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/VisualC/visualtest/visualtest_VS2012.vcxproj
rename to 3rdparty/sdl2-2.0.9/VisualC/visualtest/visualtest_VS2012.vcxproj
diff --git a/3rdparty/sdl2-2.0.9/WhatsNew.txt b/3rdparty/sdl2-2.0.9/WhatsNew.txt
new file mode 100644
index 0000000000..56de7b6781
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/WhatsNew.txt
@@ -0,0 +1,434 @@
+
+This is a list of major changes in SDL's version history.
+
+---------------------------------------------------------------------------
+2.0.9:
+---------------------------------------------------------------------------
+
+General:
+* Added a new sensor API, initialized by passing SDL_INIT_SENSOR to SDL_Init(), and defined in SDL_sensor.h
+* Added an event SDL_SENSORUPDATE which is sent when a sensor is updated
+* Added SDL_GetDisplayOrientation() to return the current display orientation
+* Added an event SDL_DISPLAYEVENT which is sent when the display orientation changes
+* Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. (Thanks to Valve for contributing the PS4 and Nintendo Switch Pro controller support)
+* Added support for many other popular game controllers
+* Added SDL_JoystickGetDevicePlayerIndex(), SDL_JoystickGetPlayerIndex(), and SDL_GameControllerGetPlayerIndex() to get the player index for a controller. For XInput controllers this returns the XInput index for the controller.
+* Added SDL_GameControllerRumble() and SDL_JoystickRumble() which allow simple rumble without using the haptics API
+* Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened
+* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_TIME to control the mouse double-click time
+* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to control the mouse double-click radius, in pixels
+* Added SDL_HasColorKey() to return whether a surface has a colorkey active
+* Added SDL_HasAVX512F() to return whether the CPU has AVX-512F features
+* Added SDL_IsTablet() to return whether the application is running on a tablet
+* Added SDL_THREAD_PRIORITY_TIME_CRITICAL for threads that must run at the highest priority
+
+Mac OS X:
+* Fixed black screen at start on Mac OS X Mojave
+
+Linux:
+* Added SDL_LinuxSetThreadPriority() to allow adjusting the thread priority of native threads using RealtimeKit if available.
+
+iOS:
+* Fixed Asian IME input
+
+Android:
+* Updated required Android SDK to API 26, to match Google's new App Store requirements
+* Added support for wired USB Xbox, PS4, and Nintendo Switch Pro controllers
+* Added support for relative mouse mode on Android 7.0 and newer (except where it's broken, on Chromebooks and when in DeX mode with Samsung Experience 9.0)
+* Added support for custom mouse cursors on Android 7.0 and newer
+* Added the hint SDL_HINT_ANDROID_TRAP_BACK_BUTTON to control whether the back button will back out of the app (the default) or be passed to the application as SDL_SCANCODE_AC_BACK
+* Added SDL_AndroidBackButton() to trigger the Android system back button behavior when handling the back button in the application
+* Added SDL_IsChromebook() to return whether the app is running in the Chromebook Android runtime
+* Added SDL_IsDeXMode() to return whether the app is running while docked in the Samsung DeX
+
+
+---------------------------------------------------------------------------
+2.0.8:
+---------------------------------------------------------------------------
+
+General:
+* Added SDL_fmod() and SDL_log10()
+* Each of the SDL math functions now has the corresponding float version
+* Added SDL_SetYUVConversionMode() and SDL_GetYUVConversionMode() to control the formula used when converting to and from YUV colorspace. The options are JPEG, BT.601, and BT.709
+
+Windows:
+* Implemented WASAPI support on Windows UWP and removed the deprecated XAudio2 implementation
+* Added resampling support on WASAPI on Windows 7 and above
+
+Windows UWP:
+* Added SDL_WinRTGetDeviceFamily() to find out what type of device your application is running on
+
+Mac OS X:
+* Added support for the Vulkan SDK for Mac:
+ https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-0-69-0-for-mac/
+* Added support for OpenGL ES using ANGLE when it's available
+
+Mac OS X / iOS / tvOS:
+* Added a Metal 2D render implementation
+* Added SDL_RenderGetMetalLayer() and SDL_RenderGetMetalCommandEncoder() to insert your own drawing into SDL rendering when using the Metal implementation
+
+iOS:
+* Added the hint SDL_HINT_IOS_HIDE_HOME_INDICATOR to control whether the home indicator bar on iPhone X should be hidden. This defaults to dimming the indicator for fullscreen applications and showing the indicator for windowed applications.
+
+iOS / Android:
+* Added the hint SDL_HINT_RETURN_KEY_HIDES_IME to control whether the return key on the software keyboard should hide the keyboard or send a key event (the default)
+
+Android:
+* SDL now supports building with Android Studio and Gradle by default, and the old Ant project is available in android-project-ant
+* SDL now requires the API 19 SDK to build, but can still target devices down to API 14 (Android 4.0.1)
+* Added SDL_IsAndroidTV() to tell whether the application is running on Android TV
+
+Android / tvOS:
+* Added the hint SDL_HINT_TV_REMOTE_AS_JOYSTICK to control whether TV remotes should be listed as joystick devices (the default) or send keyboard events.
+
+Linux:
+* Added the hint SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR to control whether the X server should skip the compositor for the SDL application. This defaults to "1"
+* Added the hint SDL_HINT_VIDEO_DOUBLE_BUFFER to control whether the Raspberry Pi and KMSDRM video drivers should use double or triple buffering (the default)
+
+
+---------------------------------------------------------------------------
+2.0.7:
+---------------------------------------------------------------------------
+
+General:
+* Added audio stream conversion functions:
+ SDL_NewAudioStream
+ SDL_AudioStreamPut
+ SDL_AudioStreamGet
+ SDL_AudioStreamAvailable
+ SDL_AudioStreamFlush
+ SDL_AudioStreamClear
+ SDL_FreeAudioStream
+* Added functions to query and set the SDL memory allocation functions:
+ SDL_GetMemoryFunctions()
+ SDL_SetMemoryFunctions()
+ SDL_GetNumAllocations()
+* Added locking functions for multi-threaded access to the joystick and game controller APIs:
+ SDL_LockJoysticks()
+ SDL_UnlockJoysticks()
+* The following functions are now thread-safe:
+ SDL_SetEventFilter()
+ SDL_GetEventFilter()
+ SDL_AddEventWatch()
+ SDL_DelEventWatch()
+
+
+General:
+---------------------------------------------------------------------------
+2.0.6:
+---------------------------------------------------------------------------
+
+General:
+* Added cross-platform Vulkan graphics support in SDL_vulkan.h
+ SDL_Vulkan_LoadLibrary()
+ SDL_Vulkan_GetVkGetInstanceProcAddr()
+ SDL_Vulkan_GetInstanceExtensions()
+ SDL_Vulkan_CreateSurface()
+ SDL_Vulkan_GetDrawableSize()
+ SDL_Vulkan_UnloadLibrary()
+ This is all the platform-specific code you need to bring up Vulkan on all SDL platforms. You can look at an example in test/testvulkan.c
+* Added SDL_ComposeCustomBlendMode() to create custom blend modes for 2D rendering
+* Added SDL_HasNEON() which returns whether the CPU has NEON instruction support
+* Added support for many game controllers, including the Nintendo Switch Pro Controller
+* Added support for inverted axes and separate axis directions in game controller mappings
+* Added functions to return information about a joystick before it's opened:
+ SDL_JoystickGetDeviceVendor()
+ SDL_JoystickGetDeviceProduct()
+ SDL_JoystickGetDeviceProductVersion()
+ SDL_JoystickGetDeviceType()
+ SDL_JoystickGetDeviceInstanceID()
+* Added functions to return information about an open joystick:
+ SDL_JoystickGetVendor()
+ SDL_JoystickGetProduct()
+ SDL_JoystickGetProductVersion()
+ SDL_JoystickGetType()
+ SDL_JoystickGetAxisInitialState()
+* Added functions to return information about an open game controller:
+ SDL_GameControllerGetVendor()
+ SDL_GameControllerGetProduct()
+ SDL_GameControllerGetProductVersion()
+* Added SDL_GameControllerNumMappings() and SDL_GameControllerMappingForIndex() to be able to enumerate the built-in game controller mappings
+* Added SDL_LoadFile() and SDL_LoadFile_RW() to load a file into memory
+* Added SDL_DuplicateSurface() to make a copy of a surface
+* Added an experimental JACK audio driver
+* Implemented non-power-of-two audio resampling, optionally using libsamplerate to perform the resampling
+* Added the hint SDL_HINT_AUDIO_RESAMPLING_MODE to control the quality of resampling
+* Added the hint SDL_HINT_RENDER_LOGICAL_SIZE_MODE to control the scaling policy for SDL_RenderSetLogicalSize():
+ "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen (the default)
+ "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
+* Added the hints SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the mouse speed when being read from raw mouse input
+* Added the hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether SDL will synthesize mouse events from touch events
+
+Windows:
+* The new default audio driver on Windows is WASAPI and supports hot-plugging devices and changing the default audio device
+* The old XAudio2 audio driver is deprecated and will be removed in the next release
+* Added hints SDL_HINT_WINDOWS_INTRESOURCE_ICON and SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL to specify a custom icon resource ID for SDL windows
+* The hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING is now on by default for compatibility with .NET languages and various Windows debuggers
+* Updated the GUID format for game controller mappings, older mappings will be automatically converted on load
+* Implemented the SDL_WINDOW_ALWAYS_ON_TOP flag on Windows
+
+Linux:
+* Added an experimental KMS/DRM video driver for embedded development
+
+iOS:
+* Added a hint SDL_HINT_AUDIO_CATEGORY to control the audio category, determining whether the phone mute switch affects the audio
+
+---------------------------------------------------------------------------
+2.0.5:
+---------------------------------------------------------------------------
+
+General:
+* Implemented audio capture support for some platforms
+* Added SDL_DequeueAudio() to retrieve audio when buffer queuing is turned on for audio capture
+* Added events for dragging and dropping text
+* Added events for dragging and dropping multiple items
+* By default the click raising a window will not be delivered to the SDL application. You can set the hint SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH to "1" to allow that click through to the window.
+* Saving a surface with an alpha channel as a BMP will use a newer BMP format that supports alpha information. You can set the hint SDL_HINT_BMP_SAVE_LEGACY_FORMAT to "1" to use the old format.
+* Added SDL_GetHintBoolean() to get the boolean value of a hint
+* Added SDL_RenderSetIntegerScale() to set whether to smoothly scale or use integral multiples of the viewport size when scaling the rendering output
+* Added SDL_CreateRGBSurfaceWithFormat() and SDL_CreateRGBSurfaceWithFormatFrom() to create an SDL surface with a specific pixel format
+* Added SDL_GetDisplayUsableBounds() which returns the area usable for windows. For example, on Mac OS X, this subtracts the area occupied by the menu bar and dock.
+* Added SDL_GetWindowBordersSize() which returns the size of the window's borders around the client area
+* Added a window event SDL_WINDOWEVENT_HIT_TEST when a window had a hit test that wasn't SDL_HITTEST_NORMAL (e.g. in the title bar or window frame)
+* Added SDL_SetWindowResizable() to change whether a window is resizable
+* Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity() to affect the window transparency
+* Added SDL_SetWindowModalFor() to set a window as modal for another window
+* Added support for AUDIO_U16LSB and AUDIO_U16MSB to SDL_MixAudioFormat()
+* Fixed flipped images when reading back from target textures when using the OpenGL renderer
+* Fixed texture color modulation with SDL_BLENDMODE_NONE when using the OpenGL renderer
+* Fixed bug where the alpha value of colorkeys was ignored when blitting in some cases
+
+Windows:
+* Added a hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING to prevent SDL from raising a debugger exception to name threads. This exception can cause problems with .NET applications when running under a debugger.
+* The hint SDL_HINT_THREAD_STACK_SIZE is now supported on Windows
+* Fixed XBox controller triggers automatically being pulled at startup
+* The first icon from the executable is used as the default window icon at runtime
+* Fixed SDL log messages being printed twice if SDL was built with C library support
+* Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications.
+
+Mac OS X:
+* Fixed selecting the dummy video driver
+* The caps lock key now generates a pressed event when pressed and a released event when released, instead of a press/release event pair when pressed.
+* Fixed mouse wheel events on Mac OS X 10.12
+* The audio driver has been updated to use AVFoundation for better compatibility with newer versions of Mac OS X
+
+Linux:
+* Added support for the Fcitx IME
+* Added a window event SDL_WINDOWEVENT_TAKE_FOCUS when a window manager asks the SDL window whether it wants to take focus.
+* Refresh rates are now rounded instead of truncated, e.g. 59.94 Hz is rounded up to 60 Hz instead of 59.
+* Added initial support for touchscreens on Raspberry Pi
+
+OpenBSD:
+* SDL_GetBasePath() is now implemented on OpenBSD
+
+iOS:
+* Added support for dynamically loaded objects on iOS 8 and newer
+
+tvOS:
+* Added support for Apple TV
+* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote.
+
+Android:
+* Fixed SDL not resizing window when Android screen resolution changes
+* Corrected the joystick Z axis reporting for the accelerometer
+
+Emscripten (running in a web browser):
+* Many bug fixes and improvements
+
+
+---------------------------------------------------------------------------
+2.0.4:
+---------------------------------------------------------------------------
+
+General:
+* Added support for web applications using Emscripten, see docs/README-emscripten.md for more information
+* Added support for web applications using Native Client (NaCl), see docs/README-nacl.md for more information
+* Added an API to queue audio instead of using the audio callback:
+ SDL_QueueAudio(), SDL_GetQueuedAudioSize(), SDL_ClearQueuedAudio()
+* Added events for audio device hot plug support:
+ SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED
+* Added SDL_PointInRect()
+* Added SDL_HasAVX2() to detect CPUs with AVX2 support
+* Added SDL_SetWindowHitTest() to let apps treat parts of their SDL window like traditional window decorations (drag areas, resize areas)
+* Added SDL_GetGrabbedWindow() to get the window that currently has input grab, if any
+* Added SDL_RenderIsClipEnabled() to tell whether clipping is currently enabled in a renderer
+* Added SDL_CaptureMouse() to capture the mouse to get events while the mouse is not in your window
+* Added SDL_WarpMouseGlobal() to warp the mouse cursor in global screen space
+* Added SDL_GetGlobalMouseState() to get the current mouse state outside of an SDL window
+* Added a direction field to mouse wheel events to tell whether they are flipped (natural) or not
+* Added GL_CONTEXT_RELEASE_BEHAVIOR GL attribute (maps to [WGL|GLX]_ARB_context_flush_control extension)
+* Added EGL_KHR_create_context support to allow OpenGL ES version selection on some platforms
+* Added NV12 and NV21 YUV texture support for OpenGL and OpenGL ES 2.0 renderers
+* Added a Vivante video driver that is used on various SoC platforms
+* Added an event SDL_RENDER_DEVICE_RESET that is sent from the D3D renderers when the D3D device is lost, and from Android's event loop when the GLES context had to be recreated
+* Added a hint SDL_HINT_NO_SIGNAL_HANDLERS to disable SDL's built in signal handling
+* Added a hint SDL_HINT_THREAD_STACK_SIZE to set the stack size of SDL's threads
+* Added SDL_sqrtf(), SDL_tan(), and SDL_tanf() to the stdlib routines
+* Improved support for WAV and BMP files with unusual chunks in them
+* Renamed SDL_assert_data to SDL_AssertData and SDL_assert_state to SDL_AssertState
+* Added a hint SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN to prevent window interaction while cursor is hidden
+* Added SDL_GetDisplayDPI() to get the DPI information for a display
+* Added SDL_JoystickCurrentPowerLevel() to get the battery level of a joystick
+* Added SDL_JoystickFromInstanceID(), as a helper function, to get the SDL_Joystick* that an event is referring to.
+* Added SDL_GameControllerFromInstanceID(), as a helper function, to get the SDL_GameController* that an event is referring to.
+
+Windows:
+* Added support for Windows Phone 8.1 and Windows 10/UWP (Universal Windows Platform)
+* Timer resolution is now 1 ms by default, adjustable with the SDL_HINT_TIMER_RESOLUTION hint
+* SDLmain no longer depends on the C runtime, so you can use the same .lib in both Debug and Release builds
+* Added SDL_SetWindowsMessageHook() to set a function to be called for every windows message before TranslateMessage()
+* Added a hint SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP to control whether SDL_PumpEvents() processes the Windows message loop
+* You can distinguish between real mouse and touch events by looking for SDL_TOUCH_MOUSEID in the mouse event "which" field
+* SDL_SysWMinfo now contains the window HDC
+* Added support for Unicode command line options
+* Prevent beeping when Alt-key combos are pressed
+* SDL_SetTextInputRect() re-positions the OS-rendered IME
+* Added a hint SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 to prevent generating SDL_WINDOWEVENT_CLOSE events when Alt-F4 is pressed
+* Added a hint SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING to use the old axis and button mapping for XInput devices (deprecated)
+
+Mac OS X:
+* Implemented drag-and-drop support
+* Improved joystick hot-plug detection
+* The SDL_WINDOWEVENT_EXPOSED window event is triggered in the appropriate situations
+* Fixed relative mouse mode when the application loses/regains focus
+* Fixed bugs related to transitioning to and from Spaces-aware fullscreen-desktop mode
+* Fixed the refresh rate of display modes
+* SDL_SysWMInfo is now ARC-compatible
+* Added a hint SDL_HINT_MAC_BACKGROUND_APP to prevent forcing the application to become a foreground process
+
+Linux:
+* Enabled building with Mir and Wayland support by default.
+* Added IBus IME support
+* Added a hint SDL_HINT_IME_INTERNAL_EDITING to control whether IBus should handle text editing internally instead of sending SDL_TEXTEDITING events
+* Added a hint SDL_HINT_VIDEO_X11_NET_WM_PING to allow disabling _NET_WM_PING protocol handling in SDL_CreateWindow()
+* Added support for multiple audio devices when using Pulseaudio
+* Fixed duplicate mouse events when using relative mouse motion
+
+iOS:
+* Added support for iOS 8
+* The SDL_WINDOW_ALLOW_HIGHDPI window flag now enables high-dpi support, and SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() gets the window resolution in pixels
+* SDL_GetWindowSize() and display mode sizes are in the "DPI-independent points" / "screen coordinates" coordinate space rather than pixels (matches OS X behavior)
+* Added native resolution support for the iPhone 6 Plus
+* Added support for MFi game controllers
+* Added support for the hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK
+* Added sRGB OpenGL ES context support on iOS 7+
+* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
+* SDL_SysWMinfo now contains the OpenGL ES framebuffer and color renderbuffer objects used by the window's active GLES view
+* Fixed various rotation and orientation issues
+* Fixed memory leaks
+
+Android:
+* Added a hint SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH to prevent mouse events from being registered as touch events
+* Added hints SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION and SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION
+* Added support for SDL_DisableScreenSaver(), SDL_EnableScreenSaver() and the hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER
+* Added support for SDL_ShowMessageBox() and SDL_ShowSimpleMessageBox()
+
+Raspberry Pi:
+* Added support for the Raspberry Pi 2
+
+
+---------------------------------------------------------------------------
+2.0.3:
+---------------------------------------------------------------------------
+
+Mac OS X:
+* Fixed creating an OpenGL context by default on Mac OS X 10.6
+
+
+---------------------------------------------------------------------------
+2.0.2:
+---------------------------------------------------------------------------
+General:
+* Added SDL_GL_ResetAttributes() to reset OpenGL attributes to default values
+* Added an API to load a database of game controller mappings from a file:
+ SDL_GameControllerAddMappingsFromFile(), SDL_GameControllerAddMappingsFromRW()
+* Added game controller mappings for the PS4 and OUYA controllers
+* Added SDL_GetDefaultAssertionHandler() and SDL_GetAssertionHandler()
+* Added SDL_DetachThread()
+* Added SDL_HasAVX() to determine if the CPU has AVX features
+* Added SDL_vsscanf(), SDL_acos(), and SDL_asin() to the stdlib routines
+* EGL can now create/manage OpenGL and OpenGL ES 1.x/2.x contexts, and share
+ them using SDL_GL_SHARE_WITH_CURRENT_CONTEXT
+* Added a field "clicks" to the mouse button event which records whether the event is a single click, double click, etc.
+* The screensaver is now disabled by default, and there is a hint SDL_HINT_VIDEO_ALLOW_SCREENSAVER that can change that behavior.
+* Added a hint SDL_HINT_MOUSE_RELATIVE_MODE_WARP to specify whether mouse relative mode should be emulated using mouse warping.
+* testgl2 does not need to link with libGL anymore
+* Added testgles2 test program to demonstrate working with OpenGL ES 2.0
+* Added controllermap test program to visually map a game controller
+
+Windows:
+* Support for OpenGL ES 2.x contexts using either WGL or EGL (natively via
+ the driver or emulated through ANGLE)
+* Added a hint SDL_HINT_VIDEO_WIN_D3DCOMPILER to specify which D3D shader compiler to use for OpenGL ES 2 support through ANGLE
+* Added a hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that is useful when creating multiple windows that should share the same OpenGL context.
+* Added an event SDL_RENDER_TARGETS_RESET that is sent when D3D9 render targets are reset after the device has been restored.
+
+Mac OS X:
+* Added a hint SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK to control whether Ctrl+click should be treated as a right click on Mac OS X. This is off by default.
+
+Linux:
+* Fixed fullscreen and focused behavior when receiving NotifyGrab events
+* Added experimental Wayland and Mir support, disabled by default
+
+Android:
+* Joystick support (minimum SDK version required to build SDL is now 12,
+ the required runtime version remains at 10, but on such devices joystick
+ support won't be available).
+* Hotplugging support for joysticks
+* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
+
+
+---------------------------------------------------------------------------
+2.0.1:
+---------------------------------------------------------------------------
+
+General:
+* Added an API to get common filesystem paths in SDL_filesystem.h:
+ SDL_GetBasePath(), SDL_GetPrefPath()
+* Added an API to do optimized YV12 and IYUV texture updates:
+ SDL_UpdateYUVTexture()
+* Added an API to get the amount of RAM on the system:
+ SDL_GetSystemRAM()
+* Added a macro to perform timestamp comparisons with SDL_GetTicks():
+ SDL_TICKS_PASSED()
+* Dramatically improved OpenGL ES 2.0 rendering performance
+* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
+
+Windows:
+* Created a static library configuration for the Visual Studio 2010 project
+* Added a hint to create the Direct3D device with support for multi-threading:
+ SDL_HINT_RENDER_DIRECT3D_THREADSAFE
+* Added a function to get the D3D9 adapter index for a display:
+ SDL_Direct3D9GetAdapterIndex()
+* Added a function to get the D3D9 device for a D3D9 renderer:
+ SDL_RenderGetD3D9Device()
+* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
+* Fixed crash when using two XInput controllers at the same time
+* Fixed detecting a mixture of XInput and DirectInput controllers
+* Fixed clearing a D3D render target larger than the window
+* Improved support for format specifiers in SDL_snprintf()
+
+Mac OS X:
+* Added support for retina displays:
+ Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
+* Fixed mouse warping in fullscreen mode
+* Right mouse click is emulated by holding the Ctrl key while left clicking
+
+Linux:
+* Fixed float audio support with the PulseAudio driver
+* Fixed missing line endpoints in the OpenGL renderer on some drivers
+* X11 symbols are no longer defined to avoid collisions when linking statically
+
+iOS:
+* Fixed status bar visibility on iOS 7
+* Flipped the accelerometer Y axis to match expected values
+
+Android:
+IMPORTANT: You MUST get the updated SDLActivity.java to match C code
+* Moved EGL initialization to native code
+* Fixed the accelerometer axis rotation relative to the device rotation
+* Fixed race conditions when handling the EGL context on pause/resume
+* Touch devices are available for enumeration immediately after init
+
+Raspberry Pi:
+* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Default.png b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Default.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Default.png
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Default.png
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
old mode 100755
new mode 100644
similarity index 78%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
index 569d2d1307..29390844b1
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
@@ -10,6 +10,27 @@
1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ FA30DEB01BBF5A8F009C397F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; };
+ FA30DEB11BBF5A93009C397F /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0080E26BC0500F39101 /* happy.c */; };
+ FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CC0E43D19800F688B5 /* icon.bmp */; };
+ FA30DEB41BBF5ADD009C397F /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; };
+ FA30DEB61BBF5AE6009C397F /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; };
+ FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA30DEAC1BBF59D9009C397F /* libSDL2.a */; };
+ FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
+ FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; };
+ FA30DECA1BBF5C14009C397F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; };
+ FA30DECB1BBF5C14009C397F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; };
+ FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
+ FA30DECD1BBF5C14009C397F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; };
+ FA86C0371D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C0381D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C0391D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C03A1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C03B1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C03C1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
+ FA86C03D1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */; };
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
@@ -17,6 +38,14 @@
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
+ FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D71D8B5E7700915323 /* AVFoundation.framework */; };
+ FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
+ FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
@@ -168,6 +197,20 @@
remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
remoteInfo = libSDL;
};
+ FA30DEAB1BBF59D9009C397F /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FAB598141BB5C1B100BE72C5;
+ remoteInfo = "libSDL-tv";
+ };
+ FA30DEAE1BBF5A69009C397F /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = FAB598131BB5C1B100BE72C5;
+ remoteInfo = "libSDL-tv";
+ };
FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
@@ -183,7 +226,11 @@
1D6058910D05DD3D006BFB54 /* Rectangles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rectangles.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ FA30DE961BBF59D9009C397F /* Happy-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Happy-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "iOS Launch Screen.storyboard"; sourceTree = ""; };
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
+ FABA34D31D8B5E5600915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ FABA34D71D8B5E7700915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
FAE0E9691BAF96A00098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; };
FD1B48920E313154007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
@@ -224,6 +271,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */,
FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */,
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -237,10 +285,28 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA30DE931BBF59D9009C397F /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */,
+ FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */,
+ FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
+ FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */,
+ FA30DECA1BBF5C14009C397F /* QuartzCore.framework in Frameworks */,
+ FA30DECB1BBF5C14009C397F /* OpenGLES.framework in Frameworks */,
+ FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */,
+ FA30DECD1BBF5C14009C397F /* UIKit.framework in Frameworks */,
+ FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */,
+ FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
FD15FCB00E086866003BDF25 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */,
FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */,
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -258,6 +324,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */,
FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */,
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -275,6 +342,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */,
FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */,
FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -292,6 +360,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */,
FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */,
FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -309,6 +378,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */,
FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */,
FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -326,6 +396,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */,
FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */,
FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -352,6 +423,7 @@
FDF0D6A40E12D05400247964 /* Mixer.app */,
FDC52EDE0E2843D6008D768C /* Fireworks.app */,
FDB6520C0E43D1F300F688B5 /* Keyboard.app */,
+ FA30DE961BBF59D9009C397F /* Happy-TV.app */,
);
name = Products;
sourceTree = "";
@@ -359,6 +431,7 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
+ FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */,
FD1B48920E313154007AB34E /* SDL.xcodeproj */,
FD77A0040E26BC0500F39101 /* src */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -382,6 +455,8 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ FABA34D71D8B5E7700915323 /* AVFoundation.framework */,
+ FABA34D31D8B5E5600915323 /* AVFoundation.framework */,
FAE0E9691BAF96A00098DFA4 /* GameController.framework */,
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */,
FDF0D7220E12D31800247964 /* AudioToolbox.framework */,
@@ -399,6 +474,7 @@
isa = PBXGroup;
children = (
FD1B489E0E313154007AB34E /* libSDL2.a */,
+ FA30DEAC1BBF59D9009C397F /* libSDL2.a */,
);
name = Products;
sourceTree = "";
@@ -473,6 +549,24 @@
productReference = 1D6058910D05DD3D006BFB54 /* Rectangles.app */;
productType = "com.apple.product-type.application";
};
+ FA30DE951BBF59D9009C397F /* Happy-TV */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FA30DEAD1BBF59D9009C397F /* Build configuration list for PBXNativeTarget "Happy-TV" */;
+ buildPhases = (
+ FA30DE921BBF59D9009C397F /* Sources */,
+ FA30DE941BBF59D9009C397F /* Resources */,
+ FA30DE931BBF59D9009C397F /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ FA30DEAF1BBF5A69009C397F /* PBXTargetDependency */,
+ );
+ name = "Happy-TV";
+ productName = "Happy-TV";
+ productReference = FA30DE961BBF59D9009C397F /* Happy-TV.app */;
+ productType = "com.apple.product-type.application";
+ };
FD15FCB10E086866003BDF25 /* Happy */ = {
isa = PBXNativeTarget;
buildConfigurationList = FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */;
@@ -588,6 +682,14 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
+ TargetAttributes = {
+ FA30DE951BBF59D9009C397F = {
+ CreatedOnToolsVersion = 7.1;
+ };
+ FDC52EC60E2843D6008D768C = {
+ ProvisioningStyle = Automatic;
+ };
+ };
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demos" */;
compatibilityVersion = "Xcode 3.2";
@@ -598,6 +700,7 @@
Japanese,
French,
German,
+ Base,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
@@ -611,6 +714,7 @@
targets = (
1D6058900D05DD3D006BFB54 /* Rectangles */,
FD15FCB10E086866003BDF25 /* Happy */,
+ FA30DE951BBF59D9009C397F /* Happy-TV */,
FD5F9BE30E0DEBEA008E885B /* Accel */,
FDC202DD0E107B1200ABAC90 /* Touch */,
FDF0D6920E12D05400247964 /* Mixer */,
@@ -621,6 +725,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
+ FA30DEAC1BBF59D9009C397F /* libSDL2.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libSDL2.a;
+ remoteRef = FA30DEAB1BBF59D9009C397F /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
FD1B489E0E313154007AB34E /* libSDL2.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@@ -635,16 +746,28 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ FA86C0371D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
FD925B1B0E0F276600E92347 /* Icon.png in Resources */,
FD787AA20E22A5CC003E8E36 /* Default.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA30DE941BBF59D9009C397F /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */,
+ FA30DEB41BBF5ADD009C397F /* Icon.png in Resources */,
+ FA30DEB61BBF5AE6009C397F /* Default.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
FD15FCAE0E086866003BDF25 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FDB651D00E43D1AD00F688B5 /* icon.bmp in Resources */,
+ FA86C0381D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
FD925B1A0E0F276600E92347 /* Icon.png in Resources */,
FD787AA10E22A5CC003E8E36 /* Default.png in Resources */,
);
@@ -658,6 +781,7 @@
FDB651D10E43D1B300F688B5 /* ship.bmp in Resources */,
FD925B190E0F276600E92347 /* Icon.png in Resources */,
FD787AA30E22A5CC003E8E36 /* Default.png in Resources */,
+ FA86C0391D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -669,6 +793,7 @@
FDB651FA0E43D1F300F688B5 /* Icon.png in Resources */,
FDB651FB0E43D1F300F688B5 /* Default.png in Resources */,
FDB652C70E43E25900F688B5 /* kromasky_16x16.bmp in Resources */,
+ FA86C03D1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -677,6 +802,7 @@
buildActionMask = 2147483647;
files = (
FDB651D30E43D1BA00F688B5 /* stroke.bmp in Resources */,
+ FA86C03A1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
FDC202E10E107B1200ABAC90 /* Icon.png in Resources */,
FD787AA40E22A5CC003E8E36 /* Default.png in Resources */,
);
@@ -687,6 +813,7 @@
buildActionMask = 2147483647;
files = (
FDB651D80E43D1D800F688B5 /* stroke.bmp in Resources */,
+ FA86C03C1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
FDC52EC80E2843D6008D768C /* Icon.png in Resources */,
FDC52EC90E2843D6008D768C /* Default.png in Resources */,
);
@@ -699,6 +826,7 @@
FDB651D40E43D1C500F688B5 /* ds_brush_snare.wav in Resources */,
FDB651D50E43D1C500F688B5 /* ds_china.wav in Resources */,
FDB651D60E43D1C500F688B5 /* ds_kick_big_amb.wav in Resources */,
+ FA86C03B1D9765BB009CB637 /* iOS Launch Screen.storyboard in Resources */,
FDB651D70E43D1C500F688B5 /* ds_loose_skin_mute.wav in Resources */,
FDF0D6960E12D05400247964 /* Icon.png in Resources */,
FD787AA50E22A5CC003E8E36 /* Default.png in Resources */,
@@ -717,6 +845,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA30DE921BBF59D9009C397F /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FA30DEB01BBF5A8F009C397F /* common.c in Sources */,
+ FA30DEB11BBF5A93009C397F /* happy.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
FD15FCAF0E086866003BDF25 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -809,6 +946,11 @@
name = libSDL;
targetProxy = 049F36A0130CD8A000FF080F /* PBXContainerItemProxy */;
};
+ FA30DEAF1BBF5A69009C397F /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "libSDL-tv";
+ targetProxy = FA30DEAE1BBF5A69009C397F /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
@@ -816,6 +958,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Rectangles;
PRODUCT_NAME = Rectangles;
};
name = Debug;
@@ -824,6 +967,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Rectangles;
PRODUCT_NAME = Rectangles;
};
name = Release;
@@ -831,6 +975,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = ../../include;
@@ -844,6 +989,7 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
HEADER_SEARCH_PATHS = ../../include;
PRELINK_LIBS = "";
@@ -852,11 +998,100 @@
};
name = Release;
};
+ FA30DEA71BBF59D9009C397F /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ DEVELOPMENT_TEAM = "";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.Happy-TV";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = appletvos;
+ TARGETED_DEVICE_FAMILY = 3;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ };
+ name = Debug;
+ };
+ FA30DEA81BBF59D9009C397F /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEVELOPMENT_TEAM = "";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.Happy-TV";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = appletvos;
+ TARGETED_DEVICE_FAMILY = 3;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
FD15FCB50E086866003BDF25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_DYNAMIC_NO_PIC = NO;
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Happy;
PRODUCT_NAME = Happy;
SDKROOT = iphoneos;
};
@@ -866,6 +1101,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Happy;
PRODUCT_NAME = Happy;
SDKROOT = iphoneos;
};
@@ -875,6 +1111,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Accel;
PRODUCT_NAME = Accel;
SDKROOT = iphoneos;
};
@@ -884,6 +1121,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Accel;
PRODUCT_NAME = Accel;
SDKROOT = iphoneos;
};
@@ -893,6 +1131,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Keyboard;
PRODUCT_NAME = Keyboard;
SDKROOT = iphoneos;
};
@@ -902,6 +1141,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Keyboard;
PRODUCT_NAME = Keyboard;
SDKROOT = iphoneos;
};
@@ -911,6 +1151,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Touch;
PRODUCT_NAME = Touch;
SDKROOT = iphoneos;
};
@@ -920,6 +1161,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Touch;
PRODUCT_NAME = Touch;
SDKROOT = iphoneos;
};
@@ -928,7 +1170,10 @@
FDC52EDC0E2843D6008D768C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Fireworks;
PRODUCT_NAME = Fireworks;
SDKROOT = iphoneos;
};
@@ -937,7 +1182,10 @@
FDC52EDD0E2843D6008D768C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Fireworks;
PRODUCT_NAME = Fireworks;
SDKROOT = iphoneos;
};
@@ -947,6 +1195,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Mixer;
PRODUCT_NAME = Mixer;
SDKROOT = iphoneos;
};
@@ -956,6 +1205,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
+ PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Mixer;
PRODUCT_NAME = Mixer;
SDKROOT = iphoneos;
};
@@ -982,6 +1232,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ FA30DEAD1BBF59D9009C397F /* Build configuration list for PBXNativeTarget "Happy-TV" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FA30DEA71BBF59D9009C397F /* Debug */,
+ FA30DEA81BBF59D9009C397F /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Icon.png b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Icon.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Icon.png
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Icon.png
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Info.plist b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Info.plist
similarity index 87%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Info.plist
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Info.plist
index 0398f008b8..fbbaf7f938 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/Info.plist
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/Info.plist
@@ -11,7 +11,7 @@
CFBundleIconFile
CFBundleIdentifier
- com.yourcompany.${PRODUCT_NAME:identifier}
+ $(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
@@ -24,6 +24,8 @@
1.0
NSMainNibFile
+ UILaunchStoryboardName
+ iOS Launch Screen
UISupportedInterfaceOrientations
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/README b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/README
similarity index 87%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/README
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/README
index 55f8066d66..da6fb74908 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/README
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/README
@@ -2,15 +2,15 @@
About the iPhone OS Demo Applications
==============================================================================
-Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 1.3 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. To run them on your favorite platform, you may wish to set the macros SCREEN_WIDTH and SCREEN_HEIGHT, located in common.h.
+Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 2.0 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script.
Common files:
- common.c and common.h contain code common to all demo applications. This includes macros about the screen dimensions (in pixels), simple error handling, and functions for generating random numbers.
+ common.c and common.h contain code common to all demo applications. This includes functions about delta timing (in seconds), simple error handling, and functions for generating random numbers.
Rectangles (rectangles.c):
- Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFill. This is the simplest of all the demos.
+ Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFillRect. This is the simplest of all the demos.
Happy (happy.c):
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/bitmapfont/license.txt b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/bitmapfont/license.txt
old mode 100755
new mode 100644
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/bitmapfont/license.txt
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/bitmapfont/license.txt
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_china.wav b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_china.wav
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_china.wav
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_china.wav
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/icon.bmp b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/icon.bmp
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/icon.bmp
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/icon.bmp
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/ship.bmp b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/ship.bmp
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/ship.bmp
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/ship.bmp
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/space.bmp b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/space.bmp
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/space.bmp
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/space.bmp
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/stroke.bmp b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/stroke.bmp
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/data/stroke.bmp
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/data/stroke.bmp
diff --git a/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/iOS Launch Screen.storyboard b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/iOS Launch Screen.storyboard
new file mode 100644
index 0000000000..4d8722a667
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/iOS Launch Screen.storyboard
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/accelerometer.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/accelerometer.c
similarity index 81%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/accelerometer.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/accelerometer.c
index 3b7985faa0..2cc0123c29 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/accelerometer.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/accelerometer.c
@@ -5,10 +5,9 @@
*/
#include "SDL.h"
-#include "math.h"
+#include
#include "common.h"
-#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
#define DAMPING 0.5f; /* after bouncing off a wall, damping coefficient determines final speed */
#define FRICTION 0.0008f /* coefficient of acceleration that opposes direction of motion */
#define GRAVITY_CONSTANT 0.004f /* how sensitive the ship is to the accelerometer */
@@ -31,9 +30,10 @@ static SDL_Texture *ship = 0; /* texture for spaceship */
static SDL_Texture *space = 0; /* texture for space (background */
void
-render(SDL_Renderer *renderer, int w, int h)
+render(SDL_Renderer *renderer, int w, int h, double deltaTime)
{
-
+ double deltaMilliseconds = deltaTime * 1000;
+ float speed;
/* get joystick (accelerometer) axis values and normalize them */
float ax = SDL_JoystickGetAxis(accelerometer, 0);
@@ -53,12 +53,12 @@ render(SDL_Renderer *renderer, int w, int h)
*/
shipData.vx +=
ax * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
- MILLESECONDS_PER_FRAME;
+ deltaMilliseconds;
shipData.vy +=
ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
- MILLESECONDS_PER_FRAME;
+ deltaMilliseconds;
- float speed = sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
+ speed = sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
if (speed > 0) {
/* compensate for friction */
@@ -66,10 +66,10 @@ render(SDL_Renderer *renderer, int w, int h)
float diry = shipData.vy / speed; /* normalized y velocity */
/* update velocity due to friction */
- if (speed - FRICTION * MILLESECONDS_PER_FRAME > 0) {
+ if (speed - FRICTION * deltaMilliseconds > 0) {
/* apply friction */
- shipData.vx -= dirx * FRICTION * MILLESECONDS_PER_FRAME;
- shipData.vy -= diry * FRICTION * MILLESECONDS_PER_FRAME;
+ shipData.vx -= dirx * FRICTION * deltaMilliseconds;
+ shipData.vy -= diry * FRICTION * deltaMilliseconds;
} else {
/* applying friction would MORE than stop the ship, so just stop the ship */
shipData.vx = 0.0f;
@@ -78,8 +78,8 @@ render(SDL_Renderer *renderer, int w, int h)
}
/* update ship location */
- shipData.x += shipData.vx * MILLESECONDS_PER_FRAME;
- shipData.y += shipData.vy * MILLESECONDS_PER_FRAME;
+ shipData.x += shipData.vx * deltaMilliseconds;
+ shipData.y += shipData.vy * deltaMilliseconds;
if (shipData.x > maxx) {
shipData.x = maxx;
@@ -160,9 +160,6 @@ main(int argc, char *argv[])
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
- Uint32 startFrame; /* time frame began to process */
- Uint32 endFrame; /* time frame ended processing */
- Sint32 delay; /* time to pause waiting to draw next frame */
int done; /* should we clean up and exit? */
int w, h;
@@ -172,12 +169,11 @@ main(int argc, char *argv[])
}
/* create main window and renderer */
- window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
- SDL_WINDOW_OPENGL |
- SDL_WINDOW_FULLSCREEN);
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, 0, 0);
SDL_GetWindowSize(window, &w, &h);
+ SDL_RenderSetLogicalSize(renderer, w, h);
/* print out some info about joysticks and try to open accelerometer for use */
printf("There are %d joysticks available\n", SDL_NumJoysticks());
@@ -207,24 +203,15 @@ main(int argc, char *argv[])
done = 0;
/* enter main loop */
while (!done) {
- startFrame = SDL_GetTicks();
+ double deltaTime = updateDeltaTime();
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
}
- render(renderer, w, h);
- endFrame = SDL_GetTicks();
-
- /* figure out how much time we have left, and then sleep */
- delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
- if (delay < 0) {
- delay = 0;
- } else if (delay > MILLESECONDS_PER_FRAME) {
- delay = MILLESECONDS_PER_FRAME;
- }
- SDL_Delay(delay);
+ render(renderer, w, h, deltaTime);
+ SDL_Delay(1);
}
/* delete textures */
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.c
similarity index 57%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.c
index b2d9634566..e15fb5ff19 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.c
@@ -32,5 +32,25 @@ void
fatalError(const char *string)
{
printf("%s: %s\n", string, SDL_GetError());
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, string, SDL_GetError(), NULL);
exit(1);
}
+
+static Uint64 prevTime = 0;
+
+double
+updateDeltaTime(void)
+{
+ Uint64 curTime;
+ double deltaTime;
+
+ if (prevTime == 0) {
+ prevTime = SDL_GetPerformanceCounter();
+ }
+
+ curTime = SDL_GetPerformanceCounter();
+ deltaTime = (double) (curTime - prevTime) / (double) SDL_GetPerformanceFrequency();
+ prevTime = curTime;
+
+ return deltaTime;
+}
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.h b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.h
similarity index 80%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.h
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.h
index 3e0d94ecf2..60475086e4 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/common.h
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/common.h
@@ -4,9 +4,7 @@
* use however you want
*/
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 480
-
extern int randomInt(int min, int max);
extern float randomFloat(float min, float max);
extern void fatalError(const char *string);
+extern double updateDeltaTime(void);
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/fireworks.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/fireworks.c
similarity index 88%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/fireworks.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/fireworks.c
index a5beada913..2c4f621f15 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/fireworks.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/fireworks.c
@@ -10,13 +10,13 @@
#include
#include
-#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
#define ACCEL 0.0001f /* acceleration due to gravity, units in pixels per millesecond squared */
#define WIND_RESISTANCE 0.00005f /* acceleration per unit velocity due to wind resistance */
#define MAX_PARTICLES 2000 /* maximum number of particles displayed at once */
static GLuint particleTextureID; /* OpenGL particle texture id */
static SDL_bool pointSizeExtensionSupported; /* is GL_OES_point_size_array supported ? */
+static float pointSizeScale;
/*
used to describe what type of particle a given struct particle is.
emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles.
@@ -55,7 +55,7 @@ void initializeParticles(void);
void initializeTexture();
int nextPowerOfTwo(int x);
void drawParticles();
-void stepParticles(void);
+void stepParticles(double deltaTime);
/* helper function (used in texture loading)
returns next power of two greater than or equal to x
@@ -71,11 +71,12 @@ nextPowerOfTwo(int x)
}
/*
- steps each active particle by timestep MILLESECONDS_PER_FRAME
+ steps each active particle by timestep deltaTime
*/
void
-stepParticles(void)
+stepParticles(double deltaTime)
{
+ float deltaMilliseconds = deltaTime * 1000;
int i;
struct particle *slot = particles;
struct particle *curr = particles;
@@ -93,10 +94,10 @@ stepParticles(void)
curr->isActive = 0;
/* step velocity, then step position */
- curr->yvel += ACCEL * MILLESECONDS_PER_FRAME;
+ curr->yvel += ACCEL * deltaMilliseconds;
curr->xvel += 0.0f;
- curr->y += curr->yvel * MILLESECONDS_PER_FRAME;
- curr->x += curr->xvel * MILLESECONDS_PER_FRAME;
+ curr->y += curr->yvel * deltaMilliseconds;
+ curr->x += curr->xvel * deltaMilliseconds;
/* particle behavior */
if (curr->type == emitter) {
@@ -111,29 +112,29 @@ stepParticles(void)
sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel);
/* if wind resistance is not powerful enough to stop us completely,
then apply winde resistance, otherwise just stop us completely */
- if (WIND_RESISTANCE * MILLESECONDS_PER_FRAME < speed) {
+ if (WIND_RESISTANCE * deltaMilliseconds < speed) {
float normx = curr->xvel / speed;
float normy = curr->yvel / speed;
curr->xvel -=
- normx * WIND_RESISTANCE * MILLESECONDS_PER_FRAME;
+ normx * WIND_RESISTANCE * deltaMilliseconds;
curr->yvel -=
- normy * WIND_RESISTANCE * MILLESECONDS_PER_FRAME;
+ normy * WIND_RESISTANCE * deltaMilliseconds;
} else {
curr->xvel = curr->yvel = 0; /* stop particle */
}
- if (curr->color[3] <= MILLESECONDS_PER_FRAME * 0.1275f) {
+ if (curr->color[3] <= deltaMilliseconds * 0.1275f) {
/* if this next step will cause us to fade out completely
then just mark for deletion */
curr->isActive = 0;
} else {
/* otherwise, let's fade a bit more */
- curr->color[3] -= MILLESECONDS_PER_FRAME * 0.1275f;
+ curr->color[3] -= deltaMilliseconds * 0.1275f;
}
/* if we're a dust particle, shrink our size */
if (curr->type == dust)
- curr->size -= MILLESECONDS_PER_FRAME * 0.010f;
+ curr->size -= deltaMilliseconds * 0.010f;
}
@@ -147,7 +148,7 @@ stepParticles(void)
/* the number of active particles is computed as the difference between
old number of active particles, where slot points, and the
new size of the array, where particles points */
- num_active_particles = slot - particles;
+ num_active_particles = (int) (slot - particles);
}
/*
@@ -206,7 +207,7 @@ explodeEmitter(struct particle *emitter)
p->y = emitter->y + emitter->yvel;
p->isActive = 1;
p->type = dust;
- p->size = 15;
+ p->size = 15 * pointSizeScale;
/* inherit emitter's color */
p->color[0] = emitter->color[0];
p->color[1] = emitter->color[1];
@@ -244,7 +245,7 @@ spawnTrailFromEmitter(struct particle *emitter)
p->color[3] = (0.7f) * 255;
/* set other attributes */
- p->size = 10;
+ p->size = 10 * pointSizeScale;
p->type = trail;
p->isActive = 1;
@@ -298,7 +299,7 @@ spawnEmitterParticle(GLfloat x, GLfloat y)
p->xvel = 0;
p->yvel = -sqrt(2 * ACCEL * (screen_h - y));
/* set other attributes */
- p->size = 10;
+ p->size = 10 * pointSizeScale;
p->type = emitter;
p->isActive = 1;
/* our array has expanded at the end */
@@ -363,10 +364,7 @@ main(int argc, char *argv[])
{
SDL_Window *window; /* main window */
SDL_GLContext context;
- int w, h;
- Uint32 startFrame; /* time frame began to process */
- Uint32 endFrame; /* time frame ended processing */
- Uint32 delay; /* time to pause waiting to draw next frame */
+ int drawableW, drawableH;
int done; /* should we clean up and exit? */
/* initialize SDL */
@@ -391,11 +389,19 @@ main(int argc, char *argv[])
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
/* create main window and renderer */
- window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
- SDL_WINDOW_OPENGL |
- SDL_WINDOW_BORDERLESS);
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480,
+ SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
context = SDL_GL_CreateContext(window);
+ /* The window size and drawable size may be different when highdpi is enabled,
+ * due to the increased pixel density of the drawable. */
+ SDL_GetWindowSize(window, &screen_w, &screen_h);
+ SDL_GL_GetDrawableSize(window, &drawableW, &drawableH);
+
+ /* In OpenGL, point sizes are always in pixels. We don't want them looking
+ * tiny on a retina screen. */
+ pointSizeScale = (float) drawableH / (float) screen_h;
+
/* load the particle texture */
initializeTexture();
@@ -412,8 +418,7 @@ main(int argc, char *argv[])
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- SDL_GetWindowSize(window, &screen_w, &screen_h);
- glViewport(0, 0, screen_w, screen_h);
+ glViewport(0, 0, drawableW, drawableH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -436,14 +441,14 @@ main(int argc, char *argv[])
glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
} else {
/* if extension not available then all particles have size 10 */
- glPointSize(10);
+ glPointSize(10 * pointSizeScale);
}
done = 0;
/* enter main loop */
while (!done) {
- startFrame = SDL_GetTicks();
SDL_Event event;
+ double deltaTime = updateDeltaTime();
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
@@ -454,19 +459,10 @@ main(int argc, char *argv[])
spawnEmitterParticle(x, y);
}
}
- stepParticles();
+ stepParticles(deltaTime);
drawParticles();
SDL_GL_SwapWindow(window);
- endFrame = SDL_GetTicks();
-
- /* figure out how much time we have left, and then sleep */
- delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
- if (delay > MILLESECONDS_PER_FRAME) {
- delay = MILLESECONDS_PER_FRAME;
- }
- if (delay > 0) {
- SDL_Delay(delay);
- }
+ SDL_Delay(1);
}
/* delete textures */
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/happy.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/happy.c
similarity index 71%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/happy.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/happy.c
index ce661d9587..658a65f01b 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/happy.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/happy.c
@@ -8,8 +8,7 @@
#include "common.h"
#define NUM_HAPPY_FACES 100 /* number of faces to draw */
-#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
-#define HAPPY_FACE_SIZE 32 /* width and height of happyface (pixels) */
+#define HAPPY_FACE_SIZE 32 /* width and height of happyface */
static SDL_Texture *texture = 0; /* reference to texture holding happyface */
@@ -24,30 +23,37 @@ static struct
units of velocity are pixels per millesecond
*/
void
-initializeHappyFaces()
+initializeHappyFaces(SDL_Renderer *renderer)
{
int i;
+ int w;
+ int h;
+ SDL_RenderGetLogicalSize(renderer, &w, &h);
+
for (i = 0; i < NUM_HAPPY_FACES; i++) {
- faces[i].x = randomFloat(0.0f, SCREEN_WIDTH - HAPPY_FACE_SIZE);
- faces[i].y = randomFloat(0.0f, SCREEN_HEIGHT - HAPPY_FACE_SIZE);
- faces[i].xvel = randomFloat(-0.1f, 0.1f);
- faces[i].yvel = randomFloat(-0.1f, 0.1f);
+ faces[i].x = randomFloat(0.0f, w - HAPPY_FACE_SIZE);
+ faces[i].y = randomFloat(0.0f, h - HAPPY_FACE_SIZE);
+ faces[i].xvel = randomFloat(-60.0f, 60.0f);
+ faces[i].yvel = randomFloat(-60.0f, 60.0f);
}
}
void
-render(SDL_Renderer *renderer)
+render(SDL_Renderer *renderer, double deltaTime)
{
-
int i;
SDL_Rect srcRect;
SDL_Rect dstRect;
+ int w;
+ int h;
+
+ SDL_RenderGetLogicalSize(renderer, &w, &h);
/* setup boundaries for happyface bouncing */
- Uint16 maxx = SCREEN_WIDTH - HAPPY_FACE_SIZE;
- Uint16 maxy = SCREEN_HEIGHT - HAPPY_FACE_SIZE;
- Uint16 minx = 0;
- Uint16 miny = 0;
+ int maxx = w - HAPPY_FACE_SIZE;
+ int maxy = h - HAPPY_FACE_SIZE;
+ int minx = 0;
+ int miny = 0;
/* setup rects for drawing */
srcRect.x = 0;
@@ -68,8 +74,8 @@ render(SDL_Renderer *renderer)
- draw
*/
for (i = 0; i < NUM_HAPPY_FACES; i++) {
- faces[i].x += faces[i].xvel * MILLESECONDS_PER_FRAME;
- faces[i].y += faces[i].yvel * MILLESECONDS_PER_FRAME;
+ faces[i].x += faces[i].xvel * deltaTime;
+ faces[i].y += faces[i].yvel * deltaTime;
if (faces[i].x > maxx) {
faces[i].x = maxx;
faces[i].xvel = -faces[i].xvel;
@@ -123,48 +129,45 @@ initializeTexture(SDL_Renderer *renderer)
int
main(int argc, char *argv[])
{
-
SDL_Window *window;
SDL_Renderer *renderer;
- Uint32 startFrame;
- Uint32 endFrame;
- Uint32 delay;
int done;
+ int width;
+ int height;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fatalError("Could not initialize SDL");
}
- window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
- SDL_WINDOW_OPENGL |
- SDL_WINDOW_BORDERLESS);
+
+ /* The specified window size doesn't matter - except for its aspect ratio,
+ * which determines whether the window is in portrait or landscape on iOS
+ * (if SDL_WINDOW_RESIZABLE isn't specified). */
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, -1, 0);
+ SDL_GetWindowSize(window, &width, &height);
+ SDL_RenderSetLogicalSize(renderer, width, height);
+
initializeTexture(renderer);
- initializeHappyFaces();
+ initializeHappyFaces(renderer);
+
/* main loop */
done = 0;
while (!done) {
- startFrame = SDL_GetTicks();
SDL_Event event;
+ double deltaTime = updateDeltaTime();
+
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
done = 1;
}
}
- render(renderer);
- endFrame = SDL_GetTicks();
-
- /* figure out how much time we have left, and then sleep */
- delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
- if (delay < 0) {
- delay = 0;
- } else if (delay > MILLESECONDS_PER_FRAME) {
- delay = MILLESECONDS_PER_FRAME;
- }
- SDL_Delay(delay);
+
+ render(renderer, deltaTime);
+ SDL_Delay(1);
}
/* cleanup */
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/keyboard.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/keyboard.c
similarity index 68%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/keyboard.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/keyboard.c
index 4fb45b94ae..cfbe4e66b4 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/keyboard.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/keyboard.c
@@ -4,23 +4,24 @@
* use however you want
*/
-#import "SDL.h"
-#import "common.h"
+#include "SDL.h"
+#include "common.h"
+
+#define TEST_INPUT_RECT
#define GLYPH_SIZE_IMAGE 16 /* size of glyphs (characters) in the bitmap font file */
#define GLYPH_SIZE_SCREEN 32 /* size of glyphs (characters) as shown on the screen */
-static SDL_Texture *texture; /* texture where we'll hold our font */
+#define MAX_CHARS 1024
-/* function declarations */
-void cleanup(void);
-void drawBlank(int x, int y);
+static SDL_Texture *texture; /* texture where we'll hold our font */
static SDL_Renderer *renderer;
static int numChars = 0; /* number of characters we've typed so far */
-static SDL_bool lastCharWasColon = 0; /* we use this to detect sequences such as :) */
static SDL_Color bg_color = { 50, 50, 100, 255 }; /* color of background */
+static int glyphs[MAX_CHARS];
+
/* this structure maps a scancode to an index in our bitmap font.
it also contains data about under which modifiers the mapping is valid
(for example, we don't want shift + 1 to produce the character '1',
@@ -107,7 +108,7 @@ fontMapping map[TABLE_SIZE] = {
If there is no entry for the key, -1 is returned
*/
int
-keyToIndex(SDL_Keysym key)
+keyToGlyphIndex(SDL_Keysym key)
{
int i, index = -1;
for (i = 0; i < TABLE_SIZE; i++) {
@@ -132,66 +133,36 @@ keyToIndex(SDL_Keysym key)
void
getPositionForCharNumber(int n, int *x, int *y)
{
+ int renderW, renderH;
+ SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
+
int x_padding = 16; /* padding space on left and right side of screen */
int y_padding = 32; /* padding space at top of screen */
/* figure out the number of characters that can fit horizontally across the screen */
- int max_x_chars = (SCREEN_WIDTH - 2 * x_padding) / GLYPH_SIZE_SCREEN;
+ int max_x_chars = (renderW - 2 * x_padding) / GLYPH_SIZE_SCREEN;
int line_separation = 5; /* pixels between each line */
*x = (n % max_x_chars) * GLYPH_SIZE_SCREEN + x_padding;
- *y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) +
- y_padding;
+#ifdef TEST_INPUT_RECT
+ *y = renderH - GLYPH_SIZE_SCREEN;
+#else
+ *y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) + y_padding;
+#endif
}
void
-drawIndex(int index)
+drawGlyph(int glyph, int positionIndex)
{
int x, y;
- getPositionForCharNumber(numChars, &x, &y);
- SDL_Rect srcRect =
- { GLYPH_SIZE_IMAGE * index, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE };
+ getPositionForCharNumber(positionIndex, &x, &y);
+ SDL_Rect srcRect = { GLYPH_SIZE_IMAGE * glyph, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE };
SDL_Rect dstRect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
- drawBlank(x, y);
SDL_RenderCopy(renderer, texture, &srcRect, &dstRect);
}
-/* draws the cursor icon at the current end position of the text */
-void
-drawCursor(void)
-{
- drawIndex(29); /* cursor is at index 29 in the bitmap font */
-}
-
-/* paints over a glyph sized region with the background color
- in effect it erases the area
-*/
-void
-drawBlank(int x, int y)
-{
- SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
- SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
- SDL_RenderFillRect(renderer, &rect);
-}
-
-/* moves backwards one character, erasing the last one put down */
-void
-backspace(void)
-{
- int x, y;
- if (numChars > 0) {
- getPositionForCharNumber(numChars, &x, &y);
- drawBlank(x, y);
- numChars--;
- getPositionForCharNumber(numChars, &x, &y);
- drawBlank(x, y);
- drawCursor();
- }
-}
-
/* this function loads our font into an SDL_Texture and returns the SDL_Texture */
SDL_Texture*
loadFont(void)
{
-
SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp");
if (!surface) {
@@ -211,8 +182,7 @@ loadFont(void)
Bmask, Amask);
SDL_BlitSurface(surface, NULL, converted, NULL);
/* create our texture */
- texture =
- SDL_CreateTextureFromSurface(renderer, converted);
+ texture = SDL_CreateTextureFromSurface(renderer, converted);
if (texture == 0) {
printf("texture creation failed: %s\n", SDL_GetError());
} else {
@@ -225,86 +195,107 @@ loadFont(void)
}
}
+void
+draw()
+{
+ SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
+ SDL_RenderClear(renderer);
+
+ for (int i = 0; i < numChars; i++) {
+ drawGlyph(glyphs[i], i);
+ }
+
+ drawGlyph(29, numChars); /* cursor is at index 29 in the bitmap font */
+
+ SDL_RenderPresent(renderer);
+}
+
int
main(int argc, char *argv[])
{
-
- int index; /* index of last key we pushed in the bitmap font */
SDL_Window *window;
SDL_Event event; /* last event received */
- SDL_Keymod mod; /* key modifiers of last key we pushed */
SDL_Scancode scancode; /* scancode of last key we pushed */
+ int width;
+ int height;
+ int done;
+ SDL_Rect textrect;
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("Error initializing SDL: %s", SDL_GetError());
}
/* create window */
- window = SDL_CreateWindow("iPhone keyboard test", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
+ window = SDL_CreateWindow("iOS keyboard test", 0, 0, 0, 0, SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
/* create renderer */
- renderer = SDL_CreateRenderer(window, -1, 0);
+ renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC);
+
+ SDL_GetWindowSize(window, &width, &height);
+ SDL_RenderSetLogicalSize(renderer, width, height);
/* load up our font */
loadFont();
+
+ /* Show onscreen keyboard */
+#ifdef TEST_INPUT_RECT
+ textrect.x = 0;
+ textrect.y = height - GLYPH_SIZE_IMAGE;
+ textrect.w = width;
+ textrect.h = GLYPH_SIZE_IMAGE;
+ SDL_SetTextInputRect(&textrect);
+#endif
+ SDL_StartTextInput();
- /* draw the background, we'll just paint over it */
- SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a);
- SDL_RenderFillRect(renderer, NULL);
- SDL_RenderPresent(renderer);
-
- int done = 0;
- /* loop till we get SDL_Quit */
- while (SDL_WaitEvent(&event)) {
- switch (event.type) {
- case SDL_QUIT:
- done = 1;
- break;
- case SDL_KEYDOWN:
- index = keyToIndex(event.key.keysym);
- scancode = event.key.keysym.scancode;
- mod = event.key.keysym.mod;
- if (scancode == SDL_SCANCODE_DELETE) {
- /* if user hit delete, delete the last character */
- backspace();
- lastCharWasColon = 0;
- } else if (lastCharWasColon && scancode == SDL_SCANCODE_0
- && (mod & KMOD_SHIFT)) {
- /* if our last key was a colon and this one is a close paren, the make a hoppy face */
- backspace();
- drawIndex(32); /* index for happy face */
- numChars++;
- drawCursor();
- lastCharWasColon = 0;
- } else if (index != -1) {
- /* if we aren't doing a happy face, then just draw the normal character */
- drawIndex(index);
- numChars++;
- drawCursor();
- lastCharWasColon =
- (event.key.keysym.scancode == SDL_SCANCODE_SEMICOLON
- && (event.key.keysym.mod & KMOD_SHIFT));
- }
- /* check if the key was a colon */
- /* draw our updates to the screen */
- SDL_RenderPresent(renderer);
- break;
- case SDL_MOUSEBUTTONUP:
- /* mouse up toggles onscreen keyboard visibility */
- if (SDL_IsTextInputActive()) {
- SDL_StopTextInput();
- } else {
- SDL_StartTextInput();
+ done = 0;
+ while (!done) {
+ while (SDL_PollEvent(&event)) {
+ switch (event.type) {
+ case SDL_QUIT:
+ done = 1;
+ break;
+ case SDL_WINDOWEVENT:
+ if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
+ width = event.window.data1;
+ height = event.window.data2;
+ SDL_RenderSetLogicalSize(renderer, width, height);
+#ifdef TEST_INPUT_RECT
+ textrect.x = 0;
+ textrect.y = height - GLYPH_SIZE_IMAGE;
+ textrect.w = width;
+ textrect.h = GLYPH_SIZE_IMAGE;
+ SDL_SetTextInputRect(&textrect);
+#endif
+ }
+ break;
+ case SDL_KEYDOWN:
+ if (event.key.keysym.scancode == SDL_SCANCODE_BACKSPACE) {
+ if (numChars > 0) {
+ numChars--;
+ }
+ } else if (numChars + 1 < MAX_CHARS) {
+ int index = keyToGlyphIndex(event.key.keysym);
+ if (index >= 0) {
+ glyphs[numChars++] = index;
+ }
+ }
+ break;
+ case SDL_MOUSEBUTTONUP:
+ /* mouse up toggles onscreen keyboard visibility */
+ if (SDL_IsTextInputActive()) {
+ SDL_StopTextInput();
+ } else {
+ SDL_StartTextInput();
+ }
+ break;
}
- break;
}
+
+ draw();
+ SDL_Delay(15);
}
- cleanup();
- return 0;
-}
-/* clean up after ourselves like a good kiddy */
-void
-cleanup(void)
-{
SDL_DestroyTexture(texture);
+ SDL_DestroyRenderer(renderer);
+ SDL_DestroyWindow(window);
SDL_Quit();
+ return 0;
}
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/mixer.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/mixer.c
similarity index 90%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/mixer.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/mixer.c
index bd0cfb1dff..14945ad334 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/mixer.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/mixer.c
@@ -4,12 +4,11 @@
* use however you want
*/
-#import "SDL.h"
-#import "common.h"
+#include "SDL.h"
+#include "common.h"
#define NUM_CHANNELS 8 /* max number of sounds we can play at once */
#define NUM_DRUMS 4 /* number of drums in our set */
-#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */
static struct
{
@@ -33,7 +32,7 @@ static struct sound drums[NUM_DRUMS];
void handleMouseButtonDown(SDL_Event * event);
void handleMouseButtonUp(SDL_Event * event);
int playSound(struct sound *);
-void initializeButtons();
+void initializeButtons(SDL_Renderer *);
void audioCallback(void *userdata, Uint8 * stream, int len);
void loadSound(const char *file, struct sound *s);
@@ -52,19 +51,21 @@ struct
/* sets up the buttons (color, position, state) */
void
-initializeButtons()
+initializeButtons(SDL_Renderer *renderer)
{
-
int i;
int spacing = 10; /* gap between drum buttons */
SDL_Rect buttonRect; /* keeps track of where to position drum */
SDL_Color upColor = { 86, 86, 140, 255 }; /* color of drum when not pressed */
SDL_Color downColor = { 191, 191, 221, 255 }; /* color of drum when pressed */
+ int renderW, renderH;
+
+ SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
buttonRect.x = spacing;
buttonRect.y = spacing;
- buttonRect.w = SCREEN_WIDTH - 2 * spacing;
- buttonRect.h = (SCREEN_HEIGHT - (NUM_DRUMS + 1) * spacing) / NUM_DRUMS;
+ buttonRect.w = renderW - 2 * spacing;
+ buttonRect.h = (renderH - (NUM_DRUMS + 1) * spacing) / NUM_DRUMS;
/* setup each button */
for (i = 0; i < NUM_DRUMS; i++) {
@@ -249,7 +250,7 @@ audioCallback(void *userdata, Uint8 * stream, int len)
/* mix this sound effect with the output */
SDL_MixAudioFormat(stream, mixer.channels[i].position,
- mixer.outputSpec.format, copy_amt, 150);
+ mixer.outputSpec.format, copy_amt, SDL_MIX_MAXVOLUME);
/* update buffer position in sound effect and the number of bytes left */
mixer.channels[i].position += copy_amt;
@@ -270,23 +271,23 @@ audioCallback(void *userdata, Uint8 * stream, int len)
int
main(int argc, char *argv[])
{
-
int done; /* has user tried to quit ? */
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
SDL_Event event;
- Uint32 startFrame; /* holds when frame started processing */
- Uint32 endFrame; /* holds when frame ended processing */
- Uint32 delay; /* calculated delay, how long should we wait before next frame? */
+ int i;
+ int width;
+ int height;
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
fatalError("could not initialize SDL");
}
- window =
- SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
- SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, 0, 0);
+ SDL_GetWindowSize(window, &width, &height);
+ SDL_RenderSetLogicalSize(renderer, width, height);
+
/* initialize the mixer */
SDL_memset(&mixer, 0, sizeof(mixer));
/* setup output format */
@@ -309,12 +310,11 @@ main(int argc, char *argv[])
loadSound("ds_china.wav", &drums[0]);
/* setup positions, colors, and state of buttons */
- initializeButtons();
+ initializeButtons(renderer);
/* enter main loop */
done = 0;
while (!done) {
- startFrame = SDL_GetTicks();
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_MOUSEBUTTONDOWN:
@@ -329,20 +329,11 @@ main(int argc, char *argv[])
}
}
render(renderer); /* draw buttons */
- endFrame = SDL_GetTicks();
-
- /* figure out how much time we have left, and then sleep */
- delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
- if (delay < 0) {
- delay = 0;
- } else if (delay > MILLESECONDS_PER_FRAME) {
- delay = MILLESECONDS_PER_FRAME;
- }
- SDL_Delay(delay);
+
+ SDL_Delay(1);
}
/* cleanup code, let's free up those sound buffers */
- int i;
for (i = 0; i < NUM_DRUMS; i++) {
SDL_free(drums[i].buffer);
}
diff --git a/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/rectangles.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/rectangles.c
new file mode 100644
index 0000000000..10f9f851b3
--- /dev/null
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/rectangles.c
@@ -0,0 +1,92 @@
+/*
+ * rectangles.c
+ * written by Holmes Futrell
+ * use however you want
+*/
+
+#include "SDL.h"
+#include
+#include "common.h"
+
+void
+render(SDL_Renderer *renderer)
+{
+ Uint8 r, g, b;
+ int renderW;
+ int renderH;
+
+ SDL_RenderGetLogicalSize(renderer, &renderW, &renderH);
+
+ /* Come up with a random rectangle */
+ SDL_Rect rect;
+ rect.w = randomInt(64, 128);
+ rect.h = randomInt(64, 128);
+ rect.x = randomInt(0, renderW);
+ rect.y = randomInt(0, renderH);
+
+ /* Come up with a random color */
+ r = randomInt(50, 255);
+ g = randomInt(50, 255);
+ b = randomInt(50, 255);
+
+ /* Fill the rectangle in the color */
+ SDL_SetRenderDrawColor(renderer, r, g, b, 255);
+ SDL_RenderFillRect(renderer, &rect);
+
+ /* update screen */
+ SDL_RenderPresent(renderer);
+}
+
+int
+main(int argc, char *argv[])
+{
+
+ SDL_Window *window;
+ SDL_Renderer *renderer;
+ int done;
+ SDL_Event event;
+ int windowW;
+ int windowH;
+
+ /* initialize SDL */
+ if (SDL_Init(SDL_INIT_VIDEO) < 0) {
+ fatalError("Could not initialize SDL");
+ }
+
+ /* seed random number generator */
+ srand(time(NULL));
+
+ /* create window and renderer */
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI);
+ if (window == 0) {
+ fatalError("Could not initialize Window");
+ }
+ renderer = SDL_CreateRenderer(window, -1, 0);
+ if (!renderer) {
+ fatalError("Could not create renderer");
+ }
+
+ SDL_GetWindowSize(window, &windowW, &windowH);
+ SDL_RenderSetLogicalSize(renderer, windowW, windowH);
+
+ /* Fill screen with black */
+ SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
+ SDL_RenderClear(renderer);
+
+ /* Enter render loop, waiting for user to quit */
+ done = 0;
+ while (!done) {
+ while (SDL_PollEvent(&event)) {
+ if (event.type == SDL_QUIT) {
+ done = 1;
+ }
+ }
+ render(renderer);
+ SDL_Delay(1);
+ }
+
+ /* shutdown SDL */
+ SDL_Quit();
+
+ return 0;
+}
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/touch.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/touch.c
similarity index 91%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/touch.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/touch.c
index c81dcbc223..470b9d1bdc 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Demos/src/touch.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Demos/src/touch.c
@@ -5,7 +5,7 @@
*/
#include "SDL.h"
-#include "math.h"
+#include
#include "common.h"
#define BRUSH_SIZE 32 /* width and height of the brush */
@@ -26,15 +26,17 @@ drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy)
float dx_prime = dx / iterations; /* x-shift per iteration */
float dy_prime = dy / iterations; /* y-shift per iteration */
SDL_Rect dstRect; /* rect to draw brush sprite into */
+ float x;
+ float y;
+ int i;
dstRect.w = BRUSH_SIZE;
dstRect.h = BRUSH_SIZE;
/* setup x and y for the location of the first sprite */
- float x = startx - BRUSH_SIZE / 2.0f;
- float y = starty - BRUSH_SIZE / 2.0f;
+ x = startx - BRUSH_SIZE / 2.0f;
+ y = starty - BRUSH_SIZE / 2.0f;
- int i;
/* draw a series of blots to form the line */
for (i = 0; i < iterations; i++) {
dstRect.x = x;
@@ -80,6 +82,7 @@ main(int argc, char *argv[])
SDL_Window *window; /* main window */
SDL_Renderer *renderer;
int done; /* does user want to quit? */
+ int w, h;
/* initialize SDL */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
@@ -87,11 +90,12 @@ main(int argc, char *argv[])
}
/* create main window and renderer */
- window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
- SDL_WINDOW_OPENGL |
- SDL_WINDOW_BORDERLESS);
+ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI);
renderer = SDL_CreateRenderer(window, 0, 0);
+ SDL_GetWindowSize(window, &w, &h);
+ SDL_RenderSetLogicalSize(renderer, w, h);
+
/* load brush texture */
initializeTexture(renderer);
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/3rdparty/sdl2-2.0.9/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
old mode 100755
new mode 100644
similarity index 63%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
index 9f0d62e8a4..aace16b77b
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
@@ -18,6 +18,28 @@
name = PrepareXcodeProjectTemplate;
productName = PrepareXcodeProjectTemplate;
};
+ C143576D1F4C4DAA000B792B /* All-iOS */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = C143576E1F4C4DAB000B792B /* Build configuration list for PBXAggregateTarget "All-iOS" */;
+ buildPhases = (
+ C14357711F4C4DB2000B792B /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = "All-iOS";
+ productName = "All (iOS)";
+ };
+ C14357721F4C4F2A000B792B /* All-tvOS */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = C14357741F4C4F2A000B792B /* Build configuration list for PBXAggregateTarget "All-tvOS" */;
+ buildPhases = (
+ C14357731F4C4F2A000B792B /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = "All-tvOS";
+ productName = "All (iOS)";
+ };
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
@@ -30,8 +52,6 @@
041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; };
0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; };
0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
- 04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; };
- 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; };
04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */; };
@@ -67,6 +87,16 @@
04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; };
04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
+ 4D7516FB1EE1C28A00820EEA /* SDL_uikitmetalview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D7516F81EE1C28A00820EEA /* SDL_uikitmetalview.m */; };
+ 4D7516FC1EE1C28A00820EEA /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D7516F91EE1C28A00820EEA /* SDL_uikitvulkan.h */; };
+ 4D7516FD1EE1C28A00820EEA /* SDL_uikitvulkan.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D7516FA1EE1C28A00820EEA /* SDL_uikitvulkan.m */; };
+ 4D7516FF1EE1C5B400820EEA /* SDL_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D7516FE1EE1C5B400820EEA /* SDL_vulkan.h */; };
+ 4D75171A1EE1D32200820EEA /* SDL_uikitmetalview.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D7517191EE1D32200820EEA /* SDL_uikitmetalview.h */; };
+ 4D75171F1EE1D98200820EEA /* SDL_vulkan_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D75171D1EE1D98200820EEA /* SDL_vulkan_internal.h */; };
+ 4D7517201EE1D98200820EEA /* SDL_vulkan_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D75171E1EE1D98200820EEA /* SDL_vulkan_utils.c */; };
+ 55FFA91A2122302B00D7CBED /* SDL_syspower.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FFA9192122302B00D7CBED /* SDL_syspower.h */; };
+ 566726451DF72CF5001DD3DB /* SDL_dataqueue.c in Sources */ = {isa = PBXBuildFile; fileRef = 566726431DF72CF5001DD3DB /* SDL_dataqueue.c */; };
+ 566726461DF72CF5001DD3DB /* SDL_dataqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 566726441DF72CF5001DD3DB /* SDL_dataqueue.h */; };
56A6702E18565E450007D20F /* SDL_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6702D18565E450007D20F /* SDL_internal.h */; };
56A6703518565E760007D20F /* SDL_dynapi_overrides.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6703118565E760007D20F /* SDL_dynapi_overrides.h */; };
56A6703618565E760007D20F /* SDL_dynapi_procs.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6703218565E760007D20F /* SDL_dynapi_procs.h */; };
@@ -74,17 +104,35 @@
56A6703818565E760007D20F /* SDL_dynapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6703418565E760007D20F /* SDL_dynapi.h */; };
56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */; };
56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
- 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
+ 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */; };
56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
+ 56F9D5601DF73BA400C15B5D /* SDL_dataqueue.c in Sources */ = {isa = PBXBuildFile; fileRef = 566726431DF72CF5001DD3DB /* SDL_dataqueue.c */; };
93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */; };
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
+ A704172E20F7E74800A82227 /* controller_type.h in Headers */ = {isa = PBXBuildFile; fileRef = A704172D20F7E74800A82227 /* controller_type.h */; };
+ A704172F20F7E76000A82227 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */; };
+ A7C19D29212E552C00DF2152 /* SDL_displayevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C19D27212E552B00DF2152 /* SDL_displayevents_c.h */; };
+ A7C19D2A212E552C00DF2152 /* SDL_displayevents.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C19D28212E552B00DF2152 /* SDL_displayevents.c */; };
+ A7C19D2B212E552C00DF2152 /* SDL_displayevents.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C19D28212E552B00DF2152 /* SDL_displayevents.c */; };
+ A7F629241FE06523002F9CC9 /* SDL_uikitmetalview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D7516F81EE1C28A00820EEA /* SDL_uikitmetalview.m */; };
AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */; };
AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */; };
AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; };
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */; };
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
+ AA13B3491FB8B27800D9FEE6 /* SDL_egl_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */; };
+ AA13B34A1FB8B27800D9FEE6 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */; };
+ AA13B34B1FB8B27800D9FEE6 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */; };
+ AA13B34C1FB8B27800D9FEE6 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */; };
+ AA13B34D1FB8B27800D9FEE6 /* SDL_egl.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */; };
+ AA13B34E1FB8B27800D9FEE6 /* SDL_yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */; };
+ AA13B3501FB8B3CC00D9FEE6 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */; };
+ AA13B3571FB8B46400D9FEE6 /* yuv_rgb_std_func.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */; };
+ AA13B3581FB8B46400D9FEE6 /* yuv_rgb_sse_func.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */; };
+ AA13B3591FB8B46400D9FEE6 /* yuv_rgb.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */; };
+ AA13B35A1FB8B46400D9FEE6 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */; };
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; };
AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */; };
@@ -143,7 +191,133 @@
AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */; };
AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; };
AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */; };
- FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */; settings = {ASSET_TAGS = (); }; };
+ AADC5A5D1FDA104400960936 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */; };
+ AADC5A5E1FDA105300960936 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */; };
+ AADC5A5F1FDA105600960936 /* SDL_vulkan_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D75171E1EE1D98200820EEA /* SDL_vulkan_utils.c */; };
+ AADC5A601FDA10A400960936 /* SDL_uikitvulkan.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D7516FA1EE1C28A00820EEA /* SDL_uikitvulkan.m */; };
+ AADC5A631FDA10C800960936 /* SDL_shaders_metal_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = AADC5A611FDA10C800960936 /* SDL_shaders_metal_ios.h */; };
+ AADC5A641FDA10C800960936 /* SDL_render_metal.m in Sources */ = {isa = PBXBuildFile; fileRef = AADC5A621FDA10C800960936 /* SDL_render_metal.m */; };
+ AADC5A651FDA10CB00960936 /* SDL_render_metal.m in Sources */ = {isa = PBXBuildFile; fileRef = AADC5A621FDA10C800960936 /* SDL_render_metal.m */; };
+ F30D9C99212CD0360047DF2E /* SDL_sensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C98212CD0360047DF2E /* SDL_sensor.h */; };
+ F30D9C9E212CD0990047DF2E /* SDL_sensor_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C9B212CD0980047DF2E /* SDL_sensor_c.h */; };
+ F30D9C9F212CD0990047DF2E /* SDL_syssensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C9C212CD0990047DF2E /* SDL_syssensor.h */; };
+ F30D9CA0212CD0990047DF2E /* SDL_sensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C9D212CD0990047DF2E /* SDL_sensor.c */; };
+ F30D9CA1212CD0990047DF2E /* SDL_sensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C9D212CD0990047DF2E /* SDL_sensor.c */; };
+ F30D9CA5212CD0BF0047DF2E /* SDL_coremotionsensor.m in Sources */ = {isa = PBXBuildFile; fileRef = F30D9CA3212CD0BF0047DF2E /* SDL_coremotionsensor.m */; };
+ F30D9CA6212CD0BF0047DF2E /* SDL_coremotionsensor.m in Sources */ = {isa = PBXBuildFile; fileRef = F30D9CA3212CD0BF0047DF2E /* SDL_coremotionsensor.m */; };
+ F30D9CA7212CD0BF0047DF2E /* SDL_coremotionsensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9CA4212CD0BF0047DF2E /* SDL_coremotionsensor.h */; };
+ F30D9CC6212CE92C0047DF2E /* hid.m in Sources */ = {isa = PBXBuildFile; fileRef = F30D9CC5212CE92C0047DF2E /* hid.m */; };
+ F30D9CC7212CE92C0047DF2E /* hid.m in Sources */ = {isa = PBXBuildFile; fileRef = F30D9CC5212CE92C0047DF2E /* hid.m */; };
+ F36839CC214790950000F255 /* SDL_dummysensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F36839CA214790950000F255 /* SDL_dummysensor.h */; };
+ F36839CD214790950000F255 /* SDL_dummysensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F36839CB214790950000F255 /* SDL_dummysensor.c */; };
+ F36839CE214790950000F255 /* SDL_dummysensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F36839CB214790950000F255 /* SDL_dummysensor.c */; };
+ F3BDD79220F51CB8004ECBF3 /* SDL_hidapi_xbox360.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78B20F51CB8004ECBF3 /* SDL_hidapi_xbox360.c */; };
+ F3BDD79320F51CB8004ECBF3 /* SDL_hidapi_xbox360.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78B20F51CB8004ECBF3 /* SDL_hidapi_xbox360.c */; };
+ F3BDD79420F51CB8004ECBF3 /* SDL_hidapi_switch.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78C20F51CB8004ECBF3 /* SDL_hidapi_switch.c */; };
+ F3BDD79520F51CB8004ECBF3 /* SDL_hidapi_switch.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78C20F51CB8004ECBF3 /* SDL_hidapi_switch.c */; };
+ F3BDD79620F51CB8004ECBF3 /* SDL_hidapi_xboxone.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78D20F51CB8004ECBF3 /* SDL_hidapi_xboxone.c */; };
+ F3BDD79720F51CB8004ECBF3 /* SDL_hidapi_xboxone.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78D20F51CB8004ECBF3 /* SDL_hidapi_xboxone.c */; };
+ F3BDD79820F51CB8004ECBF3 /* SDL_hidapi_ps4.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78E20F51CB8004ECBF3 /* SDL_hidapi_ps4.c */; };
+ F3BDD79920F51CB8004ECBF3 /* SDL_hidapi_ps4.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD78E20F51CB8004ECBF3 /* SDL_hidapi_ps4.c */; };
+ F3BDD79B20F51CB8004ECBF3 /* SDL_hidapijoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F3BDD79020F51CB8004ECBF3 /* SDL_hidapijoystick_c.h */; };
+ F3BDD79C20F51CB8004ECBF3 /* SDL_hidapijoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD79120F51CB8004ECBF3 /* SDL_hidapijoystick.c */; };
+ F3BDD79D20F51CB8004ECBF3 /* SDL_hidapijoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F3BDD79120F51CB8004ECBF3 /* SDL_hidapijoystick.c */; };
+ FA1DC2721C62BE65008F99A0 /* SDL_uikitclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = FA1DC2701C62BE65008F99A0 /* SDL_uikitclipboard.h */; };
+ FA1DC2731C62BE65008F99A0 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
+ FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
+ FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
+ FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
+ FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; };
+ FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; };
+ FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; };
+ FAB598271BB5C31500BE72C5 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */; };
+ FAB598281BB5C31500BE72C5 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */; };
+ FAB5982A1BB5C31500BE72C5 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */; };
+ FAB5982C1BB5C31500BE72C5 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */; };
+ FAB5982F1BB5C31500BE72C5 /* SDL_dynapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 56A6703318565E760007D20F /* SDL_dynapi.c */; };
+ FAB598361BB5C31500BE72C5 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
+ FAB598381BB5C31500BE72C5 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */; };
+ FAB5983A1BB5C31500BE72C5 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9930DD52EDC00FB1D6B /* SDL_events.c */; };
+ FAB5983C1BB5C31500BE72C5 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; };
+ FAB5983E1BB5C31500BE72C5 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */; };
+ FAB598401BB5C31500BE72C5 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */; };
+ FAB598421BB5C31500BE72C5 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */; };
+ FAB598441BB5C31500BE72C5 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
+ FAB598461BB5C31500BE72C5 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */; };
+ FAB598491BB5C31600BE72C5 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */; };
+ FAB5984A1BB5C31600BE72C5 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */; };
+ FAB5984B1BB5C31600BE72C5 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
+ FAB5984C1BB5C31600BE72C5 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; };
+ FAB5984D1BB5C31600BE72C5 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; };
+ FAB598501BB5C31600BE72C5 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */; };
+ FAB598521BB5C31600BE72C5 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */; };
+ FAB598551BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */; };
+ FAB598561BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; };
+ FAB598571BB5C31600BE72C5 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
+ FAB598581BB5C31600BE72C5 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
+ FAB598591BB5C31600BE72C5 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */; };
+ FAB5985A1BB5C31600BE72C5 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */; };
+ FAB5985B1BB5C31600BE72C5 /* SDL_shaders_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */; };
+ FAB5985D1BB5C31600BE72C5 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; };
+ FAB5985F1BB5C31600BE72C5 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; };
+ FAB598611BB5C31600BE72C5 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; };
+ FAB598641BB5C31600BE72C5 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; };
+ FAB598661BB5C31600BE72C5 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; };
+ FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; };
+ FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
+ FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; };
+ FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
+ FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
+ FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
+ FAB598741BB5C31600BE72C5 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
+ FAB598751BB5C31600BE72C5 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A730DEA620800C5B771 /* SDL_qsort.c */; };
+ FAB598761BB5C31600BE72C5 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */; };
+ FAB598771BB5C31600BE72C5 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A750DEA620800C5B771 /* SDL_string.c */; };
+ FAB598781BB5C31600BE72C5 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */; };
+ FAB598791BB5C31600BE72C5 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */; };
+ FAB5987B1BB5C31600BE72C5 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */; };
+ FAB5987C1BB5C31600BE72C5 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */; };
+ FAB5987E1BB5C31600BE72C5 /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; };
+ FAB598801BB5C31600BE72C5 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */; };
+ FAB598821BB5C31600BE72C5 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */; };
+ FAB598831BB5C31600BE72C5 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */; };
+ FAB598871BB5C31600BE72C5 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; };
+ FAB598891BB5C31600BE72C5 /* SDL_uikitevents.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */; };
+ FAB5988B1BB5C31600BE72C5 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; };
+ FAB5988D1BB5C31600BE72C5 /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
+ FAB5988F1BB5C31600BE72C5 /* SDL_uikitopengles.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */; };
+ FAB598911BB5C31600BE72C5 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; };
+ FAB598931BB5C31600BE72C5 /* SDL_uikitvideo.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */; };
+ FAB598951BB5C31600BE72C5 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F130E26E5D900F90B21 /* SDL_uikitview.m */; };
+ FAB598971BB5C31600BE72C5 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
+ FAB598991BB5C31600BE72C5 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */; };
+ FAB5989A1BB5C31600BE72C5 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F50DF244C800F98A1A /* SDL_nullevents.c */; };
+ FAB5989D1BB5C31600BE72C5 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; };
+ FAB5989E1BB5C31600BE72C5 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; };
+ FAB598A01BB5C31600BE72C5 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683000DF2374E00F98A1A /* SDL_blit.c */; };
+ FAB598A21BB5C31600BE72C5 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683020DF2374E00F98A1A /* SDL_blit_0.c */; };
+ FAB598A31BB5C31600BE72C5 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683030DF2374E00F98A1A /* SDL_blit_1.c */; };
+ FAB598A41BB5C31600BE72C5 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683040DF2374E00F98A1A /* SDL_blit_A.c */; };
+ FAB598A51BB5C31600BE72C5 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */; };
+ FAB598A71BB5C31600BE72C5 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */; };
+ FAB598A91BB5C31600BE72C5 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683090DF2374E00F98A1A /* SDL_blit_N.c */; };
+ FAB598AA1BB5C31600BE72C5 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */; };
+ FAB598AC1BB5C31600BE72C5 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */; };
+ FAB598AD1BB5C31600BE72C5 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; };
+ FAB598AE1BB5C31600BE72C5 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; };
+ FAB598AF1BB5C31600BE72C5 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; };
+ FAB598B11BB5C31600BE72C5 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; };
+ FAB598B21BB5C31600BE72C5 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */; };
+ FAB598B41BB5C31600BE72C5 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683170DF2374E00F98A1A /* SDL_stretch.c */; };
+ FAB598B51BB5C31600BE72C5 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683190DF2374E00F98A1A /* SDL_surface.c */; };
+ FAB598B71BB5C31600BE72C5 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6831B0DF2374E00F98A1A /* SDL_video.c */; };
+ FAB598B91BB5C31600BE72C5 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
+ FAB598BC1BB5C31600BE72C5 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */; };
+ FAB598BD1BB5C31600BE72C5 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5412FE1C3F004C9285 /* SDL_hints.c */; };
+ FAB598BE1BB5C31600BE72C5 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; };
+ FAB598BF1BB5C31600BE72C5 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D80DD52EDC00FB1D6B /* SDL.c */; };
+ FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */; };
+ FAFDF8C61D88D4530083E6F2 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
@@ -227,28 +401,26 @@
041B2CEB12FA0F680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; };
0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; };
0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; };
- 04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; };
- 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; };
04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; };
04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; };
0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = ""; };
0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_sw.c; sourceTree = ""; };
0442EC5212FE1C28004C9285 /* SDL_render_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles.c; sourceTree = ""; };
- 0442EC5412FE1C3F004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; };
+ 0442EC5412FE1C3F004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hints.c; sourceTree = ""; };
044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = ""; };
0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = ""; };
0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = ""; };
047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = ""; };
- 047677B90EA76A31008ABAF1 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_haptic.c; path = ../../src/haptic/SDL_haptic.c; sourceTree = SOURCE_ROOT; };
- 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syshaptic.h; path = ../../src/haptic/SDL_syshaptic.h; sourceTree = SOURCE_ROOT; };
+ 047677B90EA76A31008ABAF1 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_haptic.c; sourceTree = ""; };
+ 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syshaptic.h; sourceTree = ""; };
047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; };
04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = ""; };
04BA9D6011EF474A00B60E01 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = ""; };
04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = ""; };
04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = ""; };
- 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert_c.h; path = ../../src/SDL_assert_c.h; sourceTree = SOURCE_ROOT; };
- 04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
- 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
+ 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert_c.h; sourceTree = ""; };
+ 04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_log.c; sourceTree = ""; };
+ 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_assert.c; sourceTree = ""; };
04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; };
04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = ""; };
04F7806C12FB751400FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; };
@@ -264,24 +436,48 @@
04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = ""; };
04FFAB8912E23B8D00BA343D /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = ""; };
04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; };
- 56A6702D18565E450007D20F /* SDL_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_internal.h; path = ../../src/SDL_internal.h; sourceTree = ""; };
- 56A6703118565E760007D20F /* SDL_dynapi_overrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi_overrides.h; path = ../../src/dynapi/SDL_dynapi_overrides.h; sourceTree = ""; };
- 56A6703218565E760007D20F /* SDL_dynapi_procs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi_procs.h; path = ../../src/dynapi/SDL_dynapi_procs.h; sourceTree = ""; };
- 56A6703318565E760007D20F /* SDL_dynapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_dynapi.c; path = ../../src/dynapi/SDL_dynapi.c; sourceTree = ""; };
- 56A6703418565E760007D20F /* SDL_dynapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi.h; path = ../../src/dynapi/SDL_dynapi.h; sourceTree = ""; };
+ 4D7516F81EE1C28A00820EEA /* SDL_uikitmetalview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmetalview.m; sourceTree = ""; };
+ 4D7516F91EE1C28A00820EEA /* SDL_uikitvulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitvulkan.h; sourceTree = ""; };
+ 4D7516FA1EE1C28A00820EEA /* SDL_uikitvulkan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitvulkan.m; sourceTree = ""; };
+ 4D7516FE1EE1C5B400820EEA /* SDL_vulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_vulkan.h; sourceTree = ""; };
+ 4D7517191EE1D32200820EEA /* SDL_uikitmetalview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmetalview.h; sourceTree = ""; };
+ 4D75171D1EE1D98200820EEA /* SDL_vulkan_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_vulkan_internal.h; sourceTree = ""; };
+ 4D75171E1EE1D98200820EEA /* SDL_vulkan_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_vulkan_utils.c; sourceTree = ""; };
+ 55FFA9192122302B00D7CBED /* SDL_syspower.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syspower.h; sourceTree = ""; };
+ 566726431DF72CF5001DD3DB /* SDL_dataqueue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dataqueue.c; sourceTree = ""; };
+ 566726441DF72CF5001DD3DB /* SDL_dataqueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dataqueue.h; sourceTree = ""; };
+ 56A6702D18565E450007D20F /* SDL_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_internal.h; sourceTree = ""; };
+ 56A6703118565E760007D20F /* SDL_dynapi_overrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dynapi_overrides.h; sourceTree = ""; };
+ 56A6703218565E760007D20F /* SDL_dynapi_procs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dynapi_procs.h; sourceTree = ""; };
+ 56A6703318565E760007D20F /* SDL_dynapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dynapi.c; sourceTree = ""; };
+ 56A6703418565E760007D20F /* SDL_dynapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dynapi.h; sourceTree = ""; };
56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_filesystem.h; sourceTree = ""; };
- 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = ../../src/filesystem/cocoa/SDL_sysfilesystem.m; sourceTree = ""; };
- 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_coreaudio.c; path = coreaudio/SDL_coreaudio.c; sourceTree = ""; };
- 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_coreaudio.h; path = coreaudio/SDL_coreaudio.h; sourceTree = ""; };
- 56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; };
- 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; };
+ 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = cocoa/SDL_sysfilesystem.m; sourceTree = ""; };
+ 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_coreaudio.m; sourceTree = ""; };
+ 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = ""; };
+ 56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_power.c; sourceTree = ""; };
+ 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_syspower.m; sourceTree = ""; };
93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitviewcontroller.h; sourceTree = ""; };
93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitviewcontroller.m; sourceTree = ""; };
+ A704172D20F7E74800A82227 /* controller_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_type.h; sourceTree = ""; };
+ A7C19D27212E552B00DF2152 /* SDL_displayevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_displayevents_c.h; sourceTree = ""; };
+ A7C19D28212E552B00DF2152 /* SDL_displayevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_displayevents.c; sourceTree = ""; };
AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamecontroller.c; sourceTree = ""; };
AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = ""; };
AA0F8494178D5F1A00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = ""; };
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmodes.h; sourceTree = ""; };
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = ""; };
+ AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_egl_c.h; sourceTree = ""; };
+ AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = ""; };
+ AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = ""; };
+ AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_c.h; sourceTree = ""; };
+ AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_egl.c; sourceTree = ""; };
+ AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_c.h; sourceTree = ""; };
+ AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = ""; };
+ AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_std_func.h; sourceTree = ""; };
+ AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_sse_func.h; sourceTree = ""; };
+ AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb.h; sourceTree = ""; };
+ AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb.c; sourceTree = ""; };
AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = ""; };
AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = ""; };
AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = ""; };
@@ -340,6 +536,26 @@
AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = ""; };
AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmessagebox.m; sourceTree = ""; };
AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; };
+ AADC5A611FDA10C800960936 /* SDL_shaders_metal_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_metal_ios.h; sourceTree = ""; };
+ AADC5A621FDA10C800960936 /* SDL_render_metal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_render_metal.m; sourceTree = ""; };
+ F30D9C98212CD0360047DF2E /* SDL_sensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sensor.h; sourceTree = ""; };
+ F30D9C9B212CD0980047DF2E /* SDL_sensor_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sensor_c.h; sourceTree = ""; };
+ F30D9C9C212CD0990047DF2E /* SDL_syssensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syssensor.h; sourceTree = ""; };
+ F30D9C9D212CD0990047DF2E /* SDL_sensor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sensor.c; sourceTree = ""; };
+ F30D9CA3212CD0BF0047DF2E /* SDL_coremotionsensor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_coremotionsensor.m; sourceTree = ""; };
+ F30D9CA4212CD0BF0047DF2E /* SDL_coremotionsensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coremotionsensor.h; sourceTree = ""; };
+ F30D9CC5212CE92C0047DF2E /* hid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = hid.m; sourceTree = ""; };
+ F36839CA214790950000F255 /* SDL_dummysensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummysensor.h; sourceTree = ""; };
+ F36839CB214790950000F255 /* SDL_dummysensor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummysensor.c; sourceTree = ""; };
+ F3BDD78B20F51CB8004ECBF3 /* SDL_hidapi_xbox360.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_xbox360.c; sourceTree = ""; };
+ F3BDD78C20F51CB8004ECBF3 /* SDL_hidapi_switch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_switch.c; sourceTree = ""; };
+ F3BDD78D20F51CB8004ECBF3 /* SDL_hidapi_xboxone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_xboxone.c; sourceTree = ""; };
+ F3BDD78E20F51CB8004ECBF3 /* SDL_hidapi_ps4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_ps4.c; sourceTree = ""; };
+ F3BDD79020F51CB8004ECBF3 /* SDL_hidapijoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapijoystick_c.h; sourceTree = ""; };
+ F3BDD79120F51CB8004ECBF3 /* SDL_hidapijoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapijoystick.c; sourceTree = ""; };
+ FA1DC2701C62BE65008F99A0 /* SDL_uikitclipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitclipboard.h; sourceTree = ""; };
+ FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitclipboard.m; sourceTree = ""; };
+ FAB598141BB5C1B100BE72C5 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; };
FAD4F7011BA3C4E8008346CE /* SDL_sysjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick_c.h; sourceTree = ""; };
FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = ""; };
FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = ""; };
@@ -372,7 +588,6 @@
FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = ""; };
FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = ""; };
FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = ""; };
- FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = ""; };
FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = ""; };
FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = ""; };
FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = ""; };
@@ -395,9 +610,9 @@
FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_windowevents.c; sourceTree = ""; };
FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_windowevents_c.h; sourceTree = ""; };
FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = ""; };
- FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error_c.h; path = ../../src/SDL_error_c.h; sourceTree = ""; };
- FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = ""; };
- FD99B9D80DD52EDC00FB1D6B /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = ""; };
+ FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error_c.h; sourceTree = ""; };
+ FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_error.c; sourceTree = ""; };
+ FD99B9D80DD52EDC00FB1D6B /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL.c; sourceTree = ""; };
FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = ""; };
FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = ""; };
FD99BA090DD52EDC00FB1D6B /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = ""; };
@@ -461,19 +676,17 @@
041B2CE312FA0F680087D585 /* render */ = {
isa = PBXGroup;
children = (
+ AADC5A5C1FDA100800960936 /* metal */,
041B2CE812FA0F680087D585 /* opengles */,
0402A85412FE70C600CECEE3 /* opengles2 */,
041B2CEC12FA0F680087D585 /* software */,
- 04409BA212FA989600FB9AA8 /* mmx.h */,
041B2CEA12FA0F680087D585 /* SDL_render.c */,
041B2CEB12FA0F680087D585 /* SDL_sysrender.h */,
- 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */,
04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */,
04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */,
);
- name = render;
- path = ../../src/render;
- sourceTree = SOURCE_ROOT;
+ path = render;
+ sourceTree = "";
};
041B2CE812FA0F680087D585 /* opengles */ = {
isa = PBXGroup;
@@ -512,7 +725,7 @@
047677B90EA76A31008ABAF1 /* SDL_haptic.c */,
047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */,
);
- name = haptic;
+ path = haptic;
sourceTree = "";
};
047677B70EA76A31008ABAF1 /* dummy */ = {
@@ -520,9 +733,8 @@
children = (
047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */,
);
- name = dummy;
- path = ../../src/haptic/dummy;
- sourceTree = SOURCE_ROOT;
+ path = dummy;
+ sourceTree = "";
};
047AF1B10EA98D6C00811173 /* dummy */ = {
isa = PBXGroup;
@@ -538,14 +750,14 @@
04FFAB8912E23B8D00BA343D /* SDL_atomic.c */,
04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */,
);
- name = atomic;
- path = ../../src/atomic;
- sourceTree = SOURCE_ROOT;
+ path = atomic;
+ sourceTree = "";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
FD6526630DE8FCCB002AD96B /* libSDL2.a */,
+ FAB598141BB5C1B100BE72C5 /* libSDL2.a */,
);
name = Products;
sourceTree = "";
@@ -569,7 +781,7 @@
56A6703318565E760007D20F /* SDL_dynapi.c */,
56A6703418565E760007D20F /* SDL_dynapi.h */,
);
- name = dynapi;
+ path = dynapi;
sourceTree = "";
};
56C181E017C44D6900406AE3 /* filesystem */ = {
@@ -577,16 +789,16 @@
children = (
56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */,
);
- name = filesystem;
+ path = filesystem;
sourceTree = "";
};
56EA86F813E9EBF9002E47EB /* coreaudio */ = {
isa = PBXGroup;
children = (
- 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */,
+ 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */,
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */,
);
- name = coreaudio;
+ path = coreaudio;
sourceTree = "";
};
56ED04DE118A8E9A00A56AA6 /* power */ = {
@@ -595,15 +807,95 @@
56ED04E0118A8EE200A56AA6 /* SDL_power.c */,
56ED04DF118A8EB700A56AA6 /* uikit */,
);
- name = power;
+ path = power;
sourceTree = "";
};
56ED04DF118A8EB700A56AA6 /* uikit */ = {
isa = PBXGroup;
children = (
+ 55FFA9192122302B00D7CBED /* SDL_syspower.h */,
56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */,
);
- name = uikit;
+ path = uikit;
+ sourceTree = "";
+ };
+ AA13B3521FB8B41700D9FEE6 /* yuv2rgb */ = {
+ isa = PBXGroup;
+ children = (
+ AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */,
+ AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */,
+ AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */,
+ AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */,
+ );
+ path = yuv2rgb;
+ sourceTree = "";
+ };
+ AADC5A5C1FDA100800960936 /* metal */ = {
+ isa = PBXGroup;
+ children = (
+ AADC5A621FDA10C800960936 /* SDL_render_metal.m */,
+ AADC5A611FDA10C800960936 /* SDL_shaders_metal_ios.h */,
+ );
+ path = metal;
+ sourceTree = "";
+ };
+ F30D9C9A212CD0590047DF2E /* sensor */ = {
+ isa = PBXGroup;
+ children = (
+ F30D9CA2212CD09E0047DF2E /* coremotion */,
+ F36839C9214790740000F255 /* dummy */,
+ F30D9C9B212CD0980047DF2E /* SDL_sensor_c.h */,
+ F30D9C9D212CD0990047DF2E /* SDL_sensor.c */,
+ F30D9C9C212CD0990047DF2E /* SDL_syssensor.h */,
+ );
+ path = sensor;
+ sourceTree = "";
+ };
+ F30D9CA2212CD09E0047DF2E /* coremotion */ = {
+ isa = PBXGroup;
+ children = (
+ F30D9CA4212CD0BF0047DF2E /* SDL_coremotionsensor.h */,
+ F30D9CA3212CD0BF0047DF2E /* SDL_coremotionsensor.m */,
+ );
+ path = coremotion;
+ sourceTree = "";
+ };
+ F35CEA6E20F51B7F003ECE98 /* hidapi */ = {
+ isa = PBXGroup;
+ children = (
+ F3BDD77420F51C18004ECBF3 /* ios */,
+ );
+ path = hidapi;
+ sourceTree = "";
+ };
+ F36839C9214790740000F255 /* dummy */ = {
+ isa = PBXGroup;
+ children = (
+ F36839CB214790950000F255 /* SDL_dummysensor.c */,
+ F36839CA214790950000F255 /* SDL_dummysensor.h */,
+ );
+ path = dummy;
+ sourceTree = "";
+ };
+ F3BDD77420F51C18004ECBF3 /* ios */ = {
+ isa = PBXGroup;
+ children = (
+ F30D9CC5212CE92C0047DF2E /* hid.m */,
+ );
+ path = ios;
+ sourceTree = "";
+ };
+ F3BDD78A20F51C8D004ECBF3 /* hidapi */ = {
+ isa = PBXGroup;
+ children = (
+ F3BDD78E20F51CB8004ECBF3 /* SDL_hidapi_ps4.c */,
+ F3BDD78C20F51CB8004ECBF3 /* SDL_hidapi_switch.c */,
+ F3BDD78B20F51CB8004ECBF3 /* SDL_hidapi_xbox360.c */,
+ F3BDD78D20F51CB8004ECBF3 /* SDL_hidapi_xboxone.c */,
+ F3BDD79020F51CB8004ECBF3 /* SDL_hidapijoystick_c.h */,
+ F3BDD79120F51CB8004ECBF3 /* SDL_hidapijoystick.c */,
+ );
+ path = hidapi;
sourceTree = "";
};
FD3F4A6F0DEA620800C5B771 /* stdlib */ = {
@@ -616,22 +908,22 @@
FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */,
FD3F4A750DEA620800C5B771 /* SDL_string.c */,
);
- name = stdlib;
- path = ../../src/stdlib;
- sourceTree = SOURCE_ROOT;
+ path = stdlib;
+ sourceTree = "";
};
FD5F9D080E0E08B3008E885B /* joystick */ = {
isa = PBXGroup;
children = (
+ F3BDD78A20F51C8D004ECBF3 /* hidapi */,
FD689EFF0E26E5B600F90B21 /* iphoneos */,
+ A704172D20F7E74800A82227 /* controller_type.h */,
AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */,
FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */,
FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */,
FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */,
);
- name = joystick;
- path = ../../src/joystick;
- sourceTree = SOURCE_ROOT;
+ path = joystick;
+ sourceTree = "";
};
FD689EFF0E26E5B600F90B21 /* iphoneos */ = {
isa = PBXGroup;
@@ -648,10 +940,14 @@
FDC261780E3A3FC8001C4554 /* keyinfotable.h */,
FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */,
FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
+ FA1DC2701C62BE65008F99A0 /* SDL_uikitclipboard.h */,
+ FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */,
FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */,
FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */,
AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */,
AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */,
+ 4D7517191EE1D32200820EEA /* SDL_uikitmetalview.h */,
+ 4D7516F81EE1C28A00820EEA /* SDL_uikitmetalview.m */,
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */,
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */,
FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */,
@@ -664,6 +960,8 @@
FD689F130E26E5D900F90B21 /* SDL_uikitview.m */,
93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */,
93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */,
+ 4D7516F91EE1C28A00820EEA /* SDL_uikitvulkan.h */,
+ 4D7516FA1EE1C28A00820EEA /* SDL_uikitvulkan.m */,
FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */,
FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */,
);
@@ -676,9 +974,8 @@
047AF1B10EA98D6C00811173 /* dummy */,
FD8BD8180E27E25900B52CD5 /* dlopen */,
);
- name = loadso;
- path = ../../src/loadso;
- sourceTree = SOURCE_ROOT;
+ path = loadso;
+ sourceTree = "";
};
FD8BD8180E27E25900B52CD5 /* dlopen */ = {
isa = PBXGroup;
@@ -734,6 +1031,7 @@
AA7558891595D55500BBD41B /* SDL_revision.h */,
AA75588A1595D55500BBD41B /* SDL_rwops.h */,
AA75588B1595D55500BBD41B /* SDL_scancode.h */,
+ F30D9C98212CD0360047DF2E /* SDL_sensor.h */,
AA75588C1595D55500BBD41B /* SDL_shape.h */,
AA75588D1595D55500BBD41B /* SDL_stdinc.h */,
AA75588E1595D55500BBD41B /* SDL_surface.h */,
@@ -745,6 +1043,7 @@
AA7558941595D55500BBD41B /* SDL_types.h */,
AA7558951595D55500BBD41B /* SDL_version.h */,
AA7558961595D55500BBD41B /* SDL_video.h */,
+ 4D7516FE1EE1C5B400820EEA /* SDL_vulkan.h */,
);
name = "Public Headers";
path = ../../include;
@@ -761,10 +1060,12 @@
FD99B99D0DD52EDC00FB1D6B /* file */,
56C181E017C44D6900406AE3 /* filesystem */,
047677B60EA769DF008ABAF1 /* haptic */,
+ F35CEA6E20F51B7F003ECE98 /* hidapi */,
FD5F9D080E0E08B3008E885B /* joystick */,
FD8BD8150E27E25900B52CD5 /* loadso */,
56ED04DE118A8E9A00A56AA6 /* power */,
041B2CE312FA0F680087D585 /* render */,
+ F30D9C9A212CD0590047DF2E /* sensor */,
FD3F4A6F0DEA620800C5B771 /* stdlib */,
FD99B9E00DD52EDC00FB1D6B /* thread */,
FD99BA1E0DD52EDC00FB1D6B /* timer */,
@@ -772,6 +1073,8 @@
56A6702D18565E450007D20F /* SDL_internal.h */,
04F2AF551104ABD200D6DDF7 /* SDL_assert.c */,
04BAC09A1300C1290055DE28 /* SDL_assert_c.h */,
+ 566726431DF72CF5001DD3DB /* SDL_dataqueue.c */,
+ 566726441DF72CF5001DD3DB /* SDL_dataqueue.h */,
FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */,
FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */,
0442EC5412FE1C3F004C9285 /* SDL_hints.c */,
@@ -779,6 +1082,7 @@
FD99B9D80DD52EDC00FB1D6B /* SDL.c */,
);
name = "Library Source";
+ path = ../../src;
sourceTree = "";
};
FD99B8FB0DD52EDC00FB1D6B /* audio */ = {
@@ -789,15 +1093,13 @@
FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */,
FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */,
FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */,
- FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */,
FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */,
FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */,
FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */,
FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */,
FD99B9540DD52EDC00FB1D6B /* SDL_wave.h */,
);
- name = audio;
- path = ../../src/audio;
+ path = audio;
sourceTree = "";
};
FD99B91C0DD52EDC00FB1D6B /* dummy */ = {
@@ -814,8 +1116,7 @@
children = (
FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */,
);
- name = cpuinfo;
- path = ../../src/cpuinfo;
+ path = cpuinfo;
sourceTree = "";
};
FD99B98C0DD52EDC00FB1D6B /* events */ = {
@@ -828,6 +1129,8 @@
FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */,
0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */,
0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */,
+ A7C19D27212E552B00DF2152 /* SDL_displayevents_c.h */,
+ A7C19D28212E552B00DF2152 /* SDL_displayevents.c */,
AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */,
AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */,
FD99B9930DD52EDC00FB1D6B /* SDL_events.c */,
@@ -845,8 +1148,7 @@
FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */,
FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */,
);
- name = events;
- path = ../../src/events;
+ path = events;
sourceTree = "";
};
FD99B99D0DD52EDC00FB1D6B /* file */ = {
@@ -855,8 +1157,7 @@
006E9885119552DD001DE610 /* cocoa */,
FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */,
);
- name = file;
- path = ../../src/file;
+ path = file;
sourceTree = "";
};
FD99B9E00DD52EDC00FB1D6B /* thread */ = {
@@ -867,8 +1168,7 @@
FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */,
FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */,
);
- name = thread;
- path = ../../src/thread;
+ path = thread;
sourceTree = "";
};
FD99BA060DD52EDC00FB1D6B /* pthread */ = {
@@ -892,8 +1192,7 @@
FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */,
FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */,
);
- name = timer;
- path = ../../src/timer;
+ path = timer;
sourceTree = "";
};
FD99BA300DD52EDC00FB1D6B /* unix */ = {
@@ -907,10 +1206,9 @@
FDA682420DF2374D00F98A1A /* video */ = {
isa = PBXGroup;
children = (
- FD689F090E26E5D900F90B21 /* uikit */,
FDA685F40DF244C800F98A1A /* dummy */,
- FDA683000DF2374E00F98A1A /* SDL_blit.c */,
- FDA683010DF2374E00F98A1A /* SDL_blit.h */,
+ FD689F090E26E5D900F90B21 /* uikit */,
+ AA13B3521FB8B41700D9FEE6 /* yuv2rgb */,
FDA683020DF2374E00F98A1A /* SDL_blit_0.c */,
FDA683030DF2374E00F98A1A /* SDL_blit_1.c */,
FDA683040DF2374E00F98A1A /* SDL_blit_A.c */,
@@ -921,22 +1219,32 @@
FDA683090DF2374E00F98A1A /* SDL_blit_N.c */,
FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */,
0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */,
+ FDA683000DF2374E00F98A1A /* SDL_blit.c */,
+ FDA683010DF2374E00F98A1A /* SDL_blit.h */,
FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */,
044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
+ AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */,
+ AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */,
0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */,
- FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */,
+ FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
+ AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */,
FDA683110DF2374E00F98A1A /* SDL_rect.c */,
- FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */,
FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */,
+ FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */,
+ AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */,
+ AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */,
FDA683170DF2374E00F98A1A /* SDL_stretch.c */,
FDA683190DF2374E00F98A1A /* SDL_surface.c */,
FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */,
FDA6831B0DF2374E00F98A1A /* SDL_video.c */,
+ 4D75171D1EE1D98200820EEA /* SDL_vulkan_internal.h */,
+ 4D75171E1EE1D98200820EEA /* SDL_vulkan_utils.c */,
+ AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */,
+ AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */,
);
- name = video;
- path = ../../src/video;
- sourceTree = SOURCE_ROOT;
+ path = video;
+ sourceTree = "";
};
FDA685F40DF244C800F98A1A /* dummy */ = {
isa = PBXGroup;
@@ -959,6 +1267,8 @@
buildActionMask = 2147483647;
files = (
FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */,
+ 4D75171A1EE1D32200820EEA /* SDL_uikitmetalview.h in Headers */,
+ 4D75171F1EE1D98200820EEA /* SDL_vulkan_internal.h in Headers */,
FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */,
FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */,
FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */,
@@ -977,23 +1287,29 @@
56A6703818565E760007D20F /* SDL_dynapi.h in Headers */,
FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */,
56A6703518565E760007D20F /* SDL_dynapi_overrides.h in Headers */,
+ AA13B3571FB8B46400D9FEE6 /* yuv_rgb_std_func.h in Headers */,
047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */,
046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */,
006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
+ AA13B34C1FB8B27800D9FEE6 /* SDL_rect_c.h in Headers */,
+ AA13B3581FB8B46400D9FEE6 /* yuv_rgb_sse_func.h in Headers */,
04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */,
04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */,
041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */,
- 04409BA612FA989600FB9AA8 /* mmx.h in Headers */,
04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
+ AA13B3591FB8B46400D9FEE6 /* yuv_rgb.h in Headers */,
04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */,
04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */,
+ F3BDD79B20F51CB8004ECBF3 /* SDL_hidapijoystick_c.h in Headers */,
04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */,
04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */,
04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */,
+ AA13B34E1FB8B27800D9FEE6 /* SDL_yuv_c.h in Headers */,
04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */,
04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */,
+ FA1DC2721C62BE65008F99A0 /* SDL_uikitclipboard.h in Headers */,
0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */,
04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */,
56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */,
@@ -1004,11 +1320,14 @@
AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */,
AA75589B1595D55500BBD41B /* SDL_atomic.h in Headers */,
AA75589C1595D55500BBD41B /* SDL_audio.h in Headers */,
+ 55FFA91A2122302B00D7CBED /* SDL_syspower.h in Headers */,
AA75589D1595D55500BBD41B /* SDL_blendmode.h in Headers */,
+ F30D9C9E212CD0990047DF2E /* SDL_sensor_c.h in Headers */,
AA75589E1595D55500BBD41B /* SDL_clipboard.h in Headers */,
AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */,
AA7558A01595D55500BBD41B /* SDL_config.h in Headers */,
AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */,
+ AA13B3491FB8B27800D9FEE6 /* SDL_egl_c.h in Headers */,
AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */,
AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */,
AA7558A41595D55500BBD41B /* SDL_error.h in Headers */,
@@ -1017,17 +1336,24 @@
AA7558A61595D55500BBD41B /* SDL_gesture.h in Headers */,
AA7558A71595D55500BBD41B /* SDL_haptic.h in Headers */,
AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */,
+ 566726461DF72CF5001DD3DB /* SDL_dataqueue.h in Headers */,
+ F30D9C9F212CD0990047DF2E /* SDL_syssensor.h in Headers */,
AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */,
+ AA13B34B1FB8B27800D9FEE6 /* SDL_shape_internals.h in Headers */,
AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */,
+ A704172E20F7E74800A82227 /* controller_type.h in Headers */,
AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */,
AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */,
AA7558AE1595D55500BBD41B /* SDL_log.h in Headers */,
+ F30D9CA7212CD0BF0047DF2E /* SDL_coremotionsensor.h in Headers */,
AA7558AF1595D55500BBD41B /* SDL_main.h in Headers */,
AA7558B01595D55500BBD41B /* SDL_mouse.h in Headers */,
+ A7C19D29212E552C00DF2152 /* SDL_displayevents_c.h in Headers */,
AA7558B11595D55500BBD41B /* SDL_mutex.h in Headers */,
AA7558B21595D55500BBD41B /* SDL_name.h in Headers */,
AA7558B31595D55500BBD41B /* SDL_opengl.h in Headers */,
AA7558B41595D55500BBD41B /* SDL_opengles.h in Headers */,
+ AADC5A631FDA10C800960936 /* SDL_shaders_metal_ios.h in Headers */,
AA7558B51595D55500BBD41B /* SDL_opengles2.h in Headers */,
AA7558B61595D55500BBD41B /* SDL_pixels.h in Headers */,
AA7558B71595D55500BBD41B /* SDL_platform.h in Headers */,
@@ -1043,19 +1369,23 @@
FAD4F7021BA3C4E8008346CE /* SDL_sysjoystick_c.h in Headers */,
AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */,
AA7558C21595D55500BBD41B /* SDL_system.h in Headers */,
+ F30D9C99212CD0360047DF2E /* SDL_sensor.h in Headers */,
AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */,
AA7558C41595D55500BBD41B /* SDL_thread.h in Headers */,
AA7558C51595D55500BBD41B /* SDL_timer.h in Headers */,
AA7558C61595D55500BBD41B /* SDL_touch.h in Headers */,
AA7558C71595D55500BBD41B /* SDL_types.h in Headers */,
AA7558C81595D55500BBD41B /* SDL_version.h in Headers */,
+ 4D7516FF1EE1C5B400820EEA /* SDL_vulkan.h in Headers */,
AA7558C91595D55500BBD41B /* SDL_video.h in Headers */,
AA7558CA1595D55500BBD41B /* SDL.h in Headers */,
+ 4D7516FC1EE1C28A00820EEA /* SDL_uikitvulkan.h in Headers */,
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */,
AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */,
AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */,
AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */,
AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */,
+ F36839CC214790950000F255 /* SDL_dummysensor.h in Headers */,
AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */,
56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */,
);
@@ -1064,9 +1394,24 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
- FD6526620DE8FCCB002AD96B /* libSDL */ = {
+ FAB598131BB5C1B100BE72C5 /* libSDL-tvOS */ = {
isa = PBXNativeTarget;
- buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */;
+ buildConfigurationList = FAB5981A1BB5C1B100BE72C5 /* Build configuration list for PBXNativeTarget "libSDL-tvOS" */;
+ buildPhases = (
+ FAB598101BB5C1B100BE72C5 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "libSDL-tvOS";
+ productName = "libSDL-tvOS";
+ productReference = FAB598141BB5C1B100BE72C5 /* libSDL2.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ FD6526620DE8FCCB002AD96B /* libSDL-iOS */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL-iOS" */;
buildPhases = (
FD65265F0DE8FCCB002AD96B /* Headers */,
FD6526600DE8FCCB002AD96B /* Sources */,
@@ -1075,7 +1420,7 @@
);
dependencies = (
);
- name = libSDL;
+ name = "libSDL-iOS";
productName = iPhoneSDLStaticLib;
productReference = FD6526630DE8FCCB002AD96B /* libSDL2.a */;
productType = "com.apple.product-type.library.static";
@@ -1086,7 +1431,19 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0630;
+ LastUpgradeCheck = 0900;
+ TargetAttributes = {
+ 00B4F48B12F6A69C0084EC00 = {
+ DevelopmentTeam = UZ5V327NE3;
+ };
+ FAB598131BB5C1B100BE72C5 = {
+ CreatedOnToolsVersion = 7.1;
+ DevelopmentTeam = UZ5V327NE3;
+ };
+ FD6526620DE8FCCB002AD96B = {
+ DevelopmentTeam = UZ5V327NE3;
+ };
+ };
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */;
compatibilityVersion = "Xcode 3.2";
@@ -1102,8 +1459,11 @@
projectDirPath = "";
projectRoot = ../..;
targets = (
- FD6526620DE8FCCB002AD96B /* libSDL */,
+ FD6526620DE8FCCB002AD96B /* libSDL-iOS */,
+ FAB598131BB5C1B100BE72C5 /* libSDL-tvOS */,
00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */,
+ C143576D1F4C4DAA000B792B /* All-iOS */,
+ C14357721F4C4F2A000B792B /* All-tvOS */,
);
};
/* End PBXProject section */
@@ -1123,15 +1483,164 @@
shellPath = /bin/sh;
shellScript = "# clean up the framework, remove headers, extra files\n\ntemp=$BUILD_DIR/$BUILD_STYLE-template\n# Wrong! 1. Can't assume location of Xcode directory (use xcode-select)\n# 2. Project templates should go in Application Support directories anyway.\ntemplate_dir_name=\"SDL iOS Application\"\n# dest=\"$(HOME)/Library/Application Support/Developer/Shared/Xcode/Project Templates/SDL/SDL iOS Application\"\nrsync_flags=\"--exclude *.svn --links -r\"\n\n# mkdir -p $dest\nmkdir -p $temp\nmkdir -p \"$temp/$template_dir_name/SDL/lib/\"\nmkdir -p \"$temp/$template_dir_name/SDL/include\"\n\n# copy template\nrsync $rsync_flags \"../template/$template_dir_name\" $temp/\n\n# copy Universal libSDL.a\nrsync $rsync_flags -r $SYMROOT/$CONFIGURATION-Universal/libSDL.a \"$temp/$template_dir_name/SDL/lib/\"\n\n# copy headers\nrsync $rsync_flags ../../include/ \"$temp/$template_dir_name/SDL/include\"\n\n#install (nah, don't install)\n# cp -fr \"$temp/$template_dir_name\" \"$dest\"";
};
+ C14357711F4C4DB2000B792B /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ output/iOS/debug/libSDL2.a,
+ output/iOS/release/libSDL2.a,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "TARGET=libSDL-iOS\nOUTPUT=libSDL2.a\n\nxcodebuild -target \"$TARGET\" -configuration Debug -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" -configuration Release -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" ONLY_ACTIVE_ARCH=NO -configuration Debug -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\n\n# make output folders\nmkdir -p output/iOS/debug\nmkdir -p output/iOS/release\n\n# combine lib files for various platforms into one\necho \"Creating output/iOS/debug/$OUTPUT\"\nlipo -create \"${TARGET_BUILD_DIR}/../Debug-iphoneos/$OUTPUT\" \"${TARGET_BUILD_DIR}/../Debug-iphonesimulator/$OUTPUT\" -output \"output/iOS/debug/$OUTPUT\"\necho \"Creating output/iOS/release/$OUTPUT\"\nlipo -create \"${TARGET_BUILD_DIR}/../Release-iphoneos/$OUTPUT\" \"${TARGET_BUILD_DIR}/../Release-iphonesimulator/$OUTPUT\" -output \"output/iOS/release/$OUTPUT\"\n";
+ };
+ C14357731F4C4F2A000B792B /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ output/tvOS/debug/libSDL2.a,
+ output/tvOS/release/libSDL2.a,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "TARGET=libSDL-tvOS\nOUTPUT=libSDL2.a\n\nxcodebuild -target \"$TARGET\" -configuration Debug -sdk appletvsimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" -configuration Release -sdk appletvsimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" ONLY_ACTIVE_ARCH=NO -configuration Debug -sdk appletvos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"$TARGET\" ONLY_ACTIVE_ARCH=NO -configuration Release -sdk appletvos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\n\n# make output folders\nmkdir -p output/tvOS/debug\nmkdir -p output/tvOS/release\n\n# combine lib files for various platforms into one\necho \"Creating output/tvOS/debug/$OUTPUT\"\nlipo -create \"${TARGET_BUILD_DIR}/../Debug-appletvos/$OUTPUT\" \"${TARGET_BUILD_DIR}/../Debug-appletvsimulator/$OUTPUT\" -output \"output/tvOS/debug/$OUTPUT\"\necho \"Creating output/tvOS/release/$OUTPUT\"\nlipo -create \"${TARGET_BUILD_DIR}/../Release-appletvos/$OUTPUT\" \"${TARGET_BUILD_DIR}/../Release-appletvsimulator/$OUTPUT\" -output \"output/tvOS/release/$OUTPUT\"\n";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ FAB598101BB5C1B100BE72C5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */,
+ FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */,
+ FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */,
+ FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */,
+ FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */,
+ FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */,
+ FAB598271BB5C31500BE72C5 /* SDL_audiotypecvt.c in Sources */,
+ FAB598281BB5C31500BE72C5 /* SDL_mixer.c in Sources */,
+ F3BDD79720F51CB8004ECBF3 /* SDL_hidapi_xboxone.c in Sources */,
+ FAB5982A1BB5C31500BE72C5 /* SDL_wave.c in Sources */,
+ FAFDF8C61D88D4530083E6F2 /* SDL_uikitclipboard.m in Sources */,
+ FAB5982C1BB5C31500BE72C5 /* SDL_cpuinfo.c in Sources */,
+ FAB5982F1BB5C31500BE72C5 /* SDL_dynapi.c in Sources */,
+ FAB598361BB5C31500BE72C5 /* SDL_clipboardevents.c in Sources */,
+ FAB598381BB5C31500BE72C5 /* SDL_dropevents.c in Sources */,
+ FAB5983A1BB5C31500BE72C5 /* SDL_events.c in Sources */,
+ A7F629241FE06523002F9CC9 /* SDL_uikitmetalview.m in Sources */,
+ FAB5983C1BB5C31500BE72C5 /* SDL_gesture.c in Sources */,
+ FAB5983E1BB5C31500BE72C5 /* SDL_keyboard.c in Sources */,
+ F3BDD79520F51CB8004ECBF3 /* SDL_hidapi_switch.c in Sources */,
+ FAB598401BB5C31500BE72C5 /* SDL_mouse.c in Sources */,
+ A704172F20F7E76000A82227 /* SDL_gamecontroller.c in Sources */,
+ FAB598421BB5C31500BE72C5 /* SDL_quit.c in Sources */,
+ FAB598441BB5C31500BE72C5 /* SDL_touch.c in Sources */,
+ FAB598461BB5C31500BE72C5 /* SDL_windowevents.c in Sources */,
+ F30D9CC7212CE92C0047DF2E /* hid.m in Sources */,
+ FAB598491BB5C31600BE72C5 /* SDL_rwopsbundlesupport.m in Sources */,
+ FAB5984A1BB5C31600BE72C5 /* SDL_rwops.c in Sources */,
+ FAB5984B1BB5C31600BE72C5 /* SDL_sysfilesystem.m in Sources */,
+ AADC5A5D1FDA104400960936 /* yuv_rgb.c in Sources */,
+ FAB5984C1BB5C31600BE72C5 /* SDL_syshaptic.c in Sources */,
+ AADC5A5F1FDA105600960936 /* SDL_vulkan_utils.c in Sources */,
+ AADC5A5E1FDA105300960936 /* SDL_yuv.c in Sources */,
+ FAB5984D1BB5C31600BE72C5 /* SDL_haptic.c in Sources */,
+ F3BDD79320F51CB8004ECBF3 /* SDL_hidapi_xbox360.c in Sources */,
+ FAB598501BB5C31600BE72C5 /* SDL_sysjoystick.m in Sources */,
+ FAB598521BB5C31600BE72C5 /* SDL_joystick.c in Sources */,
+ FAB598551BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */,
+ AADC5A651FDA10CB00960936 /* SDL_render_metal.m in Sources */,
+ FAB598561BB5C31600BE72C5 /* SDL_sysloadso.c in Sources */,
+ FAB598571BB5C31600BE72C5 /* SDL_power.c in Sources */,
+ F30D9CA1212CD0990047DF2E /* SDL_sensor.c in Sources */,
+ FAB598581BB5C31600BE72C5 /* SDL_syspower.m in Sources */,
+ 56F9D5601DF73BA400C15B5D /* SDL_dataqueue.c in Sources */,
+ FAB598591BB5C31600BE72C5 /* SDL_render_gles.c in Sources */,
+ F30D9CA6212CD0BF0047DF2E /* SDL_coremotionsensor.m in Sources */,
+ FAB5985A1BB5C31600BE72C5 /* SDL_render_gles2.c in Sources */,
+ FAB5985B1BB5C31600BE72C5 /* SDL_shaders_gles2.c in Sources */,
+ FAB5985D1BB5C31600BE72C5 /* SDL_blendfillrect.c in Sources */,
+ FAB5985F1BB5C31600BE72C5 /* SDL_blendline.c in Sources */,
+ FAB598611BB5C31600BE72C5 /* SDL_blendpoint.c in Sources */,
+ FAB598641BB5C31600BE72C5 /* SDL_drawline.c in Sources */,
+ FAB598661BB5C31600BE72C5 /* SDL_drawpoint.c in Sources */,
+ FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */,
+ FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */,
+ FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */,
+ FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */,
+ FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */,
+ FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */,
+ FAB598741BB5C31600BE72C5 /* SDL_malloc.c in Sources */,
+ FAB598751BB5C31600BE72C5 /* SDL_qsort.c in Sources */,
+ F36839CE214790950000F255 /* SDL_dummysensor.c in Sources */,
+ A7C19D2B212E552C00DF2152 /* SDL_displayevents.c in Sources */,
+ FAB598761BB5C31600BE72C5 /* SDL_stdlib.c in Sources */,
+ FAB598771BB5C31600BE72C5 /* SDL_string.c in Sources */,
+ FAB598781BB5C31600BE72C5 /* SDL_syscond.c in Sources */,
+ F3BDD79D20F51CB8004ECBF3 /* SDL_hidapijoystick.c in Sources */,
+ AADC5A601FDA10A400960936 /* SDL_uikitvulkan.m in Sources */,
+ FAB598791BB5C31600BE72C5 /* SDL_sysmutex.c in Sources */,
+ FAB5987B1BB5C31600BE72C5 /* SDL_syssem.c in Sources */,
+ FAB5987C1BB5C31600BE72C5 /* SDL_systhread.c in Sources */,
+ FAB5987E1BB5C31600BE72C5 /* SDL_systls.c in Sources */,
+ FAB598801BB5C31600BE72C5 /* SDL_thread.c in Sources */,
+ FAB598821BB5C31600BE72C5 /* SDL_systimer.c in Sources */,
+ FAB598831BB5C31600BE72C5 /* SDL_timer.c in Sources */,
+ FAB598871BB5C31600BE72C5 /* SDL_uikitappdelegate.m in Sources */,
+ F3BDD79920F51CB8004ECBF3 /* SDL_hidapi_ps4.c in Sources */,
+ FAB598891BB5C31600BE72C5 /* SDL_uikitevents.m in Sources */,
+ FAB5988B1BB5C31600BE72C5 /* SDL_uikitmessagebox.m in Sources */,
+ FAB5988D1BB5C31600BE72C5 /* SDL_uikitmodes.m in Sources */,
+ FAB5988F1BB5C31600BE72C5 /* SDL_uikitopengles.m in Sources */,
+ FAB598911BB5C31600BE72C5 /* SDL_uikitopenglview.m in Sources */,
+ FAB598931BB5C31600BE72C5 /* SDL_uikitvideo.m in Sources */,
+ FAB598951BB5C31600BE72C5 /* SDL_uikitview.m in Sources */,
+ FAB598971BB5C31600BE72C5 /* SDL_uikitviewcontroller.m in Sources */,
+ FAB598991BB5C31600BE72C5 /* SDL_uikitwindow.m in Sources */,
+ FAB5989A1BB5C31600BE72C5 /* SDL_nullevents.c in Sources */,
+ FAB5989D1BB5C31600BE72C5 /* SDL_nullframebuffer.c in Sources */,
+ FAB5989E1BB5C31600BE72C5 /* SDL_nullvideo.c in Sources */,
+ FAB598A01BB5C31600BE72C5 /* SDL_blit.c in Sources */,
+ FAB598A21BB5C31600BE72C5 /* SDL_blit_0.c in Sources */,
+ FAB598A31BB5C31600BE72C5 /* SDL_blit_1.c in Sources */,
+ FAB598A41BB5C31600BE72C5 /* SDL_blit_A.c in Sources */,
+ FAB598A51BB5C31600BE72C5 /* SDL_blit_auto.c in Sources */,
+ FAB598A71BB5C31600BE72C5 /* SDL_blit_copy.c in Sources */,
+ FAB598A91BB5C31600BE72C5 /* SDL_blit_N.c in Sources */,
+ FAB598AA1BB5C31600BE72C5 /* SDL_blit_slow.c in Sources */,
+ FAB598AC1BB5C31600BE72C5 /* SDL_bmp.c in Sources */,
+ FAB598AD1BB5C31600BE72C5 /* SDL_clipboard.c in Sources */,
+ FAB598AE1BB5C31600BE72C5 /* SDL_fillrect.c in Sources */,
+ FAB598AF1BB5C31600BE72C5 /* SDL_pixels.c in Sources */,
+ FAB598B11BB5C31600BE72C5 /* SDL_rect.c in Sources */,
+ FAB598B21BB5C31600BE72C5 /* SDL_RLEaccel.c in Sources */,
+ FAB598B41BB5C31600BE72C5 /* SDL_stretch.c in Sources */,
+ FAB598B51BB5C31600BE72C5 /* SDL_surface.c in Sources */,
+ FAB598B71BB5C31600BE72C5 /* SDL_video.c in Sources */,
+ FAB598B91BB5C31600BE72C5 /* SDL_assert.c in Sources */,
+ FAB598BC1BB5C31600BE72C5 /* SDL_error.c in Sources */,
+ FAB598BD1BB5C31600BE72C5 /* SDL_hints.c in Sources */,
+ FAB598BE1BB5C31600BE72C5 /* SDL_log.c in Sources */,
+ FAB598BF1BB5C31600BE72C5 /* SDL.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
FD6526600DE8FCCB002AD96B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FD6526810DE8FCDD002AD96B /* SDL_systimer.c in Sources */,
FD6526800DE8FCDD002AD96B /* SDL_timer.c in Sources */,
+ F30D9CA5212CD0BF0047DF2E /* SDL_coremotionsensor.m in Sources */,
FD3F4A7B0DEA620800C5B771 /* SDL_string.c in Sources */,
FD6526660DE8FCDD002AD96B /* SDL_dummyaudio.c in Sources */,
FD6526670DE8FCDD002AD96B /* SDL_audio.c in Sources */,
@@ -1139,6 +1648,8 @@
FD65266A0DE8FCDD002AD96B /* SDL_audiotypecvt.c in Sources */,
FD65266B0DE8FCDD002AD96B /* SDL_mixer.c in Sources */,
FD65266F0DE8FCDD002AD96B /* SDL_wave.c in Sources */,
+ 4D7516FD1EE1C28A00820EEA /* SDL_uikitvulkan.m in Sources */,
+ FA1DC2731C62BE65008F99A0 /* SDL_uikitclipboard.m in Sources */,
FD6526700DE8FCDD002AD96B /* SDL_cpuinfo.c in Sources */,
FD6526710DE8FCDD002AD96B /* SDL_events.c in Sources */,
FD6526720DE8FCDD002AD96B /* SDL_keyboard.c in Sources */,
@@ -1146,10 +1657,14 @@
FD6526730DE8FCDD002AD96B /* SDL_mouse.c in Sources */,
FD6526740DE8FCDD002AD96B /* SDL_quit.c in Sources */,
FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */,
+ 4D7516FB1EE1C28A00820EEA /* SDL_uikitmetalview.m in Sources */,
FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */,
+ F30D9CC6212CE92C0047DF2E /* hid.m in Sources */,
+ 4D7517201EE1D98200820EEA /* SDL_vulkan_utils.c in Sources */,
FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */,
FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */,
FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */,
+ AADC5A641FDA10C800960936 /* SDL_render_metal.m in Sources */,
FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */,
FD65267D0DE8FCDD002AD96B /* SDL_syssem.c in Sources */,
FD65267E0DE8FCDD002AD96B /* SDL_systhread.c in Sources */,
@@ -1157,11 +1672,15 @@
FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */,
FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */,
FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */,
+ F3BDD79220F51CB8004ECBF3 /* SDL_hidapi_xbox360.c in Sources */,
FD3F4A790DEA620800C5B771 /* SDL_qsort.c in Sources */,
+ F3BDD79820F51CB8004ECBF3 /* SDL_hidapi_ps4.c in Sources */,
FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */,
FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */,
FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */,
+ AA13B3501FB8B3CC00D9FEE6 /* SDL_yuv.c in Sources */,
FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */,
+ 566726451DF72CF5001DD3DB /* SDL_dataqueue.c in Sources */,
FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */,
FDA684520DF2374E00F98A1A /* SDL_blit_auto.c in Sources */,
FDA684540DF2374E00F98A1A /* SDL_blit_copy.c in Sources */,
@@ -1172,6 +1691,7 @@
FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */,
FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */,
FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */,
+ AA13B34D1FB8B27800D9FEE6 /* SDL_egl.c in Sources */,
FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */,
FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */,
FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */,
@@ -1179,18 +1699,22 @@
FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */,
FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */,
FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */,
+ AA13B35A1FB8B46400D9FEE6 /* yuv_rgb.c in Sources */,
FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */,
FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */,
FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */,
+ A7C19D2A212E552C00DF2152 /* SDL_displayevents.c in Sources */,
FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */,
FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */,
FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */,
FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */,
+ F3BDD79C20F51CB8004ECBF3 /* SDL_hidapijoystick.c in Sources */,
047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */,
047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */,
047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */,
046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */,
04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */,
+ F3BDD79620F51CB8004ECBF3 /* SDL_hidapi_xboxone.c in Sources */,
56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */,
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */,
006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
@@ -1201,7 +1725,6 @@
04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */,
04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */,
041B2CF112FA0F680087D585 /* SDL_render.c in Sources */,
- 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */,
04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */,
04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */,
04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */,
@@ -1212,10 +1735,14 @@
0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */,
0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */,
0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */,
+ AA13B34A1FB8B27800D9FEE6 /* SDL_shape.c in Sources */,
0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
+ F36839CD214790950000F255 /* SDL_dummysensor.c in Sources */,
0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
- 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */,
+ 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */,
+ F30D9CA0212CD0990047DF2E /* SDL_sensor.c in Sources */,
+ F3BDD79420F51CB8004ECBF3 /* SDL_hidapi_switch.c in Sources */,
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
@@ -1253,32 +1780,200 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
+ TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ };
+ name = Release;
+ };
+ C143576F1F4C4DAB000B792B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ C14357701F4C4DAB000B792B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ C14357751F4C4F2A000B792B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ENABLE_BITCODE = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ C14357761F4C4F2A000B792B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ENABLE_BITCODE = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ FAB5981B1BB5C1B100BE72C5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = SDL2;
+ SDKROOT = appletvos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 3;
+ };
+ name = Debug;
+ };
+ FAB5981C1BB5C1B100BE72C5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = SDL2;
+ SDKROOT = appletvos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 3;
+ VALIDATE_PRODUCT = YES;
};
name = Release;
};
FD6526640DE8FCCB002AD96B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
@@ -1286,6 +1981,7 @@
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
+ HEADER_SEARCH_PATHS = "$(VULKAN_SDK)/include";
PRODUCT_NAME = SDL2;
SKIP_INSTALL = YES;
};
@@ -1294,6 +1990,7 @@
FD6526650DE8FCCB002AD96B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
@@ -1301,6 +1998,7 @@
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
+ HEADER_SEARCH_PATHS = "$(VULKAN_SDK)/include";
PRODUCT_NAME = SDL2;
SKIP_INSTALL = YES;
};
@@ -1327,7 +2025,34 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */ = {
+ C143576E1F4C4DAB000B792B /* Build configuration list for PBXAggregateTarget "All-iOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C143576F1F4C4DAB000B792B /* Debug */,
+ C14357701F4C4DAB000B792B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C14357741F4C4F2A000B792B /* Build configuration list for PBXAggregateTarget "All-tvOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C14357751F4C4F2A000B792B /* Debug */,
+ C14357761F4C4F2A000B792B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FAB5981A1BB5C1B100BE72C5 /* Build configuration list for PBXNativeTarget "libSDL-tvOS" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FAB5981B1BB5C1B100BE72C5 /* Debug */,
+ FAB5981C1BB5C1B100BE72C5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL-iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FD6526640DE8FCCB002AD96B /* Debug */,
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj b/3rdparty/sdl2-2.0.9/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
similarity index 57%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
index adc3151925..8a6ef37c5a 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
@@ -21,24 +21,55 @@
AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
+ AAF030011F9009B100B9A9FB /* SDL_test_memory.c in Sources */ = {isa = PBXBuildFile; fileRef = AAF02FFF1F9009B100B9A9FB /* SDL_test_memory.c */; };
+ AAF030021F9009B100B9A9FB /* SDL_test_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = AAF030001F9009B100B9A9FB /* SDL_test_assert.c */; };
+ FA3D99011BC4E5BC002C96C8 /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE454176059AB0029C7A5 /* SDL_test_common.c */; };
+ FA3D99021BC4E5BC002C96C8 /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */; };
+ FA3D99031BC4E5BC002C96C8 /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */; };
+ FA3D99041BC4E5BC002C96C8 /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE457176059AB0029C7A5 /* SDL_test_font.c */; };
+ FA3D99051BC4E5BC002C96C8 /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */; };
+ FA3D99061BC4E5BC002C96C8 /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */; };
+ FA3D99071BC4E5BC002C96C8 /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */; };
+ FA3D99081BC4E5BC002C96C8 /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */; };
+ FA3D99091BC4E5BC002C96C8 /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */; };
+ FA3D990A1BC4E5BC002C96C8 /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */; };
+ FA3D990B1BC4E5BC002C96C8 /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */; };
+ FA3D990C1BC4E5BC002C96C8 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
+ FA3D990D1BC4E5BC002C96C8 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
+ FA3D990E1BC4E5BC002C96C8 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
/* End PBXBuildFile section */
+/* Begin PBXCopyFilesBuildPhase section */
+ FA3D98F61BC4E5A2002C96C8 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
/* Begin PBXFileReference section */
AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; };
- AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = ""; };
- AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = ""; };
- AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = ""; };
- AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = ""; };
- AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = ""; };
- AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = ""; };
- AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = ""; };
- AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = ""; };
- AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = ""; };
- AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = ""; };
- AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = ""; };
- AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = ""; };
- AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = ""; };
- AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = ""; };
+ AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_common.c; sourceTree = ""; };
+ AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_compare.c; sourceTree = ""; };
+ AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_crc32.c; sourceTree = ""; };
+ AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_font.c; sourceTree = ""; };
+ AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_fuzzer.c; sourceTree = ""; };
+ AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_harness.c; sourceTree = ""; };
+ AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlit.c; sourceTree = ""; };
+ AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlitBlend.c; sourceTree = ""; };
+ AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageFace.c; sourceTree = ""; };
+ AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitives.c; sourceTree = ""; };
+ AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitivesBlend.c; sourceTree = ""; };
+ AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_log.c; sourceTree = ""; };
+ AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_md5.c; sourceTree = ""; };
+ AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_random.c; sourceTree = ""; };
+ AAF02FFF1F9009B100B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_memory.c; sourceTree = ""; };
+ AAF030001F9009B100B9A9FB /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_assert.c; sourceTree = ""; };
+ FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libSDL2test-TV.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -49,6 +80,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA3D98F51BC4E5A2002C96C8 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -64,6 +102,7 @@
isa = PBXGroup;
children = (
AA1EE4461760589B0029C7A5 /* libSDL2test.a */,
+ FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */,
);
name = Products;
sourceTree = "";
@@ -71,6 +110,7 @@
AA1EE453176059770029C7A5 /* Library Source */ = {
isa = PBXGroup;
children = (
+ AAF030001F9009B100B9A9FB /* SDL_test_assert.c */,
AA1EE454176059AB0029C7A5 /* SDL_test_common.c */,
AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */,
AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */,
@@ -84,9 +124,11 @@
AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */,
AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */,
AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */,
+ AAF02FFF1F9009B100B9A9FB /* SDL_test_memory.c */,
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */,
);
name = "Library Source";
+ path = ../../src/test;
sourceTree = "";
};
/* End PBXGroup section */
@@ -119,6 +161,23 @@
productReference = AA1EE4461760589B0029C7A5 /* libSDL2test.a */;
productType = "com.apple.product-type.library.static";
};
+ FA3D98F71BC4E5A2002C96C8 /* SDL2test-TV */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FA3D99001BC4E5A3002C96C8 /* Build configuration list for PBXNativeTarget "SDL2test-TV" */;
+ buildPhases = (
+ FA3D98F41BC4E5A2002C96C8 /* Sources */,
+ FA3D98F51BC4E5A2002C96C8 /* Frameworks */,
+ FA3D98F61BC4E5A2002C96C8 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "SDL2test-TV";
+ productName = "SDL2test-TV";
+ productReference = FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */;
+ productType = "com.apple.product-type.library.static";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -127,6 +186,11 @@
attributes = {
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = "Sam Lantinga";
+ TargetAttributes = {
+ FA3D98F71BC4E5A2002C96C8 = {
+ CreatedOnToolsVersion = 7.1;
+ };
+ };
};
buildConfigurationList = AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */;
compatibilityVersion = "Xcode 3.2";
@@ -141,6 +205,7 @@
projectRoot = "";
targets = (
AA1EE4451760589B0029C7A5 /* SDL2test */,
+ FA3D98F71BC4E5A2002C96C8 /* SDL2test-TV */,
);
};
/* End PBXProject section */
@@ -155,18 +220,41 @@
AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */,
AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */,
AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */,
+ AAF030021F9009B100B9A9FB /* SDL_test_assert.c in Sources */,
AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */,
AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */,
AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */,
AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */,
AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */,
AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */,
+ AAF030011F9009B100B9A9FB /* SDL_test_memory.c in Sources */,
AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */,
AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */,
AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA3D98F41BC4E5A2002C96C8 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FA3D99011BC4E5BC002C96C8 /* SDL_test_common.c in Sources */,
+ FA3D99021BC4E5BC002C96C8 /* SDL_test_compare.c in Sources */,
+ FA3D99031BC4E5BC002C96C8 /* SDL_test_crc32.c in Sources */,
+ FA3D99041BC4E5BC002C96C8 /* SDL_test_font.c in Sources */,
+ FA3D99051BC4E5BC002C96C8 /* SDL_test_fuzzer.c in Sources */,
+ FA3D99061BC4E5BC002C96C8 /* SDL_test_harness.c in Sources */,
+ FA3D99071BC4E5BC002C96C8 /* SDL_test_imageBlit.c in Sources */,
+ FA3D99081BC4E5BC002C96C8 /* SDL_test_imageBlitBlend.c in Sources */,
+ FA3D99091BC4E5BC002C96C8 /* SDL_test_imageFace.c in Sources */,
+ FA3D990A1BC4E5BC002C96C8 /* SDL_test_imagePrimitives.c in Sources */,
+ FA3D990B1BC4E5BC002C96C8 /* SDL_test_imagePrimitivesBlend.c in Sources */,
+ FA3D990C1BC4E5BC002C96C8 /* SDL_test_log.c in Sources */,
+ FA3D990D1BC4E5BC002C96C8 /* SDL_test_md5.c in Sources */,
+ FA3D990E1BC4E5BC002C96C8 /* SDL_test_random.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
@@ -195,6 +283,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = ../../include;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -220,6 +309,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = ../../include;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = iphoneos;
};
@@ -229,7 +319,7 @@
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
- HEADER_SEARCH_PATHS = ../../include;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -238,11 +328,64 @@
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
- HEADER_SEARCH_PATHS = ../../include;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
+ FA3D98FE1BC4E5A3002C96C8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = appletvos;
+ SKIP_INSTALL = YES;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ };
+ name = Debug;
+ };
+ FA3D98FF1BC4E5A3002C96C8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = appletvos;
+ SKIP_INSTALL = YES;
+ TVOS_DEPLOYMENT_TARGET = 9.0;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -264,6 +407,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ FA3D99001BC4E5A3002C96C8 /* Build configuration list for PBXNativeTarget "SDL2test-TV" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FA3D98FE1BC4E5A3002C96C8 /* Debug */,
+ FA3D98FF1BC4E5A3002C96C8 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = AA1EE43E1760589B0029C7A5 /* Project object */;
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Default.png b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Default.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Default.png
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Default.png
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Icon.png b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Icon.png
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Icon.png
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Icon.png
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Info.plist b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Info.plist
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/Info.plist
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/Info.plist
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
old mode 100755
new mode 100644
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/main.c b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/main.c
similarity index 98%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/main.c
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/main.c
index 8dc00706f3..52fd9a49a9 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Template/SDL iOS Application/main.c
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Template/SDL iOS Application/main.c
@@ -5,6 +5,8 @@
*/
#include "SDL.h"
+#include
+#include
#include
#define SCREEN_WIDTH 320
@@ -20,6 +22,7 @@ void
render(SDL_Renderer *renderer)
{
+ SDL_Rect rect;
Uint8 r, g, b;
/* Clear the screen */
@@ -27,7 +30,6 @@ render(SDL_Renderer *renderer)
SDL_RenderClear(renderer);
/* Come up with a random rectangle */
- SDL_Rect rect;
rect.w = randomInt(64, 128);
rect.h = randomInt(64, 128);
rect.x = randomInt(0, SCREEN_WIDTH);
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/Info.plist b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/Info.plist
similarity index 94%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Test/Info.plist
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Test/Info.plist
index c0f1179d35..cd3c096dab 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/Info.plist
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/Info.plist
@@ -22,7 +22,5 @@
????
CFBundleVersion
1.0
- NSMainNibFile
-
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/README b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/README
similarity index 63%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Test/README
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Test/README
index b16ff7c0f9..b8d9ed3b41 100644
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/README
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/README
@@ -1,22 +1,11 @@
TestiPhoneOS.xcodeproj contains targets to compile many of the SDL test programs for iPhone OS. Most of these test programs work fine, with the following exceptions:
-testalpha:
- Program crashes. Problem appears to effect Mac OS X as well.
-
testthread:
SIGTERM kills the process immediately without executing the 'kill' function. The posix standard says this shouldn't happen. Apple seems intent on having iPhone apps exit promptly when the user requests it, so maybe that's why(?)
testlock:
Locks appear to work, but there doesn't appear to be a simple way to send the process SIGINT.
-testpalette:
- "SDL error: blitting boat: Blit combination not supported." Happens on Mac OS X as well.
-
testsprite2:
SDL_CreateTextureFromSurface requests an ARGB pixel format, but iPhone's SDL video driver only supports ABGR.
-testwin:
- Behaves as it does under Mac OS X ... not sure if that is correctly or not.
-
-threadwin:
- Works if -threaded is not on. Otherwise it doesn't work, but this is true under Mac OS X as well.
diff --git a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
old mode 100755
new mode 100644
similarity index 77%
rename from 3rdparty/sdl2-2.0.4/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
rename to 3rdparty/sdl2-2.0.9/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
index 6b13cad139..978833d0ea
--- a/3rdparty/sdl2-2.0.4/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
+++ b/3rdparty/sdl2-2.0.9/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
@@ -36,6 +36,22 @@
56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
56ED0511118A904200A56AA6 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED0510118A904200A56AA6 /* testpower.c */; };
+ AA13B3171FB8AEBC00D9FEE6 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ AA13B3181FB8AEBC00D9FEE6 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
+ AA13B3191FB8AEBC00D9FEE6 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
+ AA13B31A1FB8AEBC00D9FEE6 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
+ AA13B31B1FB8AEBC00D9FEE6 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
+ AA13B31C1FB8AEBC00D9FEE6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
+ AA13B31D1FB8AEBC00D9FEE6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
+ AA13B31E1FB8AEBC00D9FEE6 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
+ AA13B31F1FB8AEBC00D9FEE6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
+ AA13B3201FB8AEBC00D9FEE6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
+ AA13B3211FB8AEBC00D9FEE6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
+ AA13B3221FB8AEBC00D9FEE6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
+ AA13B32F1FB8AF0C00D9FEE6 /* testyuv.bmp in Resources */ = {isa = PBXBuildFile; fileRef = AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */; };
+ AA13B3301FB8AF2300D9FEE6 /* testyuv.bmp in Resources */ = {isa = PBXBuildFile; fileRef = AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */; };
+ AA13B35D1FB8B4E200D9FEE6 /* testyuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */; };
+ AA13B3611FB8B52500D9FEE6 /* testyuv_cvt.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */; };
AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
@@ -43,6 +59,9 @@
AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
+ AA2F57AA1FDB544800832AD7 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA2F57A91FDB544800832AD7 /* Metal.framework */; };
+ AA2F57AB1FDB5A0900832AD7 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA2F57A91FDB544800832AD7 /* Metal.framework */; };
+ AA2F57AC1FDB5AB600832AD7 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA2F57A91FDB544800832AD7 /* Metal.framework */; };
AAE7DEDC14CBB1E100DF1A0E /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
@@ -65,7 +84,19 @@
AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */; };
- FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; settings = {ASSET_TAGS = (); }; };
+ FA0EF22E1BAF4654000E07A6 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; };
+ FA3D99481BC4E6AD002C96C8 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
+ FA3D994A1BC4E6AD002C96C8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
+ FA3D994B1BC4E6AD002C96C8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
+ FA3D994C1BC4E6AD002C96C8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
+ FA3D994D1BC4E6AD002C96C8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
+ FA3D994E1BC4E6AD002C96C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
+ FA3D994F1BC4E6AD002C96C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
+ FA3D99501BC4E6AD002C96C8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
+ FA3D99521BC4E70C002C96C8 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; };
+ FA3D99531BC4E70E002C96C8 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; };
+ FA3D99541BC4E70F002C96C8 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; };
+ FA3D99551BC4E712002C96C8 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
FA684F7B1BAF1A4400DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
FA684F7F1BAF1A4D00DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
FA684F801BAF1A5000DCFD1A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
@@ -112,6 +143,58 @@
FA8B4BDF196766F100F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
FA8B4BE0196766F400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
FA8B4BE1196766F600F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
+ FAA8CEE41BDF06D600D3BD45 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA3D992B1BC4E619002C96C8 /* libSDL2.a */; };
+ FABA34771D8B4EAD00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34831D8B575200915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34841D8B575200915323 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
+ FABA34851D8B575200915323 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
+ FABA34861D8B575200915323 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
+ FABA34871D8B575200915323 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
+ FABA34881D8B575200915323 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
+ FABA34891D8B575200915323 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
+ FABA348A1D8B575200915323 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
+ FABA348B1D8B575200915323 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
+ FABA348C1D8B575200915323 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
+ FABA348D1D8B575200915323 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
+ FABA34941D8B578200915323 /* testaudiocapture.c in Sources */ = {isa = PBXBuildFile; fileRef = FABA34931D8B578200915323 /* testaudiocapture.c */; };
+ FABA34951D8B578600915323 /* testaudiocapture.c in Sources */ = {isa = PBXBuildFile; fileRef = FABA34931D8B578200915323 /* testaudiocapture.c */; };
+ FABA34981D8B582100915323 /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAE20E2D33C600EA573E /* sample.wav */; };
+ FABA349A1D8B582100915323 /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A78B0E2D0F3D00EA573E /* loopwave.c */; };
+ FABA349C1D8B582100915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA349D1D8B582100915323 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
+ FABA349E1D8B582100915323 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
+ FABA349F1D8B582100915323 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
+ FABA34A01D8B582100915323 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
+ FABA34A11D8B582100915323 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
+ FABA34A21D8B582100915323 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
+ FABA34A31D8B582100915323 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
+ FABA34A41D8B582100915323 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
+ FABA34A51D8B582100915323 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
+ FABA34A61D8B582100915323 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
+ FABA34AE1D8B58B200915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34AF1D8B59F800915323 /* testaudiocapture.c in Sources */ = {isa = PBXBuildFile; fileRef = FABA34931D8B578200915323 /* testaudiocapture.c */; };
+ FABA34B01D8B5B6400915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B11D8B5B6C00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B21D8B5B7300915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B31D8B5B7800915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B41D8B5B7C00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B51D8B5B8400915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B61D8B5B8900915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B71D8B5B8D00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B81D8B5B9200915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34B91D8B5B9600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BA1D8B5B9B00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BB1D8B5BA100915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BC1D8B5BA600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BD1D8B5BAB00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BE1D8B5BB000915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34BF1D8B5BB500915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C01D8B5BBA00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C11D8B5BBE00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C21D8B5BC200915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C31D8B5BC600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C41D8B5BCB00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ FABA34C51D8B5BD000915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
FAE0E9821BAF9B230098DFA4 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
FAE0E9861BAF9B230098DFA4 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
FAE0E9871BAF9B230098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
@@ -123,10 +206,10 @@
FAE0E98D1BAF9B230098DFA4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
FAE0E98E1BAF9B230098DFA4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
FAE0E98F1BAF9B230098DFA4 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
- FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; settings = {ASSET_TAGS = (); }; };
- FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; settings = {ASSET_TAGS = (); }; };
- FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; settings = {ASSET_TAGS = (); }; };
- FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; settings = {ASSET_TAGS = (); }; };
+ FAE0E9951BAF9B510098DFA4 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */; };
+ FAE0E9961BAF9B650098DFA4 /* controllermap.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */; };
+ FAE0E9971BAF9B6A0098DFA4 /* button.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2291BAF4487000E07A6 /* button.bmp */; };
+ FAE0E9981BAF9B6E0098DFA4 /* axis.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FA0EF2281BAF4487000E07A6 /* axis.bmp */; };
FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75F0E2D0F1600EA573E /* testwm2.c */; };
FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
@@ -304,6 +387,27 @@
remoteGlobalIDString = AA1EE4461760589B0029C7A5;
remoteInfo = SDL2test;
};
+ FA3D992A1BC4E619002C96C8 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FAB598141BB5C1B100BE72C5;
+ remoteInfo = "libSDL-tv";
+ };
+ FA3D992E1BC4E619002C96C8 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FA3D98F81BC4E5A2002C96C8;
+ remoteInfo = "SDL2test-TV";
+ };
+ FAA8CEE51BDF06DC00D3BD45 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = FAB598131BB5C1B100BE72C5;
+ remoteInfo = "libSDL-tv";
+ };
FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
@@ -315,42 +419,52 @@
/* Begin PBXFileReference section */
046CEF8613254F23007AD51D /* testgesture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgesture.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 046CEF8913254F63007AD51D /* testgesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = SOURCE_ROOT; };
+ 046CEF8913254F63007AD51D /* testgesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgesture.c; sourceTree = ""; };
047A63ED13285C3200CD7973 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 047A63F013285CD100CD7973 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; };
+ 047A63F013285CD100CD7973 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = checkkeys.c; sourceTree = ""; };
1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; };
56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
+ 56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testpower.c; sourceTree = ""; };
+ AA13B3261FB8AEBC00D9FEE6 /* testyuv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testyuv.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = testyuv.bmp; sourceTree = ""; };
+ AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testyuv.c; sourceTree = ""; };
+ AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testyuv_cvt.c; sourceTree = ""; };
AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL2test.xcodeproj; path = ../SDLtest/SDL2test.xcodeproj; sourceTree = ""; };
+ AA2F57A91FDB544800832AD7 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
AAE7DEEC14CBB1E100DF1A0E /* testscale.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; };
- AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = ""; };
+ AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testscale.c; sourceTree = ""; };
AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; };
- AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = ""; };
- FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgamecontroller.c; path = ../../test/testgamecontroller.c; sourceTree = ""; };
- FA0EF2281BAF4487000E07A6 /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = axis.bmp; path = ../../test/axis.bmp; sourceTree = ""; };
- FA0EF2291BAF4487000E07A6 /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = button.bmp; path = ../../test/button.bmp; sourceTree = ""; };
- FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = controllermap.bmp; path = ../../test/controllermap.bmp; sourceTree = ""; };
+ AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testrendertarget.c; sourceTree = ""; };
+ FA0EF2221BAF43DE000E07A6 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgamecontroller.c; sourceTree = ""; };
+ FA0EF2281BAF4487000E07A6 /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = axis.bmp; sourceTree = ""; };
+ FA0EF2291BAF4487000E07A6 /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = button.bmp; sourceTree = ""; };
+ FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = controllermap.bmp; sourceTree = ""; };
+ FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "testgamecontroller-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FA684F7A1BAF1A4400DCFD1A /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
+ FABA34761D8B4EAD00915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ FABA34911D8B575200915323 /* testaudiocapture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testaudiocapture.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ FABA34931D8B578200915323 /* testaudiocapture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testaudiocapture.c; sourceTree = ""; };
+ FABA34AA1D8B582100915323 /* loopwav-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "loopwav-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamecontroller.app; sourceTree = BUILT_PRODUCTS_DIR; };
FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
- FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; };
- FDA8A7470E2D0F1600EA573E /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; };
- FDA8A7480E2D0F1600EA573E /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; };
- FDA8A74C0E2D0F1600EA573E /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; };
- FDA8A74D0E2D0F1600EA573E /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; };
- FDA8A74E0E2D0F1600EA573E /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; };
- FDA8A74F0E2D0F1600EA573E /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; };
- FDA8A7510E2D0F1600EA573E /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; };
- FDA8A7540E2D0F1600EA573E /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; };
- FDA8A7560E2D0F1600EA573E /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; };
- FDA8A7570E2D0F1600EA573E /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; };
- FDA8A7590E2D0F1600EA573E /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; };
- FDA8A75A0E2D0F1600EA573E /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; };
- FDA8A75B0E2D0F1600EA573E /* testver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; };
- FDA8A75F0E2D0F1600EA573E /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; };
- FDA8A7610E2D0F1600EA573E /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; };
- FDA8A78B0E2D0F3D00EA573E /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; };
+ FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testaudioinfo.c; sourceTree = ""; };
+ FDA8A7470E2D0F1600EA573E /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testerror.c; sourceTree = ""; };
+ FDA8A7480E2D0F1600EA573E /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testfile.c; sourceTree = ""; };
+ FDA8A74C0E2D0F1600EA573E /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testthread.c; sourceTree = ""; };
+ FDA8A74D0E2D0F1600EA573E /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testiconv.c; sourceTree = ""; };
+ FDA8A74E0E2D0F1600EA573E /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testjoystick.c; sourceTree = ""; };
+ FDA8A74F0E2D0F1600EA573E /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testkeys.c; sourceTree = ""; };
+ FDA8A7510E2D0F1600EA573E /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testlock.c; sourceTree = ""; };
+ FDA8A7540E2D0F1600EA573E /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testoverlay2.c; sourceTree = ""; };
+ FDA8A7560E2D0F1600EA573E /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testplatform.c; sourceTree = ""; };
+ FDA8A7570E2D0F1600EA573E /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testsem.c; sourceTree = ""; };
+ FDA8A7590E2D0F1600EA573E /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testsprite2.c; sourceTree = ""; };
+ FDA8A75A0E2D0F1600EA573E /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testtimer.c; sourceTree = ""; };
+ FDA8A75B0E2D0F1600EA573E /* testver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testver.c; sourceTree = ""; };
+ FDA8A75F0E2D0F1600EA573E /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testwm2.c; sourceTree = ""; };
+ FDA8A7610E2D0F1600EA573E /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = torturethread.c; sourceTree = ""; };
+ FDA8A78B0E2D0F3D00EA573E /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = loopwave.c; sourceTree = ""; };
FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
FDA8A8990E2D111A00EA573E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
@@ -359,21 +473,21 @@
FDA8A89D0E2D111A00EA573E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
FDA8AABB0E2D330F00EA573E /* loopwav.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwav.app; sourceTree = BUILT_PRODUCTS_DIR; };
- FDA8AAD90E2D33B000EA573E /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
- FDA8AADA0E2D33BA00EA573E /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
- FDA8AADB0E2D33BA00EA573E /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
- FDA8AADE0E2D33C100EA573E /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
- FDA8AAE20E2D33C600EA573E /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
+ FDA8AAD90E2D33B000EA573E /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = icon.bmp; sourceTree = ""; };
+ FDA8AADA0E2D33BA00EA573E /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = moose.dat; sourceTree = ""; };
+ FDA8AADB0E2D33BA00EA573E /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = picture.xbm; sourceTree = ""; };
+ FDA8AADE0E2D33C100EA573E /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = sample.bmp; sourceTree = ""; };
+ FDA8AAE20E2D33C600EA573E /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = sample.wav; sourceTree = ""; };
FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testaudioinfo.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDAAC59B0E2D5429001DB1D8 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDAAC5C90E2D55B5001DB1D8 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDAAC6260E2D5914001DB1D8 /* testgles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgles.app; sourceTree = BUILT_PRODUCTS_DIR; };
- FDAAC6290E2D5960001DB1D8 /* testgles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = SOURCE_ROOT; };
+ FDAAC6290E2D5960001DB1D8 /* testgles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgles.c; sourceTree = ""; };
FDC430000F0D866D009C87E1 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
- FDC430090F0D86BF009C87E1 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; };
+ FDC430090F0D86BF009C87E1 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testdraw2.c; sourceTree = ""; };
FDD2C10A0E2E4F4B00B7A85F /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDD2C1810E2E52C000B7A85F /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; };
- FDD2C18A0E2E52FE00B7A85F /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
+ FDD2C18A0E2E52FE00B7A85F /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = utf8.txt; sourceTree = ""; };
FDD2C1A50E2E534F00B7A85F /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDD2C45E0E2E773800B7A85F /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
FDD2C47C0E2E77D700B7A85F /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -390,6 +504,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B51D8B5B8400915323 /* AVFoundation.framework in Frameworks */,
046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */,
FA684F841BAF1A5C00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD1196766C900F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -407,6 +522,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B01D8B5B6400915323 /* AVFoundation.framework in Frameworks */,
AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */,
047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */,
FA684F7B1BAF1A4400DCFD1A /* GameController.framework in Frameworks */,
@@ -425,6 +541,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34C41D8B5BCB00915323 /* AVFoundation.framework in Frameworks */,
AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */,
FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */,
FA684F931BAF1A8A00DCFD1A /* GameController.framework in Frameworks */,
@@ -443,6 +560,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34BC1D8B5BA600915323 /* AVFoundation.framework in Frameworks */,
56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */,
FA684F8B1BAF1A7100DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD8196766DD00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -456,10 +574,30 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AA13B3161FB8AEBC00D9FEE6 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AA13B3171FB8AEBC00D9FEE6 /* AVFoundation.framework in Frameworks */,
+ AA13B3181FB8AEBC00D9FEE6 /* libSDL2test.a in Frameworks */,
+ AA13B3191FB8AEBC00D9FEE6 /* libSDL2.a in Frameworks */,
+ AA13B31A1FB8AEBC00D9FEE6 /* GameController.framework in Frameworks */,
+ AA13B31B1FB8AEBC00D9FEE6 /* CoreMotion.framework in Frameworks */,
+ AA13B31C1FB8AEBC00D9FEE6 /* AudioToolbox.framework in Frameworks */,
+ AA13B31D1FB8AEBC00D9FEE6 /* QuartzCore.framework in Frameworks */,
+ AA13B31E1FB8AEBC00D9FEE6 /* OpenGLES.framework in Frameworks */,
+ AA13B31F1FB8AEBC00D9FEE6 /* CoreGraphics.framework in Frameworks */,
+ AA13B3201FB8AEBC00D9FEE6 /* UIKit.framework in Frameworks */,
+ AA13B3211FB8AEBC00D9FEE6 /* Foundation.framework in Frameworks */,
+ AA13B3221FB8AEBC00D9FEE6 /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
AAE7DEE014CBB1E100DF1A0E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34BE1D8B5BB000915323 /* AVFoundation.framework in Frameworks */,
AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */,
AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */,
FA684F8D1BAF1A7800DCFD1A /* GameController.framework in Frameworks */,
@@ -478,6 +616,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ AA2F57AA1FDB544800832AD7 /* Metal.framework in Frameworks */,
+ FABA34BD1D8B5BAB00915323 /* AVFoundation.framework in Frameworks */,
AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */,
AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */,
FA684F8C1BAF1A7400DCFD1A /* GameController.framework in Frameworks */,
@@ -492,10 +632,63 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FA3D99311BC4E644002C96C8 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FAA8CEE41BDF06D600D3BD45 /* libSDL2.a in Frameworks */,
+ FA3D99481BC4E6AD002C96C8 /* GameController.framework in Frameworks */,
+ FA3D994A1BC4E6AD002C96C8 /* AudioToolbox.framework in Frameworks */,
+ FA3D994B1BC4E6AD002C96C8 /* QuartzCore.framework in Frameworks */,
+ FA3D994C1BC4E6AD002C96C8 /* OpenGLES.framework in Frameworks */,
+ FA3D994D1BC4E6AD002C96C8 /* CoreGraphics.framework in Frameworks */,
+ FA3D994E1BC4E6AD002C96C8 /* UIKit.framework in Frameworks */,
+ FA3D994F1BC4E6AD002C96C8 /* Foundation.framework in Frameworks */,
+ FA3D99501BC4E6AD002C96C8 /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FABA34821D8B575200915323 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FABA34831D8B575200915323 /* AVFoundation.framework in Frameworks */,
+ FABA34841D8B575200915323 /* libSDL2.a in Frameworks */,
+ FABA34851D8B575200915323 /* GameController.framework in Frameworks */,
+ FABA34861D8B575200915323 /* CoreMotion.framework in Frameworks */,
+ FABA34871D8B575200915323 /* AudioToolbox.framework in Frameworks */,
+ FABA34881D8B575200915323 /* QuartzCore.framework in Frameworks */,
+ FABA34891D8B575200915323 /* OpenGLES.framework in Frameworks */,
+ FABA348A1D8B575200915323 /* CoreGraphics.framework in Frameworks */,
+ FABA348B1D8B575200915323 /* UIKit.framework in Frameworks */,
+ FABA348C1D8B575200915323 /* Foundation.framework in Frameworks */,
+ FABA348D1D8B575200915323 /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FABA349B1D8B582100915323 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FABA349C1D8B582100915323 /* AVFoundation.framework in Frameworks */,
+ FABA349D1D8B582100915323 /* libSDL2.a in Frameworks */,
+ FABA349E1D8B582100915323 /* GameController.framework in Frameworks */,
+ FABA349F1D8B582100915323 /* CoreMotion.framework in Frameworks */,
+ FABA34A01D8B582100915323 /* AudioToolbox.framework in Frameworks */,
+ FABA34A11D8B582100915323 /* QuartzCore.framework in Frameworks */,
+ FABA34A21D8B582100915323 /* OpenGLES.framework in Frameworks */,
+ FABA34A31D8B582100915323 /* CoreGraphics.framework in Frameworks */,
+ FABA34A41D8B582100915323 /* UIKit.framework in Frameworks */,
+ FABA34A51D8B582100915323 /* Foundation.framework in Frameworks */,
+ FABA34A61D8B582100915323 /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
FAE0E9851BAF9B230098DFA4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34AE1D8B58B200915323 /* AVFoundation.framework in Frameworks */,
FAE0E9861BAF9B230098DFA4 /* libSDL2.a in Frameworks */,
FAE0E9871BAF9B230098DFA4 /* GameController.framework in Frameworks */,
FAE0E9881BAF9B230098DFA4 /* CoreMotion.framework in Frameworks */,
@@ -513,6 +706,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34771D8B4EAD00915323 /* AVFoundation.framework in Frameworks */,
FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */,
FA684F7F1BAF1A4D00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BC9196766BC00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -530,6 +724,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B11D8B5B6C00915323 /* AVFoundation.framework in Frameworks */,
FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */,
FA684F801BAF1A5000DCFD1A /* GameController.framework in Frameworks */,
FA8B4BCD196766BF00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -547,6 +742,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B31D8B5B7800915323 /* AVFoundation.framework in Frameworks */,
FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */,
FA684F821BAF1A5700DCFD1A /* GameController.framework in Frameworks */,
FA8B4BCF196766C400F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -564,6 +760,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B41D8B5B7C00915323 /* AVFoundation.framework in Frameworks */,
FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */,
FA684F831BAF1A5A00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD0196766C600F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -581,6 +778,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B61D8B5B8900915323 /* AVFoundation.framework in Frameworks */,
AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */,
FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */,
FA684F851BAF1A6000DCFD1A /* GameController.framework in Frameworks */,
@@ -599,6 +797,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ AA2F57AB1FDB5A0900832AD7 /* Metal.framework in Frameworks */,
+ FABA34B21D8B5B7300915323 /* AVFoundation.framework in Frameworks */,
AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */,
FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */,
FA684F811BAF1A5300DCFD1A /* GameController.framework in Frameworks */,
@@ -617,6 +817,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34C11D8B5BBE00915323 /* AVFoundation.framework in Frameworks */,
FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */,
FA684F901BAF1A8100DCFD1A /* GameController.framework in Frameworks */,
FA8B4BDD196766EB00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -634,6 +835,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B71D8B5B8D00915323 /* AVFoundation.framework in Frameworks */,
FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */,
FA684F861BAF1A6200DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD3196766CE00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -651,6 +853,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B81D8B5B9200915323 /* AVFoundation.framework in Frameworks */,
FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */,
FA684F871BAF1A6500DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD4196766D100F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -668,6 +871,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34B91D8B5B9600915323 /* AVFoundation.framework in Frameworks */,
FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */,
FA684F881BAF1A6800DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD5196766D400F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -685,6 +889,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34BA1D8B5B9B00915323 /* AVFoundation.framework in Frameworks */,
FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */,
FA684F891BAF1A6A00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD6196766D700F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -702,6 +907,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34BB1D8B5BA100915323 /* AVFoundation.framework in Frameworks */,
FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */,
FA684F8A1BAF1A6D00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BD7196766DA00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -719,6 +925,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34BF1D8B5BB500915323 /* AVFoundation.framework in Frameworks */,
FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */,
FA684F8E1BAF1A7B00DCFD1A /* GameController.framework in Frameworks */,
FA8B4BDB196766E500F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -736,6 +943,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ AA2F57AC1FDB5AB600832AD7 /* Metal.framework in Frameworks */,
+ FABA34C01D8B5BBA00915323 /* AVFoundation.framework in Frameworks */,
AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */,
FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */,
FA684F8F1BAF1A7E00DCFD1A /* GameController.framework in Frameworks */,
@@ -754,6 +963,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34C21D8B5BC200915323 /* AVFoundation.framework in Frameworks */,
FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */,
FA684F911BAF1A8400DCFD1A /* GameController.framework in Frameworks */,
FA8B4BDE196766EE00F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -771,6 +981,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34C31D8B5BC600915323 /* AVFoundation.framework in Frameworks */,
FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */,
FA684F921BAF1A8700DCFD1A /* GameController.framework in Frameworks */,
FA8B4BDF196766F100F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -788,6 +999,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ FABA34C51D8B5BD000915323 /* AVFoundation.framework in Frameworks */,
FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */,
FA684F941BAF1A9400DCFD1A /* GameController.framework in Frameworks */,
FA8B4BE1196766F600F8EB7C /* CoreMotion.framework in Frameworks */,
@@ -831,6 +1043,10 @@
AAE7DEEC14CBB1E100DF1A0E /* testscale.app */,
AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */,
FAE0E9931BAF9B230098DFA4 /* testgamecontroller.app */,
+ FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */,
+ FABA34911D8B575200915323 /* testaudiocapture.app */,
+ FABA34AA1D8B582100915323 /* loopwav-TV.app */,
+ AA13B3261FB8AEBC00D9FEE6 /* testyuv.app */,
);
name = Products;
sourceTree = "";
@@ -841,9 +1057,10 @@
AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */,
FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */,
FDA8AAD60E2D339A00EA573E /* Resources */,
- FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */,
+ FDA8A7C30E2D10FA00EA573E /* Frameworks */,
FDA8A73B0E2D0F0400EA573E /* src */,
19C28FACFE9D520D11CA2CBB /* Products */,
+ FABA34751D8B4EAC00915323 /* Frameworks */,
);
name = CustomTemplate;
sourceTree = "";
@@ -852,14 +1069,25 @@
isa = PBXGroup;
children = (
AA1EE452176059230029C7A5 /* libSDL2test.a */,
+ FA3D992F1BC4E619002C96C8 /* libSDL2test-TV.a */,
);
name = Products;
sourceTree = "";
};
+ FABA34751D8B4EAC00915323 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AA2F57A91FDB544800832AD7 /* Metal.framework */,
+ FABA34761D8B4EAD00915323 /* AVFoundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
FD1B48AD0E3131CA007AB34E /* Products */ = {
isa = PBXGroup;
children = (
FD1B48B80E3131CA007AB34E /* libSDL2.a */,
+ FA3D992B1BC4E619002C96C8 /* libSDL2.a */,
);
name = Products;
sourceTree = "";
@@ -869,6 +1097,7 @@
children = (
047A63F013285CD100CD7973 /* checkkeys.c */,
FDA8A78B0E2D0F3D00EA573E /* loopwave.c */,
+ FABA34931D8B578200915323 /* testaudiocapture.c */,
FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */,
FDC430090F0D86BF009C87E1 /* testdraw2.c */,
FDA8A7470E2D0F1600EA573E /* testerror.c */,
@@ -891,12 +1120,15 @@
FDA8A75A0E2D0F1600EA573E /* testtimer.c */,
FDA8A75B0E2D0F1600EA573E /* testver.c */,
FDA8A75F0E2D0F1600EA573E /* testwm2.c */,
+ AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */,
+ AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */,
FDA8A7610E2D0F1600EA573E /* torturethread.c */,
);
name = src;
+ path = ../../test;
sourceTree = "";
};
- FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */ = {
+ FDA8A7C30E2D10FA00EA573E /* Frameworks */ = {
isa = PBXGroup;
children = (
FA684F7A1BAF1A4400DCFD1A /* GameController.framework */,
@@ -909,7 +1141,7 @@
FDA8A89D0E2D111A00EA573E /* Foundation.framework */,
FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */,
);
- name = "Linked Frameworks";
+ name = Frameworks;
sourceTree = "";
};
FDA8AAD60E2D339A00EA573E /* Resources */ = {
@@ -918,14 +1150,16 @@
FA0EF2281BAF4487000E07A6 /* axis.bmp */,
FA0EF2291BAF4487000E07A6 /* button.bmp */,
FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */,
- FDD2C18A0E2E52FE00B7A85F /* utf8.txt */,
FDA8AAD90E2D33B000EA573E /* icon.bmp */,
FDA8AADA0E2D33BA00EA573E /* moose.dat */,
FDA8AADB0E2D33BA00EA573E /* picture.xbm */,
FDA8AADE0E2D33C100EA573E /* sample.bmp */,
FDA8AAE20E2D33C600EA573E /* sample.wav */,
+ AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */,
+ FDD2C18A0E2E52FE00B7A85F /* utf8.txt */,
);
name = Resources;
+ path = ../../test;
sourceTree = "