Explorar o código

update sdl to https://github.com/libsdl-org/SDL 22March 2022

AzaezelX %!s(int64=3) %!d(string=hai) anos
pai
achega
2614274639
Modificáronse 100 ficheiros con 7915 adicións e 6069 borrados
  1. 47 24
      Engine/lib/sdl/.gitignore
  2. 0 40
      Engine/lib/sdl/.hgtags
  3. 3 21
      Engine/lib/sdl/Android.mk
  4. 4 4
      Engine/lib/sdl/BUGS.txt
  5. 314 226
      Engine/lib/sdl/CMakeLists.txt
  6. 10 9
      Engine/lib/sdl/INSTALL.txt
  7. 1 3
      Engine/lib/sdl/LICENSE.txt
  8. 8 4
      Engine/lib/sdl/Makefile.in
  9. 20 3
      Engine/lib/sdl/Makefile.minimal
  10. 172 47
      Engine/lib/sdl/Makefile.os2
  11. 8 4
      Engine/lib/sdl/Makefile.pandora
  12. 0 96
      Engine/lib/sdl/Makefile.psp
  13. 0 80
      Engine/lib/sdl/Makefile.wiz
  14. 3 7
      Engine/lib/sdl/README.md
  15. 1 1
      Engine/lib/sdl/SDL2.spec.in
  16. 119 1
      Engine/lib/sdl/SDL2Config.cmake
  17. 1 1
      Engine/lib/sdl/TODO.txt
  18. 0 23
      Engine/lib/sdl/VisualC-WinRT/SDL2-WinRT.nuspec
  19. 0 38
      Engine/lib/sdl/VisualC-WinRT/SDL2-WinRT.targets
  20. 0 22
      Engine/lib/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec
  21. 0 10
      Engine/lib/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets
  22. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png
  23. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png
  24. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png
  25. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png
  26. 0 42
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest
  27. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx
  28. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png
  29. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png
  30. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png
  31. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png
  32. 0 42
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest
  33. BIN=BIN
      Engine/lib/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx
  34. 0 146
      Engine/lib/sdl/VisualC.html
  35. 112 0
      Engine/lib/sdl/WhatsNew.txt
  36. 4 0
      Engine/lib/sdl/Xcode-iOS/Demos/Info.plist
  37. 1 1
      Engine/lib/sdl/Xcode-iOS/Demos/src/accelerometer.c
  38. 6 6
      Engine/lib/sdl/Xcode-iOS/Demos/src/fireworks.c
  39. 1 1
      Engine/lib/sdl/Xcode-iOS/Demos/src/mixer.c
  40. 24 14
      Engine/lib/sdl/Xcode-iOS/Demos/src/touch.c
  41. BIN=BIN
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/[email protected]
  42. BIN=BIN
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png
  43. BIN=BIN
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png
  44. 0 28
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist
  45. BIN=BIN
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
  46. 0 10
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
  47. 0 500
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
  48. 0 100
      Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/main.c
  49. 2 2
      Engine/lib/sdl/Xcode/SDL/Info-Framework.plist
  50. 19 381
      Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj
  51. 0 22
      Engine/lib/sdl/Xcode/SDL/hidapi/Info.plist
  52. 1 1
      Engine/lib/sdl/Xcode/SDL/pkg-support/resources/License.txt
  53. 5 6
      Engine/lib/sdl/acinclude/alsa.m4
  54. 38 30
      Engine/lib/sdl/acinclude/esd.m4
  55. 251 176
      Engine/lib/sdl/acinclude/libtool.m4
  56. 90 37
      Engine/lib/sdl/acinclude/ltoptions.m4
  57. 4 3
      Engine/lib/sdl/acinclude/ltsugar.m4
  58. 6 6
      Engine/lib/sdl/acinclude/ltversion.m4
  59. 4 3
      Engine/lib/sdl/acinclude/lt~obsolete.m4
  60. 275 0
      Engine/lib/sdl/acinclude/pkg.m4
  61. 0 133
      Engine/lib/sdl/acinclude/pkg_config.m4
  62. 6 2
      Engine/lib/sdl/android-project/app/build.gradle
  63. 1 1
      Engine/lib/sdl/android-project/app/jni/src/Android.mk
  64. 13 3
      Engine/lib/sdl/android-project/app/src/main/AndroidManifest.xml
  65. 3 3
      Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java
  66. 32 35
      Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
  67. 188 75
      Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
  68. 4 0
      Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java
  69. 17 21
      Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
  70. 3 3
      Engine/lib/sdl/android-project/build.gradle
  71. BIN=BIN
      Engine/lib/sdl/android-project/gradle/wrapper/gradle-wrapper.jar
  72. 3 3
      Engine/lib/sdl/android-project/gradle/wrapper/gradle-wrapper.properties
  73. 9 9
      Engine/lib/sdl/autogen.sh
  74. 1 1
      Engine/lib/sdl/build-scripts/checker-buildbot.sh
  75. 28 27
      Engine/lib/sdl/build-scripts/clang++-fat.sh
  76. 36 33
      Engine/lib/sdl/build-scripts/clang-fat.sh
  77. 59 0
      Engine/lib/sdl/build-scripts/codechecker-buildbot.sh
  78. 433 379
      Engine/lib/sdl/build-scripts/config.guess
  79. 1013 1087
      Engine/lib/sdl/build-scripts/config.sub
  80. 0 72
      Engine/lib/sdl/build-scripts/config.sub.patch
  81. 1 1
      Engine/lib/sdl/build-scripts/emscripten-buildbot.sh
  82. 174 0
      Engine/lib/sdl/build-scripts/fnsince.pl
  83. 80 0
      Engine/lib/sdl/build-scripts/git-pre-push-hook.pl
  84. 218 204
      Engine/lib/sdl/build-scripts/install-sh
  85. 0 190
      Engine/lib/sdl/build-scripts/iosbuild.sh
  86. 1887 653
      Engine/lib/sdl/build-scripts/ltmain.sh
  87. 13 13
      Engine/lib/sdl/build-scripts/mkinstalldirs
  88. 3 4
      Engine/lib/sdl/build-scripts/os2-buildbot.sh
  89. 4 4
      Engine/lib/sdl/build-scripts/showrev.sh
  90. 1 1
      Engine/lib/sdl/build-scripts/update-copyright.sh
  91. 2 3
      Engine/lib/sdl/build-scripts/updaterev.sh
  92. 1258 0
      Engine/lib/sdl/build-scripts/wikiheaders.pl
  93. 1 1
      Engine/lib/sdl/build-scripts/winrtbuild.ps1
  94. 53 13
      Engine/lib/sdl/cmake/macros.cmake
  95. 335 255
      Engine/lib/sdl/cmake/sdlchecks.cmake
  96. 269 214
      Engine/lib/sdl/configure
  97. 213 178
      Engine/lib/sdl/configure.ac
  98. 0 150
      Engine/lib/sdl/debian/changelog
  99. 0 1
      Engine/lib/sdl/debian/compat
  100. 0 76
      Engine/lib/sdl/debian/control

+ 47 - 24
Engine/lib/sdl/.hgignore → Engine/lib/sdl/.gitignore

@@ -1,4 +1,3 @@
-syntax:glob
 aclocal.m4
 aclocal.m4
 autom4te*
 autom4te*
 config.cache
 config.cache
@@ -9,11 +8,35 @@ Makefile
 Makefile.rules
 Makefile.rules
 sdl2-config
 sdl2-config
 sdl2-config.cmake
 sdl2-config.cmake
+sdl2-config-version.cmake
 sdl2.pc
 sdl2.pc
 SDL2.spec
 SDL2.spec
 build
 build
 gen
 gen
 Build
 Build
+buildbot
+
+*.so
+*.so.*
+*.dll
+*.exe
+*.o
+*.obj
+*.lib
+*.a
+*.la
+*.dSYM
+*,e1f
+*,ff8
+*.lnk
+*.err
+*.exp
+*.map
+*.orig
+*~
+*.swp
+*.tmp
+*.rej
 
 
 # for CMake
 # for CMake
 CMakeFiles/
 CMakeFiles/
@@ -21,10 +44,6 @@ CMakeCache.txt
 cmake_install.cmake
 cmake_install.cmake
 cmake_uninstall.cmake
 cmake_uninstall.cmake
 SDL2ConfigVersion.cmake
 SDL2ConfigVersion.cmake
-*.a
-*.la
-*.so
-*.so.*
 .ninja_*
 .ninja_*
 *.ninja
 *.ninja
 
 
@@ -33,12 +52,6 @@ SDL2ConfigVersion.cmake
 cmake-build-*
 cmake-build-*
 
 
 # for Xcode
 # for Xcode
-*.orig
-*.swp
-*.tmp
-*.rej
-*~
-*.o
 *.mode1*
 *.mode1*
 *.perspective*
 *.perspective*
 *.pbxuser
 *.pbxuser
@@ -48,24 +61,31 @@ xcuserdata
 *.xcworkspace
 *.xcworkspace
 
 
 # for Visual C++
 # for Visual C++
+.vs
 Debug
 Debug
 Release
 Release
 *.user
 *.user
 *.ncb
 *.ncb
 *.suo
 *.suo
 *.sdf
 *.sdf
+VisualC/tests/controllermap/axis.bmp
+VisualC/tests/controllermap/button.bmp
+VisualC/tests/controllermap/controllermap.bmp
+VisualC/tests/controllermap/controllermap_back.bmp
 VisualC/tests/loopwave/sample.wav
 VisualC/tests/loopwave/sample.wav
 VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
 VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
 VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
 VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
 VisualC/tests/testgamecontroller/axis.bmp
 VisualC/tests/testgamecontroller/axis.bmp
 VisualC/tests/testgamecontroller/button.bmp
 VisualC/tests/testgamecontroller/button.bmp
 VisualC/tests/testgamecontroller/controllermap.bmp
 VisualC/tests/testgamecontroller/controllermap.bmp
+VisualC/tests/testgamecontroller/controllermap_back.bmp
 VisualC/tests/testoverlay2/moose.dat
 VisualC/tests/testoverlay2/moose.dat
 VisualC/tests/testrendertarget/icon.bmp
 VisualC/tests/testrendertarget/icon.bmp
 VisualC/tests/testrendertarget/sample.bmp
 VisualC/tests/testrendertarget/sample.bmp
 VisualC/tests/testscale/icon.bmp
 VisualC/tests/testscale/icon.bmp
 VisualC/tests/testscale/sample.bmp
 VisualC/tests/testscale/sample.bmp
 VisualC/tests/testsprite2/icon.bmp
 VisualC/tests/testsprite2/icon.bmp
+VisualC/tests/testyuv/testyuv.bmp
 VisualC/visualtest/icon.bmp
 VisualC/visualtest/icon.bmp
 VisualC/visualtest/testquit.actions
 VisualC/visualtest/testquit.actions
 VisualC/visualtest/testquit.config
 VisualC/visualtest/testquit.config
@@ -79,14 +99,8 @@ VisualC/visualtest/testsprite2_sample.parameters
 # for Android
 # for Android
 android-project/local.properties
 android-project/local.properties
 
 
-test/aclocal.m4
-test/autom4te*
-test/config.cache
-test/config.log
-test/config.status
-test/Makefile
-test/SDL2.dll
 test/checkkeys
 test/checkkeys
+test/checkkeysthreads
 test/controllermap
 test/controllermap
 test/loopwave
 test/loopwave
 test/loopwavequeue
 test/loopwavequeue
@@ -102,9 +116,11 @@ test/testdraw2
 test/testdrawchessboard
 test/testdrawchessboard
 test/testdropfile
 test/testdropfile
 test/testerror
 test/testerror
+test/testevdev
 test/testfile
 test/testfile
 test/testfilesystem
 test/testfilesystem
 test/testgamecontroller
 test/testgamecontroller
+test/testgeometry
 test/testgesture
 test/testgesture
 test/testgl2
 test/testgl2
 test/testgles
 test/testgles
@@ -118,8 +134,10 @@ test/testintersections
 test/testjoystick
 test/testjoystick
 test/testkeys
 test/testkeys
 test/testloadso
 test/testloadso
+test/testlocale
 test/testlock
 test/testlock
 test/testmessage
 test/testmessage
+test/testmouse
 test/testmultiaudio
 test/testmultiaudio
 test/testnative
 test/testnative
 test/testoverlay2
 test/testoverlay2
@@ -139,17 +157,22 @@ test/testshape
 test/testsprite2
 test/testsprite2
 test/testspriteminimal
 test/testspriteminimal
 test/teststreaming
 test/teststreaming
+test/testsurround
 test/testthread
 test/testthread
 test/testtimer
 test/testtimer
+test/testurl
 test/testver
 test/testver
 test/testviewport
 test/testviewport
 test/testvulkan
 test/testvulkan
 test/testwm2
 test/testwm2
 test/testyuv
 test/testyuv
 test/torturethread
 test/torturethread
-test/*.exe
-test/*,e1f
-test/*,ff8
-test/*.dSYM
-buildbot
-test/buildbot
+
+builddir/
+debian/*.debhelper.log
+debian/*.substvars
+debian/*.tar.gz
+debian/.debhelper/
+debian/files
+debian/libsdl*/
+debian/tmp/

+ 0 - 40
Engine/lib/sdl/.hgtags

@@ -1,40 +0,0 @@
-0afe0e38e02cf2048e93582f01c52fbb91d3c7bb release-1.2.7
-230b156829ed13b31134d96f689c917981f57b84 release-1.2.5
-27cab50ec9c746e886ce0f3fdaa0b0cdc55a594f release-1.2.11
-2fe3fbd2bff50165b3cad33bf40d70b3bb3c9fd0 release-1.2.3
-3c052d3bcc76c899dfd4846be76243a78e8c7180 release-1.2.4
-3c5eed71a3320962551af3b3dfbee0c99fcf0086 release-1.2.10
-4867f7f7dd3426d1dbbeef48b3f3b3aa19590cc4 release-1.2.12
-6e28dae59e3baf4447c83e833a8d2ac912536f5b release-1.2.1
-7c2589fb8d4df54c6faabd3faebd0c0e73f67879 release-1.2.13
-86de11faf082881ad9b73a1a1d78733ca07f8db8 release-1.2.6
-bb051fa871aa0b53ea57df56a446cec3bb85924c release-1.2.2
-cfcb2e1c36ebe9809577adf768b0ec53e8768af9 release-1.2.8
-e044e7c70a50a2f54d14ee20d0933e904e5853b6 release-1.2.9
-f14cf9d71233934811774f941d0de121d5f96ccf release-1.2.14
-39c22a953456f6c9e2c8993c8ff973824104102a pre-touch-removal
-ccf5fbfa2afabab429ad911308f362201a94d810 macosx_10_4_supported
-d6a8fa507a45d9de7258e51585eab3e45c415149 release-2.0.0
-a8bd63b33636715f2cf6e7d36ab7201acbd478fe release-2.0.1
-a8bd63b33636715f2cf6e7d36ab7201acbd478fe release-2.0.1
-715a01415ac9305b9f8ec72b99fcf8cc9dd64dde release-2.0.1
-715a01415ac9305b9f8ec72b99fcf8cc9dd64dde release-2.0.1
-9ec71e56071cc80eda6691a3f8719ed5395dfcfb release-2.0.1
-9ec71e56071cc80eda6691a3f8719ed5395dfcfb release-2.0.1
-0000000000000000000000000000000000000000 release-2.0.1
-0000000000000000000000000000000000000000 release-2.0.1
-b9663c77f5c95ebf05f3c18e80619caae8ae1460 release-2.0.1
-be2102f000d0d2d9bab75e9703a1d503d0f6bb33 release-2.0.2
-f285b9487756ff681f76c85644222c03a7bfa1c7 release-2.0.3
-f285b9487756ff681f76c85644222c03a7bfa1c7 release-2.0.3
-704a0bfecf754e4e1383f83c7d5118b00cae26ea release-2.0.3
-e12c387305129c847b3928a123300b113782fe3f release-2.0.4
-007dfe83abf81b1ff5df40186f65e8e64987b825 release-2.0.5
-8df7a59b55283aa09889522369a2b32674c048de release-2.0.6
-2088cd828335797d73d151e3288d899f77204862 release-2.0.7
-f1084c419f33610cf274e309a8b2798d2ae665c7 release-2.0.8
-8feb5da6f2fb75703bde2c06813375af984a57f0 release-2.0.9
-bc90ce38f1e27ace54b83bebf987993002504f7f release-2.0.10
-78d0bb6f3b8f9b8f2a76cb357a407bc7ace57234 release-2.0.12
-78d0bb6f3b8f9b8f2a76cb357a407bc7ace57234 release-2.0.12
-355a4f94a782747a990b2fedaebc7bebd280e153 release-2.0.12

+ 3 - 21
Engine/lib/sdl/Android.mk

@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/audio/aaudio/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
 	$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
 	$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
 	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
 	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
@@ -30,6 +31,8 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/hidapi/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
@@ -56,8 +59,6 @@ LOCAL_SRC_FILES := \
 	$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/test/*.c))
 	$(wildcard $(LOCAL_PATH)/src/test/*.c))
 
 
-LOCAL_SHARED_LIBRARIES := hidapi
-
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
 LOCAL_CFLAGS += \
 LOCAL_CFLAGS += \
 	-Wall -Wextra \
 	-Wall -Wextra \
@@ -77,7 +78,6 @@ LOCAL_CFLAGS += \
 
 
 # Warnings we haven't fixed (yet)
 # Warnings we haven't fixed (yet)
 LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
 LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
- 
 
 
 LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
 LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
 
 
@@ -120,22 +120,4 @@ LOCAL_MODULE_FILENAME := libSDL2main
 
 
 include $(BUILD_STATIC_LIBRARY)
 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)
-
 $(call import-module,android/cpufeatures)
 $(call import-module,android/cpufeatures)
-

+ 4 - 4
Engine/lib/sdl/BUGS.txt

@@ -1,7 +1,7 @@
 
 
-Bugs are now managed in the SDL bug tracker, here:
+Bugs are now managed in the SDL issue tracker, here:
 
 
-    https://bugzilla.libsdl.org/
+    https://github.com/libsdl-org/SDL/issues
 
 
 You may report bugs there, and search to see if a given issue has already
 You may report bugs there, and search to see if a given issue has already
  been reported, discussed, and maybe even fixed.
  been reported, discussed, and maybe even fixed.
@@ -11,6 +11,6 @@ You may also find help at the SDL forums/mailing list:
 
 
     https://discourse.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.
+Bug reports are welcome here, but we really appreciate if you use the issue
+ tracker, as bugs discussed on the mailing list may be forgotten or missed.
 
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 314 - 226
Engine/lib/sdl/CMakeLists.txt


+ 10 - 9
Engine/lib/sdl/INSTALL.txt

@@ -2,16 +2,16 @@
 To compile and install SDL:
 To compile and install SDL:
 
 
     1.  Windows with Visual Studio:
     1.  Windows with Visual Studio:
-        * Read VisualC.html
+        * Read ./docs/README-visualc.md
 
 
         Windows with gcc, either native or cross-compiling:
         Windows with gcc, either native or cross-compiling:
-        * Read the FAQ at https://wiki.libsdl.org/moin.fcg/FAQWindows
+        * Read the FAQ at https://wiki.libsdl.org/FAQWindows
         * Run './configure; make; make install'
         * Run './configure; make; make install'
 
 
-        Mac OS X with Xcode:
+        macOS with Xcode:
         * Read docs/README-macosx.md
         * Read docs/README-macosx.md
 
 
-        Mac OS X from the command line:
+        macOS from the command line:
         * Run './configure; make; make install'
         * Run './configure; make; make install'
 
 
         Linux and other UNIX systems:
         Linux and other UNIX systems:
@@ -29,12 +29,13 @@ To compile and install SDL:
     2.  Look at the example programs in ./test, and check out the online
     2.  Look at the example programs in ./test, and check out the online
         documentation at https://wiki.libsdl.org/
         documentation at https://wiki.libsdl.org/
 
 
-    3.  Join the SDL developer mailing list by sending E-mail to
-    	[email protected]
-        and put "subscribe" in the subject of the message.
+    3.  Join the SDL developer discussions, sign up on 
+        https://discourse.libsdl.org/
+        and go to the development forum
+        https://discourse.libsdl.org/c/sdl-development/6
 
 
-        Or alternatively you can use the web interface:
-            https://www.libsdl.org/mailing-list.php
+    4.  Sign up for the announcement list through the web interface:
+        https://www.libsdl.org/mailing-list.php
 
 
 That's it!
 That's it!
 Sam Lantinga <[email protected]>
 Sam Lantinga <[email protected]>

+ 1 - 3
Engine/lib/sdl/COPYING.txt → Engine/lib/sdl/LICENSE.txt

@@ -1,6 +1,4 @@
-
-Simple DirectMedia Layer
-Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
   
   
 This software is provided 'as-is', without any express or implied
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
 warranty.  In no event will the authors be held liable for any damages

+ 8 - 4
Engine/lib/sdl/Makefile.in

@@ -29,6 +29,8 @@ INSTALL = @INSTALL@
 AR	= @AR@
 AR	= @AR@
 RANLIB	= @RANLIB@
 RANLIB	= @RANLIB@
 RC	= @RC@
 RC	= @RC@
+LINKER = @LINKER@
+LIBTOOLLINKERTAG = @LIBTOOLLINKERTAG@
 
 
 TARGET  = libSDL2.la
 TARGET  = libSDL2.la
 OBJECTS = @OBJECTS@
 OBJECTS = @OBJECTS@
@@ -43,10 +45,11 @@ SDLTEST_TARGET = libSDL2_test.la
 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
 
 
 WAYLAND_SCANNER = @WAYLAND_SCANNER@
 WAYLAND_SCANNER = @WAYLAND_SCANNER@
+WAYLAND_SCANNER_CODE_MODE = @WAYLAND_SCANNER_CODE_MODE@
 
 
 INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
 INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
 
 
-SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config-version.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
+SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
 GEN_DIST = SDL2.spec
 GEN_DIST = SDL2.spec
 
 
 ifneq ($V,1)
 ifneq ($V,1)
@@ -77,6 +80,7 @@ HDRS = \
 	SDL_gamecontroller.h \
 	SDL_gamecontroller.h \
 	SDL_gesture.h \
 	SDL_gesture.h \
 	SDL_haptic.h \
 	SDL_haptic.h \
+	SDL_hidapi.h \
 	SDL_hints.h \
 	SDL_hints.h \
 	SDL_joystick.h \
 	SDL_joystick.h \
 	SDL_keyboard.h \
 	SDL_keyboard.h \
@@ -151,13 +155,13 @@ 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)
 .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): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
 $(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)
+	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
 
 
 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
-	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
+	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
 
 
 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
-	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
+	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
 
 
 install: all install-bin install-hdrs install-lib install-data
 install: all install-bin install-hdrs install-lib install-data
 install-bin:
 install-bin:

+ 20 - 3
Engine/lib/sdl/Makefile.minimal

@@ -5,9 +5,12 @@ CFLAGS  = -g -O2 $(INCLUDE)
 AR	= ar
 AR	= ar
 RANLIB	= ranlib
 RANLIB	= ranlib
 
 
-TARGET  = libSDL.a
+TARGET  = libSDL2.a
+TESTTARGET = libSDL2_test.a
+
 SOURCES = \
 SOURCES = \
 	src/*.c \
 	src/*.c \
+	src/atomic/*.c \
 	src/audio/*.c \
 	src/audio/*.c \
 	src/audio/dummy/*.c \
 	src/audio/dummy/*.c \
 	src/cpuinfo/*.c \
 	src/cpuinfo/*.c \
@@ -15,30 +18,44 @@ SOURCES = \
 	src/file/*.c \
 	src/file/*.c \
 	src/haptic/*.c \
 	src/haptic/*.c \
 	src/haptic/dummy/*.c \
 	src/haptic/dummy/*.c \
+	src/hidapi/*.c \
 	src/joystick/*.c \
 	src/joystick/*.c \
 	src/joystick/dummy/*.c \
 	src/joystick/dummy/*.c \
 	src/loadso/dummy/*.c \
 	src/loadso/dummy/*.c \
 	src/power/*.c \
 	src/power/*.c \
 	src/filesystem/dummy/*.c \
 	src/filesystem/dummy/*.c \
+	src/locale/*.c \
+	src/locale/dummy/*.c \
+	src/misc/*.c \
+	src/misc/dummy/*.c \
 	src/render/*.c \
 	src/render/*.c \
 	src/render/software/*.c \
 	src/render/software/*.c \
 	src/sensor/*.c \
 	src/sensor/*.c \
 	src/sensor/dummy/*.c \
 	src/sensor/dummy/*.c \
 	src/stdlib/*.c \
 	src/stdlib/*.c \
+	src/libm/*.c \
 	src/thread/*.c \
 	src/thread/*.c \
 	src/thread/generic/*.c \
 	src/thread/generic/*.c \
 	src/timer/*.c \
 	src/timer/*.c \
 	src/timer/dummy/*.c \
 	src/timer/dummy/*.c \
 	src/video/*.c \
 	src/video/*.c \
+	src/video/yuv2rgb/*.c \
 	src/video/dummy/*.c \
 	src/video/dummy/*.c \
 
 
+TSOURCES = src/test/*.c
+
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
+TOBJECTS= $(shell echo $(TSOURCES) | sed -e 's,\.c,\.o,g')
 
 
-all: $(TARGET)
+all: $(TARGET) $(TESTTARGET)
 
 
 $(TARGET): $(OBJECTS)
 $(TARGET): $(OBJECTS)
 	$(AR) crv $@ $^
 	$(AR) crv $@ $^
 	$(RANLIB) $@
 	$(RANLIB) $@
 
 
+$(TESTTARGET): $(TOBJECTS)
+	$(AR) crv $@ $^
+	$(RANLIB) $@
+
 clean:
 clean:
-	rm -f $(TARGET) $(OBJECTS)
+	rm -f $(TARGET) $(TESTTARGET) $(OBJECTS) $(TOBJECTS)

+ 172 - 47
Engine/lib/sdl/Makefile.os2

@@ -1,10 +1,22 @@
 # Open Watcom makefile to build SDL2.dll for OS/2
 # Open Watcom makefile to build SDL2.dll for OS/2
 # wmake -f Makefile.os2
 # wmake -f Makefile.os2
+#
+# If you have GNU libiconv installed (iconv2.dll), you
+# can compile against it by specifying LIBICONV=1, e.g.:
+# wmake -f Makefile.os2 LIBICONV=1
+#
+# If you have libusb-1.0 installed (usb100.dll, libusb.h), you
+# can compile hidapi joystick support against it (experimental)
+# by specifying HIDAPI=1, e.g.:
+# wmake -f Makefile.os2 HIDAPI=1
 
 
 LIBNAME = SDL2
 LIBNAME = SDL2
-VERSION = 2.0.14
+VERSION = 2.0.21
 DESCRIPTION = Simple DirectMedia Layer 2
 DESCRIPTION = Simple DirectMedia Layer 2
 
 
+LIBICONV=0
+ICONVLIB=$(LIBICONV_LIB)
+
 LIBHOME = .
 LIBHOME = .
 DLLFILE = $(LIBHOME)/$(LIBNAME).dll
 DLLFILE = $(LIBHOME)/$(LIBNAME).dll
 LIBFILE = $(LIBHOME)/$(LIBNAME).lib
 LIBFILE = $(LIBHOME)/$(LIBNAME).lib
@@ -12,32 +24,41 @@ LNKFILE = $(LIBNAME).lnk
 
 
 INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
 INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
 INCPATH+= -Iinclude
 INCPATH+= -Iinclude
-INCPATH+= -I"src/core/os2" -I"src/core/os2/geniconv"
 
 
-LIBM = libm.lib
-LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
+LIBM = SDL2libm.lib
+TLIB = SDL2test.lib
+LIBS = mmpm2.lib $(LIBM)
+CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei
+# Debug options:
+# - debug messages from OS/2 related code to stdout:
+#CFLAGS+= -DOS2DEBUG
+# - debug messages from OS/2 code via SDL_LogDebug():
+#CFLAGS+= -DOS2DEBUG=2
 
 
-CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
 # max warnings:
 # max warnings:
 CFLAGS+= -wx
 CFLAGS+= -wx
 # newer OpenWatcom versions enable W303 by default
 # newer OpenWatcom versions enable W303 by default
 CFLAGS+= -wcd=303
 CFLAGS+= -wcd=303
-# building dll:
-CFLAGS+= -bd
 # the include paths :
 # the include paths :
 CFLAGS+= $(INCPATH)
 CFLAGS+= $(INCPATH)
+CFLAGS_STATIC=$(CFLAGS)
+# building dll:
+CFLAGS_DLL =$(CFLAGS)
+CFLAGS_DLL+= -bd
+# iconv:
+LIBICONV_LIB=iconv2.lib
+!ifeq LIBICONV 1
+CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
+LIBS+= $(ICONVLIB)
+!else
+LIBS+= libuls.lib libconv.lib
+!endif
+# hidapi (libusb):
+!ifeq HIDAPI 1
+CFLAGS_DLL+= -DHAVE_LIBUSB_H=1
+!endif
 # building SDL itself (for DECLSPEC):
 # building SDL itself (for DECLSPEC):
-CFLAGS+= -DBUILD_SDL
-
-# Debug options:
-# - debug messages from OS/2 related code to stdout:
-#CFLAGS+= -DOS2DEBUG
-# - debug messages from OS/2 code via SDL_LogDebug():
-#CFLAGS+= -DOS2DEBUG=2
-
-MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
-       k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
-       s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
+CFLAGS_DLL+= -DBUILD_SDL
 
 
 SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
 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 SDL_strtokr.c SDL_crc32.c
 SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
@@ -47,10 +68,10 @@ SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c
 SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.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_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
        SDL_sensor.c SDL_touch.c
        SDL_sensor.c SDL_touch.c
-SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
+SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c
 SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.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_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
-       SDL_render_sw.c SDL_rotate.c
+       SDL_render_sw.c SDL_rotate.c SDL_triangle.c
 SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.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_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_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
@@ -60,15 +81,18 @@ SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
 SRCS+= SDL_systimer.c
 SRCS+= SDL_systimer.c
 SRCS+= SDL_sysloadso.c
 SRCS+= SDL_sysloadso.c
 SRCS+= SDL_sysfilesystem.c
 SRCS+= SDL_sysfilesystem.c
-SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
-SRCS+= SDL_virtualjoystick.c
+SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c
+SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c
 SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
 SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
 SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
 SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
 SRCS+= SDL_dummysensor.c
 SRCS+= SDL_dummysensor.c
 SRCS+= SDL_locale.c SDL_syslocale.c
 SRCS+= SDL_locale.c SDL_syslocale.c
 SRCS+= SDL_url.c SDL_sysurl.c
 SRCS+= SDL_url.c SDL_sysurl.c
 
 
-SRCS+= SDL_os2.c geniconv.c os2cp.c os2iconv.c sys2utf8.c
+SRCS+= SDL_os2.c
+!ifeq LIBICONV 0
+SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c
+!endif
 SRCS+= SDL_os2audio.c
 SRCS+= SDL_os2audio.c
 SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
 SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
        SDL_os2mouse.c SDL_os2messagebox.c
        SDL_os2mouse.c SDL_os2messagebox.c
@@ -76,19 +100,22 @@ SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c &
 SRCS+= SDL_dynapi.c
 SRCS+= SDL_dynapi.c
 
 
 OBJS = $(SRCS:.c=.obj)
 OBJS = $(SRCS:.c=.obj)
-MOBJS= $(MSRCS:.c=.obj)
 
 
 .extensions:
 .extensions:
 .extensions: .lib .dll .obj .c .asm
 .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;./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/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
 .c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
-.c: ./src/core/os2;./src/core/os2/geniconv;./src/audio/os2;./src/loadso/os2;./src/filesystem/os2;./src/thread/os2;./src/timer/os2;./src/video/os2;
-.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy
+.c: ./src/core/os2;./src/audio/os2;./src/loadso/os2;./src/filesystem/os2;./src/joystick/os2;./src/thread/os2;./src/timer/os2;./src/video/os2;
+.c: ./src/core/os2/geniconv;
+.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi
 
 
-all: $(DLLFILE) $(LIBFILE) .symbolic
+all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic
 
 
-$(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
+build_dll: .symbolic
+    @echo * Compiling dll objects
+
+$(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE)
     @echo * Linking: $@
     @echo * Linking: $@
     wlink @$(LNKFILE)
     wlink @$(LNKFILE)
 
 
@@ -97,36 +124,132 @@ $(LIBFILE): $(DLLFILE)
     wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
     wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
 
 
 .c.obj:
 .c.obj:
-    wcc386 $(CFLAGS) -fo=$^@ $<
+    wcc386 $(CFLAGS_DLL) -fo=$^@ $<
 
 
 SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
 SDL_syscond.obj: "src/thread/generic/SDL_syscond.c"
-    wcc386 $(CFLAGS) -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -fo=$^@ $<
 SDL_cpuinfo.obj: SDL_cpuinfo.c
 SDL_cpuinfo.obj: SDL_cpuinfo.c
-    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
-
-SDL_rwops.obj: SDL_rwops.c
-    wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
 SDL_wave.obj: SDL_wave.c
 SDL_wave.obj: SDL_wave.c
-    wcc386 $(CFLAGS) -wcd=124 -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $<
 SDL_blendfillrect.obj: SDL_blendfillrect.c
 SDL_blendfillrect.obj: SDL_blendfillrect.c
-    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
 SDL_blendline.obj: SDL_blendline.c
 SDL_blendline.obj: SDL_blendline.c
-    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
 SDL_blendpoint.obj: SDL_blendpoint.c
 SDL_blendpoint.obj: SDL_blendpoint.c
-    wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
-
+    wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
 SDL_RLEaccel.obj: SDL_RLEaccel.c
 SDL_RLEaccel.obj: SDL_RLEaccel.c
-    wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
+    wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
+# c99 mode needed because of structs with flexible array members in libusb.h
+SDL_hidapi.obj: SDL_hidapi.c
+    wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $<
+
+$(LIBICONV_LIB):  "src/core/os2/iconv2.lbc"
+    @echo * Creating: $@
+    wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$<
+
+# SDL2libm
+MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
+       k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
+       s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
+MOBJS= $(MSRCS:.c=.obj)
 
 
 .c: ./src/libm;
 .c: ./src/libm;
-$(LIBM): $(MOBJS)
+e_atan2.obj: e_atan2.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_exp.obj: e_exp.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_fmod.obj: e_fmod.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_log10.obj: e_log10.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_log.obj: e_log.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_pow.obj: e_pow.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_rem_pio2.obj: e_rem_pio2.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+e_sqrt.obj: e_sqrt.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+k_cos.obj: k_cos.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+k_rem_pio2.obj: k_rem_pio2.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+k_sin.obj: k_sin.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+k_tan.obj: k_tan.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_atan.obj: s_atan.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_copysign.obj: s_copysign.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_cos.obj: s_cos.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_fabs.obj: s_fabs.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_floor.obj: s_floor.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_scalbn.obj: s_scalbn.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_sin.obj: s_sin.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+s_tan.obj: s_tan.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+
+build_libm: .symbolic
+    @echo * Compiling libm objects
+$(LIBM): build_libm $(MOBJS)
+    @echo * Creating: $@
     wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
     wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
 
 
+# SDL2test
+TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c &
+        SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c &
+        SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c &
+        SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c &
+        SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c
+TOBJS= $(TSRCS:.c=.obj)
+
+.c: ./src/test;
+SDL_test_assert.obj: SDL_test_assert.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_common.obj: SDL_test_common.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_compare.obj: SDL_test_compare.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_crc32.obj: SDL_test_crc32.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_font.obj: SDL_test_font.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_fuzzer.obj: SDL_test_fuzzer.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_harness.obj: SDL_test_harness.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_imageBlit.obj: SDL_test_imageBlit.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_imageFace.obj: SDL_test_imageFace.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_log.obj: SDL_test_log.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_md5.obj: SDL_test_md5.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_random.obj: SDL_test_random.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+SDL_test_memory.obj: SDL_test_memory.c
+    wcc386 $(CFLAGS_STATIC) -fo=$^@ $<
+
+build_tlib: .symbolic
+    @echo * Compiling testlib objects
+$(TLIB): build_tlib $(TOBJS)
+    @echo * Creating: $@
+    wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS)
+
 $(LNKFILE):
 $(LNKFILE):
     @echo * Creating linker file: $@
     @echo * Creating linker file: $@
     @%create $@
     @%create $@
@@ -144,14 +267,16 @@ $(LNKFILE):
     @%append $@ OPTION SHOWDEAD
     @%append $@ OPTION SHOWDEAD
 
 
 clean: .SYMBOLIC
 clean: .SYMBOLIC
-    @ echo * Clean: $(LIBNAME)
+    @echo * Clean: $(LIBNAME)
     @if exist *.obj rm *.obj
     @if exist *.obj rm *.obj
     @if exist *.err rm *.err
     @if exist *.err rm *.err
     @if exist $(LNKFILE) rm $(LNKFILE)
     @if exist $(LNKFILE) rm $(LNKFILE)
     @if exist $(LIBM) rm $(LIBM)
     @if exist $(LIBM) rm $(LIBM)
+    @if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB)
 
 
 distclean: .SYMBOLIC clean
 distclean: .SYMBOLIC clean
     @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
     @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
     @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
     @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
     @if exist $(LIBFILE) rm $(LIBFILE)
     @if exist $(LIBFILE) rm $(LIBFILE)
     @if exist $(DLLFILE) rm $(DLLFILE)
     @if exist $(DLLFILE) rm $(DLLFILE)
+    @if exist $(TLIB) rm $(TLIB)

+ 8 - 4
Engine/lib/sdl/Makefile.pandora

@@ -10,7 +10,7 @@ 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 \
 	-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
 	-I./include -I$(PNDSDK)/usr/include
 	-I./include -I$(PNDSDK)/usr/include
 
 
-TARGET  = libSDL.a
+TARGET  = libSDL2.a
 
 
 SOURCES = 
 SOURCES = 
 	./src/*.c \
 	./src/*.c \
@@ -25,9 +25,14 @@ SOURCES =
 	./src/filesystem/unix/*.c \
 	./src/filesystem/unix/*.c \
 	./src/haptic/*.c \
 	./src/haptic/*.c \
 	./src/haptic/linux/*.c \
 	./src/haptic/linux/*.c \
+	./src/hidapi/*.c \
 	./src/joystick/*.c \
 	./src/joystick/*.c \
 	./src/joystick/linux/*.c \
 	./src/joystick/linux/*.c \
 	./src/loadso/dlopen/*.c \
 	./src/loadso/dlopen/*.c \
+	./src/locale/*.c \
+	./src/locale/unix/*.c \
+	./src/misc/*.c \
+	./src/misc/unix/*.c \
 	./src/power/*.c \
 	./src/power/*.c \
 	./src/sensor/*.c \
 	./src/sensor/*.c \
 	./src/sensor/dummy/*.c \
 	./src/sensor/dummy/*.c \
@@ -40,11 +45,10 @@ SOURCES =
 	./src/timer/*.c \
 	./src/timer/*.c \
 	./src/timer/unix/*.c \
 	./src/timer/unix/*.c \
 	./src/video/*.c \
 	./src/video/*.c \
+	./src/video/yuv2rgb/*.c \
 	./src/video/dummy/*.c \
 	./src/video/dummy/*.c \
-	./src/video/pandora/SDL_pandora.o \
-	./src/video/pandora/SDL_pandora_events.o \
 	./src/video/x11/*.c \
 	./src/video/x11/*.c \
-	
+	./src/video/pandora/*.c
 
 
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
 
 

+ 0 - 96
Engine/lib/sdl/Makefile.psp

@@ -1,96 +0,0 @@
-TARGET_LIB = libSDL2.a
-OBJS= src/SDL.o \
-      src/SDL_assert.o \
-      src/SDL_error.o \
-      src/SDL_hints.o \
-      src/SDL_log.o \
-      src/atomic/SDL_atomic.o \
-      src/atomic/SDL_spinlock.o \
-      src/audio/SDL_audio.o \
-      src/audio/SDL_audiocvt.o \
-      src/audio/SDL_audiodev.o \
-      src/audio/SDL_audiotypecvt.o \
-      src/audio/SDL_mixer.o \
-      src/audio/SDL_wave.o \
-      src/audio/psp/SDL_pspaudio.o \
-      src/cpuinfo/SDL_cpuinfo.o \
-      src/events/SDL_clipboardevents.o \
-      src/events/SDL_dropevents.o \
-      src/events/SDL_events.o \
-      src/events/SDL_gesture.o \
-      src/events/SDL_keyboard.o \
-      src/events/SDL_mouse.o \
-      src/events/SDL_quit.o \
-      src/events/SDL_touch.o \
-      src/events/SDL_windowevents.o \
-      src/file/SDL_rwops.o \
-      src/haptic/SDL_haptic.o \
-      src/haptic/dummy/SDL_syshaptic.o \
-      src/joystick/SDL_joystick.o \
-      src/joystick/SDL_gamecontroller.o \
-      src/joystick/psp/SDL_sysjoystick.o \
-      src/power/SDL_power.o \
-      src/power/psp/SDL_syspower.o \
-      src/filesystem/dummy/SDL_sysfilesystem.o \
-      src/render/SDL_render.o \
-      src/render/SDL_yuv_sw.o \
-      src/render/psp/SDL_render_psp.o \
-      src/render/software/SDL_blendfillrect.o \
-      src/render/software/SDL_blendline.o \
-      src/render/software/SDL_blendpoint.o \
-      src/render/software/SDL_drawline.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 \
-      src/stdlib/SDL_qsort.o \
-      src/stdlib/SDL_stdlib.o \
-      src/stdlib/SDL_string.o \
-      src/stdlib/SDL_strtokr.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 \
-      src/thread/psp/SDL_syscond.o \
-      src/timer/SDL_timer.o \
-      src/timer/psp/SDL_systimer.o \
-      src/video/SDL_RLEaccel.o \
-      src/video/SDL_blit.o \
-      src/video/SDL_blit_0.o \
-      src/video/SDL_blit_1.o \
-      src/video/SDL_blit_A.o \
-      src/video/SDL_blit_N.o \
-      src/video/SDL_blit_auto.o \
-      src/video/SDL_blit_copy.o \
-      src/video/SDL_blit_slow.o \
-      src/video/SDL_bmp.o \
-      src/video/SDL_clipboard.o \
-      src/video/SDL_fillrect.o \
-      src/video/SDL_pixels.o \
-      src/video/SDL_rect.o \
-      src/video/SDL_stretch.o \
-      src/video/SDL_surface.o \
-      src/video/SDL_video.o \
-      src/video/psp/SDL_pspevents.o \
-      src/video/psp/SDL_pspvideo.o \
-      src/video/psp/SDL_pspgl.o \
-      src/video/psp/SDL_pspmouse.o
-
-INCDIR = ./include
-CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL
-CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
-ASFLAGS = $(CFLAGS)
-
-LIBDIR  =
-LIBS = -lGL -lGLU -lglut -lz \
-         -lpspvfpu -lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgum -lpspgu -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-         -lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -lpspvram
-
-PSPSDK=$(shell psp-config --pspsdk-path)
-include $(PSPSDK)/lib/build.mak
-

+ 0 - 80
Engine/lib/sdl/Makefile.wiz

@@ -1,80 +0,0 @@
-# Makefile to build the pandora SDL library
-WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
-
-AR	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar
-RANLIB	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib
-CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc
-CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++
-STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
-
-CFLAGS  = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
-
-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')
-
-all: config_copy $(TARGET_STATIC) $(TARGET_SHARED)
-
-$(TARGET_STATIC): $(OBJECTS)
-	$(AR) crv $@ $^
-	$(RANLIB) $@
-
-$(TARGET_SHARED):
-	$(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1  $(OBJECTS)
-	ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0
-	ln -s $(TARGET_SHARED).0 $(TARGET_SHARED)
-
-config_copy:
-	cp include/SDL_config_wiz.h include/SDL_config.h
-
-clean:
-	rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS)
-
-install:
-	mkdir -p $(WIZSDK)/lib
-	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)
-	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0
-	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
-
-	cp $(TARGET_STATIC) ../../toolchain/libs
-	cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs
-	rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
-	ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0
-	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/SDL2/
-	cp -f include/*.h ../../toolchain/include/SDL2/

+ 3 - 7
Engine/lib/sdl/README.txt → Engine/lib/sdl/README.md

@@ -1,11 +1,6 @@
 
 
-                         Simple DirectMedia Layer
+# Simple DirectMedia Layer (SDL) Version 2.0
 
 
-                                  (SDL)
-
-                                Version 2.0
-
----
 https://www.libsdl.org/
 https://www.libsdl.org/
 
 
 Simple DirectMedia Layer is a cross-platform development library designed
 Simple DirectMedia Layer is a cross-platform development library designed
@@ -18,4 +13,5 @@ More extensive documentation is available in the docs directory, starting
 with README.md
 with README.md
 
 
 Enjoy!
 Enjoy!
-	Sam Lantinga				([email protected])
+
+Sam Lantinga ([email protected])

+ 1 - 1
Engine/lib/sdl/SDL2.spec.in

@@ -63,7 +63,7 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %files
 %files
 %{__defattr}
 %{__defattr}
-%doc README*.txt COPYING.txt CREDITS.txt BUGS.txt
+%doc README*.txt LICENSE.txt CREDITS.txt BUGS.txt
 %{_libdir}/lib*.%{__soext}.*
 %{_libdir}/lib*.%{__soext}.*
 
 
 %files devel
 %files devel

+ 119 - 1
Engine/lib/sdl/SDL2Config.cmake

@@ -1 +1,119 @@
-include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
+  include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
+endif()
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
+  include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
+endif()
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
+  include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
+endif()
+
+# on static-only builds create an alias
+if(NOT TARGET SDL2::SDL2 AND TARGET SDL2::SDL2-static)
+  if(CMAKE_VERSION VERSION_LESS "3.18")
+      # Aliasing local targets is not supported on CMake < 3.18, so make it global.
+      set_target_properties(SDL2::SDL2-static PROPERTIES IMPORTED_GLOBAL TRUE)
+  endif()
+  add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
+endif()
+
+# provide ${SDL2_LIBRARIES}, ${SDL2_INCLUDE_DIRS} etc, like sdl2-config.cmake does,
+# for compatibility between SDL2 built with autotools and SDL2 built with CMake
+
+# the following seems to work on Windows for both MSVC and MINGW+MSYS and with both SDL2Config/Target.cmake
+# from vcpkg and from building myself with cmake from latest git
+# AND on Linux when building SDL2 (tested current git) with CMake
+
+# the headers are easy - but note that this adds both .../include/ and .../include/SDL2/
+# while the SDL2_INCLUDE_DIRS of sdl2-config.cmake only add ...include/SDL2/
+# But at least if building worked with sdl2-config.cmake it will also work with this.
+get_target_property(SDL2_INCLUDE_DIRS SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)
+
+# get the paths to the files to link against (.lib or .dll.a on Windows, .so or .a on Unix, ...) for both SDL2 and SDL2main
+
+# for the "normal"/release build they could be in lots of different properties..
+set(relprops IMPORTED_IMPLIB_RELEASE IMPORTED_IMPLIB_NOCONFIG IMPORTED_IMPLIB IMPORTED_IMPLIB_MINSIZEREL IMPORTED_IMPLIB_RELWITHDEBINFO
+             IMPORTED_LOCATION_RELEASE IMPORTED_LOCATION_NOCONFIG IMPORTED_LOCATION IMPORTED_LOCATION_MINSIZEREL IMPORTED_LOCATION_RELWITHDEBINFO)
+
+# fewer possibilities for debug builds
+set(dbgprops IMPORTED_IMPLIB_DEBUG IMPORTED_LOCATION_DEBUG)
+
+foreach(prop ${relprops})
+	get_target_property(sdl2implib SDL2::SDL2 ${prop})
+	if(sdl2implib)
+		#message("set sdl2implib from ${prop}")
+		break()
+	endif()
+endforeach()
+
+foreach(prop ${relprops})
+	get_target_property(sdl2mainimplib SDL2::SDL2main ${prop})
+	if(sdl2mainimplib)
+		#message("set sdl2mainimplib from ${prop}")
+		break()
+	endif()
+endforeach()
+
+foreach(prop ${dbgprops})
+	get_target_property(sdl2implibdbg SDL2::SDL2 ${prop})
+	if(sdl2implibdbg)
+		#message("set sdl2implibdbg from ${prop}")
+		break()
+	endif()
+endforeach()
+
+foreach(prop ${dbgprops})
+	get_target_property(sdl2mainimplibdbg SDL2::SDL2main ${prop})
+	if(sdl2mainimplibdbg)
+		#message("set sdl2mainimplibdbg from ${prop}")
+		break()
+	endif()
+endforeach()
+
+if( sdl2implib AND sdl2mainimplib AND sdl2implibdbg AND sdl2mainimplibdbg )
+	# we have both release and debug builds of SDL2 and SDL2main, so use this ugly
+	# generator expression in SDL2_LIBRARIES to support both in MSVC, depending on build type configured there
+	set(SDL2_LIBRARIES $<IF:$<CONFIG:Debug>,${sdl2mainimplibdbg},${sdl2mainimplib}>   $<IF:$<CONFIG:Debug>,${sdl2implibdbg},${sdl2implib}>)
+else()
+	if( (NOT sdl2implib) AND sdl2implibdbg ) # if we only have a debug version of the lib
+		set(sdl2implib ${sdl2implibdbg})
+	endif()
+	if( (NOT sdl2mainimplib) AND sdl2mainimplibdbg ) # if we only have a debug version of the lib
+		set(sdl2mainimplib ${sdl2mainimplibdbg})
+	endif()
+
+	if( sdl2implib AND sdl2mainimplib )
+		set(SDL2_LIBRARIES ${sdl2mainimplib}  ${sdl2implib})
+	elseif(WIN32 OR APPLE) # I think these platforms have a non-dummy SDLmain?
+		message(FATAL_ERROR, "SDL2::SDL2 and/or SDL2::SDL2main don't seem to contain any kind of IMPORTED_IMPLIB* or IMPORTED_LOCATION*")
+	elseif(sdl2implib) # on other platforms just libSDL2 will hopefully do?
+		set(SDL2_LIBRARIES ${sdl2implib})
+		message(STATUS, "No SDL2main lib not found, I hope you don't need it..")
+	else()
+		message(FATAL_ERROR, "SDL2::SDL2 doesn't seem to contain any kind of lib to link against in IMPORTED_IMPLIB* or IMPORTED_LOCATION*")
+	endif()
+
+	# TODO: should something like INTERFACE_LINK_LIBRARIES be appended? or wherever -mwindows and things like that
+	#       might be defined (if they were defined by the CMake build at all; autotools has @SDL_RLD_FLAGS@ @SDL_LIBS@)?
+	#       LINK_DEPENDS? LINK_FLAGS?
+
+endif()
+
+get_filename_component(SDL2_LIBDIR ${sdl2implib} PATH)
+
+# NOTE: SDL2_LIBRARIES now looks like "c:/path/to/SDL2main.lib;c:/path/to/SDL2.lib"
+#       which is different to what it looks like when coming from sdl2-config.cmake
+#       (there it's more like "-L${SDL2_LIBDIR} -lSDL2main -lSDL2" - and also -lmingw32 and -mwindows)
+#       This seems to work with both MSVC and MinGW though, while the other only worked with MinGW
+#   On Linux it looks like "/tmp/sdl2inst/lib/libSDL2main.a;/tmp/sdl2inst/lib/libSDL2-2.0.so.0.14.1" which also seems to work
+
+# the exec prefix is one level up from lib/ - TODO: really, always? at least on Linux there's /usr/lib/x86_64-bla-blub/libSDL2-asdf.so.0 ..
+get_filename_component(SDL2_EXEC_PREFIX ${SDL2_LIBDIR} PATH)
+set(SDL2_PREFIX ${SDL2_EXEC_PREFIX}) # TODO: could this be somewhere else? parent dir of include or sth?
+
+unset(sdl2implib)
+unset(sdl2mainimplib)
+unset(sdl2implibdbg)
+unset(sdl2mainimplibdbg)
+unset(relprops)
+unset(dbgprops)

+ 1 - 1
Engine/lib/sdl/TODO.txt

@@ -1,5 +1,5 @@
 Future work roadmap:
 Future work roadmap:
- * http://wiki.libsdl.org/moin.cgi/Roadmap
+ * http://wiki.libsdl.org/Roadmap
 
 
  * Check 1.2 revisions:
  * Check 1.2 revisions:
 	3554 - Need to resolve semantics for locking keys on different platforms
 	3554 - Need to resolve semantics for locking keys on different platforms

+ 0 - 23
Engine/lib/sdl/VisualC-WinRT/SDL2-WinRT.nuspec

@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<package >
-  <metadata>
-    <id>SDL2-WinRT</id>
-    <version>2.0.4-Unofficial</version>
-    <authors>Sam Lantinga</authors>
-    <owners>David Ludwig</owners>
-    <licenseUrl>http://libsdl.org/license.php</licenseUrl>
-    <projectUrl>http://libsdl.org</projectUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Unofficial pre-release of LibSDL2, built for WinRT platforms</description>
-    <copyright>Copyright 2015</copyright>
-    <tags>SDL2 SDL LibSDL OpenGL C C++ nativepackage</tags>
-  </metadata>
-  <files>
-    <file src="lib\**\*.dll" target="bin"/>
-    <file src="lib\**\*.lib" target="bin"/>
-    <file src="lib\**\*.pdb" target="bin"/>
-    <file src="..\include\**\*.*" target="include"/>
-    <file src="..\src\**\*.*" target="src"/>
-    <file src="SDL2-WinRT.targets" target="build\native"/>
-  </files>
-</package>

+ 0 - 38
Engine/lib/sdl/VisualC-WinRT/SDL2-WinRT.targets

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
-  <PropertyGroup>
-    <LibSDL2-DeviceType Condition="'$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' == '8.1'">WinRT81</LibSDL2-DeviceType>
-    <LibSDL2-DeviceType Condition="'$(TargetPlatformIdentifier)' == 'Windows Phone' and '$(TargetPlatformVersion)' == '8.0'">WinPhone80</LibSDL2-DeviceType>
-    <LibSDL2-DeviceType Condition="'$(TargetPlatformIdentifier)' == 'WindowsPhoneApp' and '$(TargetPlatformVersion)' == '8.1'">WinPhone81</LibSDL2-DeviceType>
-    <LibSDL2-DeviceType Condition="'$(TargetPlatformIdentifier)' == 'UAP'">UWP</LibSDL2-DeviceType>
-
-  	<LibSDL2-BinPath>$(MSBuildThisFileDirectory)..\..\bin\$(LibSDL2-DeviceType)\$(Platform)</LibSDL2-BinPath>
-  </PropertyGroup>
-
-  <Target Name="LibSDL2-DeviceType-Check" BeforeTargets="ResolveAssemblyReferences">
-      <Error Condition="'$(LibSDL2-DeviceType)' == ''" Text="Unable to determine which version of Windows is being built-for" />
-  </Target>
-
-  <ItemDefinitionGroup>
-    <Link>
-      <AdditionalLibraryDirectories>$(LibSDL2-BinPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-  </ItemDefinitionGroup>
-
-  <ItemGroup Label="LibSDL2">
-    <PackagingOutputs Include="$(LibSDL2-BinPath)\SDL2.dll">
-        <OutputGroup>LibSDL2Binaries</OutputGroup>
-        <ProjectName>$(ProjectName)</ProjectName>
-        <TargetPath>%(Filename)%(Extension)</TargetPath>
-    </PackagingOutputs>
-  </ItemGroup>
-
-</Project>

+ 0 - 22
Engine/lib/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec

@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<package >
-  <metadata>
-    <id>SDL2main-WinRT-NonXAML</id>
-    <version>2.0.4-Unofficial</version>
-    <authors>Sam Lantinga</authors>
-    <owners>David Ludwig</owners>
-    <licenseUrl>http://libsdl.org/license.php</licenseUrl>
-    <projectUrl>http://libsdl.org</projectUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>WinMain() function for SDL2 + WinRT + CoreWindow (non-XAML) apps</description>
-    <copyright>Copyright 2015</copyright>
-    <tags>SDL2 SDL LibSDL OpenGL C C++ nativepackage</tags>
-    <dependencies>
-      <dependency id="SDL2-WinRT" version="2.0.4"/>
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\src\main\winrt\SDL_winrt_main_NonXAML.cpp" target="src\main\winrt"/>
-    <file src="SDL2main-WinRT-NonXAML.targets" target="build\native"/>
-  </files>
-</package>

+ 0 - 10
Engine/lib/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
-  <ItemGroup Label="LibSDL2">
-    <ClCompile Include="$(MSBuildThisFileDirectory)..\..\src\main\winrt\SDL_winrt_main_NonXAML.cpp">
-      <CompileAsWinRT>true</CompileAsWinRT>
-    </ClCompile>
-  </ItemGroup>
-
-</Project>

BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png


+ 0 - 42
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
-
-  <Identity Name="1702c480-cf09-431e-a5e4-b21b283ec818"
-            Publisher="CN=David"
-            Version="1.0.0.0" />
-
-  <Properties>
-    <DisplayName>loopwave_VS2012_WinRT</DisplayName>
-    <PublisherDisplayName>David</PublisherDisplayName>
-    <Logo>Assets\StoreLogo.png</Logo>
-  </Properties>
-
-  <Prerequisites>
-    <OSMinVersion>6.2.1</OSMinVersion>
-    <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
-  </Prerequisites>
-
-  <Resources>
-    <Resource Language="x-generate"/>
-  </Resources>
-
-  <Applications>
-    <Application Id="App"
-        Executable="$targetnametoken$.exe"
-        EntryPoint="loopwave_VS2012_WinRT.App">
-        <VisualElements
-            DisplayName="loopwave_VS2012_WinRT"
-            Logo="Assets\Logo.png"
-            SmallLogo="Assets\SmallLogo.png"
-            Description="loopwave_VS2012_WinRT"
-            ForegroundText="light"
-            BackgroundColor="#464646">
-            <DefaultTile ShowName="allLogos" />
-            <SplashScreen Image="Assets\SplashScreen.png" />
-        </VisualElements>
-    </Application>
-  </Applications>
-  <Capabilities>
-    <Capability Name="internetClient" />
-  </Capabilities>
-</Package>

BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png


BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png


+ 0 - 42
Engine/lib/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
-
-  <Identity Name="ca3178f1-b2b2-43bf-97dd-28ee1b7d32c5"
-            Publisher="CN=David"
-            Version="1.0.0.0" />
-
-  <Properties>
-    <DisplayName>testthread_VS2012_WinRT</DisplayName>
-    <PublisherDisplayName>David</PublisherDisplayName>
-    <Logo>Assets\StoreLogo.png</Logo>
-  </Properties>
-
-  <Prerequisites>
-    <OSMinVersion>6.2.1</OSMinVersion>
-    <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
-  </Prerequisites>
-
-  <Resources>
-    <Resource Language="x-generate"/>
-  </Resources>
-
-  <Applications>
-    <Application Id="App"
-        Executable="$targetnametoken$.exe"
-        EntryPoint="testthread_VS2012_WinRT.App">
-        <VisualElements
-            DisplayName="testthread_VS2012_WinRT"
-            Logo="Assets\Logo.png"
-            SmallLogo="Assets\SmallLogo.png"
-            Description="testthread_VS2012_WinRT"
-            ForegroundText="light"
-            BackgroundColor="#464646">
-            <DefaultTile ShowName="allLogos" />
-            <SplashScreen Image="Assets\SplashScreen.png" />
-        </VisualElements>
-    </Application>
-  </Applications>
-  <Capabilities>
-    <Capability Name="internetClient" />
-  </Capabilities>
-</Package>

BIN=BIN
Engine/lib/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx


+ 0 - 146
Engine/lib/sdl/VisualC.html

@@ -1,146 +0,0 @@
-<HTML>
-	<HEAD>
-		<TITLE>Using SDL with Microsoft Visual C++</TITLE>
-	</HEAD>
-	<BODY>
-		<H1>
-			Using SDL with Microsoft Visual C++
-		</H1>
-		<H3>
-			by <A HREF="mailto:[email protected]">Lion Kimbro </A>and additions by <A HREF="mailto:[email protected]">
-				James Turk</A>
-		</H3>
-		<p>
-			You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php"> the SDL Download web site </A>, or you can build SDL yourself.
-		</p>
-		<H3>
-			Building SDL
-		</H3>
-		<P>
-			Go into the VisualC directory and double-click on the Visual Studio solution for your version of Visual Studio, e.g. <CODE>SDL_VS2008.sln</CODE> This should open up the IDE.
-		</P>
-		<P>
-			There are different solution files for the various
-			versions of the IDE. Please use the appropriate version
-			2008, 2010, 2012 or 2013.
-		</P>
-		<P>
-			Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
-		</P>
-		<P>
-			This is done by right clicking on each project in turn (Projects are listed in 
-			the Workspace panel in the FileView tab), and selecting "Build".
-		</P>
-		<P>
-			You may get a few warnings, but you should not get any errors. You do have to 
-			have at least the DirectX 9 SDK installed, however. The latest 
-			version of DirectX can be downloaded from <A HREF="http://www.microsoft.com">Microsoft</A>.
-		</P>
-		<P>
-			Later, we will refer to the following .lib and .dll files that have just been 
-			generated:
-		</P>
-		<ul>
-    <li> SDL2.dll</li>
-    <li> SDL2.lib</li>
-    <li> SDL2main.lib</li>
-    </ul>
-		<P>
-			Search for these using the Windows Find (Windows-F) utility inside the VisualC directory.
-		</P>
-		<H3>
-			Creating a Project with SDL
-		</H3>
-		<P>
-			Create a project as a Win32 Application.
-		</P>
-		<P>
-			Create a C++ file for your project.
-		</P>
-		<P>
-			Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++ 
-				tab|Code Generation|Runtime Library </CODE>.
-		</P>
-		<P>
-			Add the SDL <CODE>include</CODE> directory to your list of includes in the 
-			menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
-			.
-			<br>
-			<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to 
-					add the include and library directories to the list that VC7 keeps. Do this by 
-					selecting Tools|Options|Projects|VC++ Directories and under the "Show 
-					Directories For:" dropbox select "Include Files", and click the "New Directory 
-					Icon" and add the [SDLROOT]\include directory (e.g. If you installed to 
-					c:\SDL\ add c:\SDL\include).&nbsp;Proceed to&nbsp;change the 
-					dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
-		</P>
-			<P>
-				The "include directory" I am referring to is the <CODE>include</CODE> folder 
-				within the main SDL directory (the one that this HTML file located within).
-			</P>
-			<P>
-				Now we're going to use the files that we had created earlier in the Build SDL 
-				step.
-			</P>
-			<P>
-				Copy the following files into your Project directory:
-			</P>
-			<ul>
-     <li> SDL2.dll</li>
-     </ul>
-			<P>
-				Add the following files to your project (It is not necessary to copy them to 
-				your project directory):
-			</P>
-			<ul>
-     <li> SDL2.lib </li>
-     <li> SDL2main.lib</li>
-     </ul>
-			<P>
-				(To add them to your project, right click on your project, and select "Add 
-				files to project")
-			</P>
-		<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more 
-					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.&nbsp; Note: This must be done&nbsp;for&nbsp;each&nbsp;build 
-					configuration (e.g. Release,Debug).</FONT></STRONG></P>
-		<H3>
-			SDL 101, First Day of Class
-		</H3>
-		<P>
-			Now create the basic body of your project. The body of your program should take 
-			the following form:
-			<PRE><CODE>
-#include "SDL.h"
-
-int main( int argc, char* argv[] )
-{
-  // Body of the program goes here.
-  return 0;
-}
-			</CODE></PRE>
-		<P></P>
-		<H3>
-			That's it!
-		</H3>
-		<P>
-			I hope that this document has helped you get through the most difficult part of 
-			using the SDL: installing it. Suggestions for improvements to this document 
-			should be sent to the writers of this document.
-		</P>
-		<P>
-			Thanks to Paulus Esterhazy ([email protected]), for the work on VC++ port.
-		</P>
-		<P>
-			This document was originally called "VisualC.txt", and was written by <A HREF="mailto:[email protected]">
-				Sam Lantinga</A>.
-		</P>
-		<P>
-			Later, it was converted to HTML and expanded into the document that you see 
-			today by <A HREF="mailto:[email protected]">Lion Kimbro</A>.
-		</P>
-		<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:[email protected]">James Turk</A>
-		</P>
-	</BODY>
-</HTML>

+ 112 - 0
Engine/lib/sdl/WhatsNew.txt

@@ -1,6 +1,118 @@
 
 
 This is a list of major changes in SDL's version history.
 This is a list of major changes in SDL's version history.
 
 
+---------------------------------------------------------------------------
+2.0.22:
+---------------------------------------------------------------------------
+
+General:
+* Added the hint SDL_HINT_JOYSTICK_ROG_CHAKRAM to control whether ROG Chakram mice show up as joysticks
+
+
+---------------------------------------------------------------------------
+2.0.20:
+---------------------------------------------------------------------------
+
+General:
+* SDL_RenderGeometryRaw() takes a pointer to SDL_Color, not int. You can cast color data in SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888 on little endian systems) for this parameter.
+* Improved accuracy of horizontal and vertical line drawing when using OpenGL or OpenGLES
+* Added the hint SDL_HINT_RENDER_LINE_METHOD to control the method of line drawing used, to select speed, correctness, and compatibility.
+
+Windows:
+* Fixed size of custom cursors
+
+Linux:
+* Fixed hotplug controller detection, broken in 2.0.18
+
+
+---------------------------------------------------------------------------
+2.0.18:
+---------------------------------------------------------------------------
+
+General:
+* The SDL wiki documentation and development headers are automatically kept in sync
+* Each function has information about in which version of SDL it was introduced
+* SDL-specific CMake options are now prefixed with 'SDL_'. Be sure to update your CMake build scripts accordingly!
+* Added the hint SDL_HINT_APP_NAME to let SDL know the name of your application for various places it might show up in system information
+* Added SDL_RenderGeometry() and SDL_RenderGeometryRaw() to allow rendering of arbitrary shapes using the SDL 2D render API
+* Added SDL_SetTextureUserData() and SDL_GetTextureUserData() to associate application data with an SDL texture
+* Added SDL_RenderWindowToLogical() and SDL_RenderLogicalToWindow() to convert between window coordinates and logical render coordinates
+* Added SDL_RenderSetVSync() to change whether a renderer present is synchronized with vblank at runtime
+* Added SDL_PremultiplyAlpha() to premultiply alpha on a block of SDL_PIXELFORMAT_ARGB8888 pixels
+* Added a window event SDL_WINDOWEVENT_DISPLAY_CHANGED which is sent when a window changes what display it's centered on
+* Added SDL_GetWindowICCProfile() to query a window's ICC profile, and a window event SDL_WINDOWEVENT_ICCPROF_CHANGED that is sent when it changes
+* Added the hint SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY to allow EGL windows to be transparent instead of opaque
+* SDL_WaitEvent() has been redesigned to use less CPU in most cases
+* Added SDL_SetWindowMouseRect() and SDL_GetWindowMouseRect() to confine the mouse cursor to an area of a window
+* You can now read precise mouse wheel motion using 'preciseX' and 'preciseY' event fields
+* Added SDL_GameControllerHasRumble() and SDL_GameControllerHasRumbleTriggers() to query whether a game controller supports rumble
+* Added SDL_JoystickHasRumble() and SDL_JoystickHasRumbleTriggers() to query whether a joystick supports rumble
+* SDL's hidapi implementation is now available as a public API in SDL_hidapi.h
+
+Windows:
+* Improved relative mouse motion over Windows Remote Desktop
+* Added the hint SDL_HINT_IME_SHOW_UI to show native UI components instead of hiding them (defaults off)
+
+Windows/UWP:
+* WGI is used instead of XInput for better controller support in UWP apps
+
+Linux:
+* Added the hint SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME to set the activity that's displayed by the system when the screensaver is disabled
+* Added the hint SDL_HINT_LINUX_JOYSTICK_CLASSIC to control whether /dev/input/js* or /dev/input/event* are used as joystick devices
+* Added the hint SDL_HINT_JOYSTICK_DEVICE to allow the user to specify devices that will be opened in addition to the normal joystick detection
+* Added SDL_LinuxSetThreadPriorityAndPolicy() for more control over a thread priority on Linux
+
+Android:
+* Added support for audio output and capture using AAudio on Android 8.1 and newer
+* Steam Controller support is disabled by default, and can be enabled by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()
+
+Apple Arcade:
+* Added SDL_GameControllerGetAppleSFSymbolsNameForButton() and SDL_GameControllerGetAppleSFSymbolsNameForAxis() to support Apple Arcade titles
+
+iOS:
+* Added documentation that the UIApplicationSupportsIndirectInputEvents key must be set to true in your application's Info.plist in order to get real Bluetooth mouse events.
+* Steam Controller support is disabled by default, and can be enabled by setting the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM to "1" before calling SDL_Init()
+
+
+---------------------------------------------------------------------------
+2.0.16:
+---------------------------------------------------------------------------
+General:
+* Added SDL_FlashWindow() to get a user's attention
+* Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
+* Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
+* Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
+* Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
+* Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
+* Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
+* Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
+* Added support for the Amazon Luna game controller
+* Added rumble support for the Google Stadia controller using the HIDAPI driver
+* Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
+* Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
+* Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()
+
+Windows:
+* Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
+* Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer
+
+Linux:
+* Greatly improved Wayland support
+* Added support for audio output and capture using Pipewire
+* Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
+* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels
+
+Android:
+* Added SDL_AndroidShowToast() to show a lightweight notification
+
+iOS:
+* Added support for mouse relative mode on iOS 14.1 and newer
+* Added support for the Xbox Series X controller
+
+tvOS:
+* Added support for the Xbox Series X controller
+
+
 ---------------------------------------------------------------------------
 ---------------------------------------------------------------------------
 2.0.14:
 2.0.14:
 ---------------------------------------------------------------------------
 ---------------------------------------------------------------------------

+ 4 - 0
Engine/lib/sdl/Xcode-iOS/Demos/Info.plist

@@ -16,6 +16,8 @@
 	<string>6.0</string>
 	<string>6.0</string>
 	<key>CFBundleName</key>
 	<key>CFBundleName</key>
 	<string>${PRODUCT_NAME}</string>
 	<string>${PRODUCT_NAME}</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0.0</string>
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
@@ -28,5 +30,7 @@
 	<string>iOS Launch Screen</string>
 	<string>iOS Launch Screen</string>
 	<key>UISupportedInterfaceOrientations</key>
 	<key>UISupportedInterfaceOrientations</key>
 	<array/>
 	<array/>
+	<key>UIApplicationSupportsIndirectInputEvents</key>
+	<true/>
 </dict>
 </dict>
 </plist>
 </plist>

+ 1 - 1
Engine/lib/sdl/Xcode-iOS/Demos/src/accelerometer.c

@@ -58,7 +58,7 @@ render(SDL_Renderer *renderer, int w, int h, double deltaTime)
         ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
         ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT *
         deltaMilliseconds;
         deltaMilliseconds;
 
 
-    speed = sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
+    speed = SDL_sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy);
 
 
     if (speed > 0) {
     if (speed > 0) {
         /* compensate for friction */
         /* compensate for friction */

+ 6 - 6
Engine/lib/sdl/Xcode-iOS/Demos/src/fireworks.c

@@ -109,7 +109,7 @@ stepParticles(double deltaTime)
                 }
                 }
             } else {
             } else {
                 float speed =
                 float speed =
-                    sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel);
+                    SDL_sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel);
                 /*      if wind resistance is not powerful enough to stop us completely,
                 /*      if wind resistance is not powerful enough to stop us completely,
                    then apply winde resistance, otherwise just stop us completely */
                    then apply winde resistance, otherwise just stop us completely */
                 if (WIND_RESISTANCE * deltaMilliseconds < speed) {
                 if (WIND_RESISTANCE * deltaMilliseconds < speed) {
@@ -194,15 +194,15 @@ explodeEmitter(struct particle *emitter)
         /* come up with a random angle and speed for new particle */
         /* come up with a random angle and speed for new particle */
         float theta = randomFloat(0, 2.0f * 3.141592);
         float theta = randomFloat(0, 2.0f * 3.141592);
         float exponent = 3.0f;
         float exponent = 3.0f;
-        float speed = randomFloat(0.00, powf(0.17, exponent));
-        speed = powf(speed, 1.0f / exponent);
+        float speed = randomFloat(0.00, SDL_powf(0.17, exponent));
+        speed = SDL_powf(speed, 1.0f / exponent);
 
 
         /* select the particle at the end of our array */
         /* select the particle at the end of our array */
         struct particle *p = &particles[num_active_particles];
         struct particle *p = &particles[num_active_particles];
 
 
         /* set the particles properties */
         /* set the particles properties */
-        p->xvel = speed * cos(theta);
-        p->yvel = speed * sin(theta);
+        p->xvel = speed * SDL_cos(theta);
+        p->yvel = speed * SDL_sin(theta);
         p->x = emitter->x + emitter->xvel;
         p->x = emitter->x + emitter->xvel;
         p->y = emitter->y + emitter->yvel;
         p->y = emitter->y + emitter->yvel;
         p->isActive = 1;
         p->isActive = 1;
@@ -297,7 +297,7 @@ spawnEmitterParticle(GLfloat x, GLfloat y)
     p->y = screen_h;
     p->y = screen_h;
     /* set velocity so that terminal point is (x,y) */
     /* set velocity so that terminal point is (x,y) */
     p->xvel = 0;
     p->xvel = 0;
-    p->yvel = -sqrt(2 * ACCEL * (screen_h - y));
+    p->yvel = -SDL_sqrt(2 * ACCEL * (screen_h - y));
     /* set other attributes */
     /* set other attributes */
     p->size = 10 * pointSizeScale;
     p->size = 10 * pointSizeScale;
     p->type = emitter;
     p->type = emitter;

+ 1 - 1
Engine/lib/sdl/Xcode-iOS/Demos/src/mixer.c

@@ -111,7 +111,7 @@ loadSound(const char *file, struct sound *s)
         if (SDL_ConvertAudio(&cvt) == -1) {     /* convert the sound */
         if (SDL_ConvertAudio(&cvt) == -1) {     /* convert the sound */
             fatalError("could not convert .wav");
             fatalError("could not convert .wav");
         }
         }
-        SDL_free(s->buffer);    /* free the original (unconverted) buffer */
+        SDL_free(s->buffer);    /* Free the original (unconverted) buffer */
         s->buffer = cvt.buf;    /* point sound buffer to converted buffer */
         s->buffer = cvt.buf;    /* point sound buffer to converted buffer */
         s->length = cvt.len_cvt;        /* set sound buffer's new length */
         s->length = cvt.len_cvt;        /* set sound buffer's new length */
     }
     }

+ 24 - 14
Engine/lib/sdl/Xcode-iOS/Demos/src/touch.c

@@ -21,7 +21,7 @@ void
 drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy)
 drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy)
 {
 {
 
 
-    float distance = sqrt(dx * dx + dy * dy);   /* length of line segment (pythagoras) */
+    float distance = SDL_sqrt(dx * dx + dy * dy);   /* length of line segment (pythagoras) */
     int iterations = distance / PIXELS_PER_ITERATION + 1;       /* number of brush sprites to draw for the line */
     int iterations = distance / PIXELS_PER_ITERATION + 1;       /* number of brush sprites to draw for the line */
     float dx_prime = dx / iterations;   /* x-shift per iteration */
     float dx_prime = dx / iterations;   /* x-shift per iteration */
     float dy_prime = dy / iterations;   /* y-shift per iteration */
     float dy_prime = dy / iterations;   /* y-shift per iteration */
@@ -81,6 +81,7 @@ main(int argc, char *argv[])
     SDL_Event event;
     SDL_Event event;
     SDL_Window *window;         /* main window */
     SDL_Window *window;         /* main window */
     SDL_Renderer *renderer;
     SDL_Renderer *renderer;
+    SDL_Texture *target;
     int done;                   /* does user want to quit? */
     int done;                   /* does user want to quit? */
     int w, h;
     int w, h;
 
 
@@ -100,29 +101,38 @@ main(int argc, char *argv[])
     initializeTexture(renderer);
     initializeTexture(renderer);
 
 
     /* fill canvass initially with all black */
     /* fill canvass initially with all black */
+    target = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, w, h);
+    SDL_SetRenderTarget(renderer, target);
     SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
     SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
     SDL_RenderClear(renderer);
     SDL_RenderClear(renderer);
-    SDL_RenderPresent(renderer);
+    SDL_SetRenderTarget(renderer, NULL);
 
 
     done = 0;
     done = 0;
-    while (!done && SDL_WaitEvent(&event)) {
-        switch (event.type) {
-        case SDL_QUIT:
-            done = 1;
-            break;
-        case SDL_MOUSEMOTION:
-            state = SDL_GetMouseState(&x, &y);  /* get its location */
-            SDL_GetRelativeMouseState(&dx, &dy);        /* find how much the mouse moved */
-            if (state & SDL_BUTTON_LMASK) {     /* is the mouse (touch) down? */
-                drawLine(renderer, x - dx, y - dy, dx, dy);       /* draw line segment */
-                SDL_RenderPresent(renderer);
+    while (!done) {
+        while (SDL_PollEvent(&event) == 1) {
+            switch (event.type) {
+            case SDL_QUIT:
+                done = 1;
+                break;
+            case SDL_MOUSEMOTION:
+                state = SDL_GetMouseState(&x, &y);  /* get its location */
+                SDL_GetRelativeMouseState(&dx, &dy);        /* find how much the mouse moved */
+                if (state & SDL_BUTTON_LMASK) {     /* is the mouse (touch) down? */
+                    SDL_SetRenderTarget(renderer, target);
+                    drawLine(renderer, x - dx, y - dy, dx, dy);       /* draw line segment */
+                    SDL_SetRenderTarget(renderer, NULL);
+                }
+                break;
             }
             }
-            break;
         }
         }
+
+        SDL_RenderCopy(renderer, target, NULL, NULL);
+        SDL_RenderPresent(renderer);
     }
     }
 
 
     /* cleanup */
     /* cleanup */
     SDL_DestroyTexture(brush);
     SDL_DestroyTexture(brush);
+    SDL_DestroyTexture(target);
     SDL_Quit();
     SDL_Quit();
 
 
     return 0;
     return 0;

BIN=BIN
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/[email protected]


BIN=BIN
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png


BIN=BIN
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png


+ 0 - 28
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleDisplayName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundleExecutable</key>
-	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleIconFile</key>
-	<string>Icon</string>
-	<key>CFBundleIdentifier</key>
-	<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>LSRequiresIPhoneOS</key>
-	<false/>
-</dict>
-</plist>

BIN=BIN
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns


+ 0 - 10
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Description</key>
-	<string>This project builds an SDL based project for iPhone OS using C or Objective-C.  It includes everything you need to get up and running with SDL on iPhone.</string>
-	<key>CFBundleIconFile</key>
-	<string>Icon.png</string>
-</dict>
-</plist>

+ 0 - 500
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj

@@ -1,500 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
-		1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
-		28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
-		28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
-		945C4F53195AF17F00DBBF61 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 945C4F52195AF17F00DBBF61 /* [email protected] */; };
-		F3A497AC2555F0BD00E92A8B /* CoreHaptics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A497AB2555F0BD00E92A8B /* CoreHaptics.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
-		F3A497AD2555F0C000E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A4978F2555F07100E92A8B /* libSDL2.a */; };
-		F3A497B02555F0FF00E92A8B /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A497AF2555F0FF00E92A8B /* Metal.framework */; };
-		F3A497B32555F11600E92A8B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A497B22555F11600E92A8B /* AVFoundation.framework */; };
-		FA8B4B97196703B400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4B96196703B400F8EB7C /* CoreMotion.framework */; };
-		FAE0E9651BAF967F0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9641BAF967F0098DFA4 /* GameController.framework */; };
-		FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; };
-		FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07C0E26BD8C00F39101 /* Icon.png */; };
-		FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; };
-		FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD77A0840E26BDB800F39101 /* AudioToolbox.framework */; };
-		FD77A09D0E26BDE500F39101 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A09C0E26BDE500F39101 /* main.c */; };
-		FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		F3A497862555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF66C0761BA81005FE872;
-			remoteInfo = Framework;
-		};
-		F3A497882555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A7D88B5423E2437C00DCD162;
-			remoteInfo = "Framework-iOS";
-		};
-		F3A4978A2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A7D88D1523E24BED00DCD162;
-			remoteInfo = "Framework-tvOS";
-		};
-		F3A4978C2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF6B30761BA81005FE872;
-			remoteInfo = "Static Library";
-		};
-		F3A4978E2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A7D88E5423E24D3B00DCD162;
-			remoteInfo = "Static Library-iOS";
-		};
-		F3A497902555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A769B23D23E259AE00872273;
-			remoteInfo = "Static Library-tvOS";
-		};
-		F3A497922555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = DB31407717554B71006C0E22;
-			remoteInfo = "Shared Library";
-		};
-		F3A497942555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A75FCEB323E25AB700529352;
-			remoteInfo = "Shared Library-iOS";
-		};
-		F3A497962555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A75FD06C23E25AC700529352;
-			remoteInfo = "Shared Library-tvOS";
-		};
-		F3A497982555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF6BE0761BA81005FE872;
-			remoteInfo = "Standard DMG";
-		};
-		F3A4979A2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A75FDB8C23E4C74400529352;
-			remoteInfo = hidapi;
-		};
-		F3A4979C2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A75FDB4923E399AC00529352;
-			remoteInfo = "hidapi-iOS";
-		};
-		F3A4979E2555F07100E92A8B /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = A75FDB6E23E3A2C900529352;
-			remoteInfo = "hidapi-tvOS";
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-		1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
-		1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
-		28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
-		28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
-		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		944A65681957463F0094A81E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../../../Xcode/SDL/SDL.xcodeproj; sourceTree = "<group>"; };
-		945C4F52195AF17F00DBBF61 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
-		F3A497AB2555F0BD00E92A8B /* CoreHaptics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreHaptics.framework; path = System/Library/Frameworks/CoreHaptics.framework; sourceTree = SDKROOT; };
-		F3A497AF2555F0FF00E92A8B /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
-		F3A497B22555F11600E92A8B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
-		FA8B4B96196703B400F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
-		FAE0E9641BAF967F0098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
-		FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
-		FD77A07C0E26BD8C00F39101 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
-		FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
-		FD77A0840E26BDB800F39101 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
-		FD77A09C0E26BDE500F39101 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
-		FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F3A497AD2555F0C000E92A8B /* libSDL2.a in Frameworks */,
-				FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */,
-				F3A497B32555F11600E92A8B /* AVFoundation.framework in Frameworks */,
-				1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
-				FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */,
-				FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */,
-				F3A497AC2555F0BD00E92A8B /* CoreHaptics.framework in Frameworks */,
-				FA8B4B97196703B400F8EB7C /* CoreMotion.framework in Frameworks */,
-				FAE0E9651BAF967F0098DFA4 /* GameController.framework in Frameworks */,
-				F3A497B02555F0FF00E92A8B /* Metal.framework in Frameworks */,
-				28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */,
-				28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */,
-				1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
-			isa = PBXGroup;
-			children = (
-				945C4F52195AF17F00DBBF61 /* [email protected] */,
-				29B97315FDCFA39411CA2CEA /* Sources */,
-				29B97317FDCFA39411CA2CEA /* Resources */,
-				29B97323FDCFA39411CA2CEA /* Frameworks */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = CustomTemplate;
-			sourceTree = "<group>";
-		};
-		29B97315FDCFA39411CA2CEA /* Sources */ = {
-			isa = PBXGroup;
-			children = (
-				944A65681957463F0094A81E /* SDL.xcodeproj */,
-				FD77A09C0E26BDE500F39101 /* main.c */,
-			);
-			name = Sources;
-			sourceTree = "<group>";
-		};
-		29B97317FDCFA39411CA2CEA /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				FD77A07E0E26BDA900F39101 /* Default.png */,
-				FD77A07C0E26BD8C00F39101 /* Icon.png */,
-				8D1107310486CEB800E47090 /* Info.plist */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				F3A497B22555F11600E92A8B /* AVFoundation.framework */,
-				F3A497AF2555F0FF00E92A8B /* Metal.framework */,
-				F3A497AB2555F0BD00E92A8B /* CoreHaptics.framework */,
-				FAE0E9641BAF967F0098DFA4 /* GameController.framework */,
-				FA8B4B96196703B400F8EB7C /* CoreMotion.framework */,
-				FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */,
-				FD77A0840E26BDB800F39101 /* AudioToolbox.framework */,
-				FD779EDD0E26BA1200F39101 /* CoreAudio.framework */,
-				28FD15070DC6FC5B0079059D /* QuartzCore.framework */,
-				28FD14FF0DC6FC520079059D /* OpenGLES.framework */,
-				1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
-				1D30AB110D05D00D00671497 /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		F3A497772555F07100E92A8B /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				F3A497872555F07100E92A8B /* SDL2.framework */,
-				F3A497892555F07100E92A8B /* SDL2.framework */,
-				F3A4978B2555F07100E92A8B /* SDL2.framework */,
-				F3A4978D2555F07100E92A8B /* libSDL2.a */,
-				F3A4978F2555F07100E92A8B /* libSDL2.a */,
-				F3A497912555F07100E92A8B /* libSDL2.a */,
-				F3A497932555F07100E92A8B /* libSDL2.dylib */,
-				F3A497952555F07100E92A8B /* libSDL2.dylib */,
-				F3A497972555F07100E92A8B /* libSDL2.dylib */,
-				F3A497992555F07100E92A8B /* SDL2 */,
-				F3A4979B2555F07100E92A8B /* hidapi.framework */,
-				F3A4979D2555F07100E92A8B /* hidapi.framework */,
-				F3A4979F2555F07100E92A8B /* hidapi.framework */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
-			buildPhases = (
-				1D60588D0D05DD3D006BFB54 /* Resources */,
-				1D60588E0D05DD3D006BFB54 /* Sources */,
-				1D60588F0D05DD3D006BFB54 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "___PROJECTNAME___";
-			productName = "___PROJECTNAME___";
-			productReference = 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0510;
-			};
-			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
-			projectDirPath = "";
-			projectReferences = (
-				{
-					ProductGroup = F3A497772555F07100E92A8B /* Products */;
-					ProjectRef = 944A65681957463F0094A81E /* SDL.xcodeproj */;
-				},
-			);
-			projectRoot = "";
-			targets = (
-				1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
-		F3A497872555F07100E92A8B /* SDL2.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = SDL2.framework;
-			remoteRef = F3A497862555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497892555F07100E92A8B /* SDL2.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = SDL2.framework;
-			remoteRef = F3A497882555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4978B2555F07100E92A8B /* SDL2.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = SDL2.framework;
-			remoteRef = F3A4978A2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4978D2555F07100E92A8B /* libSDL2.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2.a;
-			remoteRef = F3A4978C2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4978F2555F07100E92A8B /* libSDL2.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2.a;
-			remoteRef = F3A4978E2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497912555F07100E92A8B /* libSDL2.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2.a;
-			remoteRef = F3A497902555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497932555F07100E92A8B /* libSDL2.dylib */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.dylib";
-			path = libSDL2.dylib;
-			remoteRef = F3A497922555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497952555F07100E92A8B /* libSDL2.dylib */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.dylib";
-			path = libSDL2.dylib;
-			remoteRef = F3A497942555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497972555F07100E92A8B /* libSDL2.dylib */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.dylib";
-			path = libSDL2.dylib;
-			remoteRef = F3A497962555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A497992555F07100E92A8B /* SDL2 */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.executable";
-			path = SDL2;
-			remoteRef = F3A497982555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4979B2555F07100E92A8B /* hidapi.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = hidapi.framework;
-			remoteRef = F3A4979A2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4979D2555F07100E92A8B /* hidapi.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = hidapi.framework;
-			remoteRef = F3A4979C2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		F3A4979F2555F07100E92A8B /* hidapi.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = hidapi.framework;
-			remoteRef = F3A4979E2555F07100E92A8B /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
-		1D60588D0D05DD3D006BFB54 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */,
-				FD77A07F0E26BDA900F39101 /* Default.png in Resources */,
-				945C4F53195AF17F00DBBF61 /* [email protected] in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		1D60588E0D05DD3D006BFB54 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FD77A09D0E26BDE500F39101 /* main.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		1D6058940D05DD3E006BFB54 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "";
-				INFOPLIST_FILE = Info.plist;
-				LIBRARY_SEARCH_PATHS = "$(inherited)";
-				PRODUCT_NAME = "___PROJECTNAME___";
-				USER_HEADER_SEARCH_PATHS = ../../../include;
-			};
-			name = Debug;
-		};
-		1D6058950D05DD3E006BFB54 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = YES;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "";
-				INFOPLIST_FILE = Info.plist;
-				LIBRARY_SEARCH_PATHS = "$(inherited)";
-				PRODUCT_NAME = "___PROJECTNAME___";
-				USER_HEADER_SEARCH_PATHS = ../../../include;
-			};
-			name = Release;
-		};
-		C01FCF4F08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				ONLY_ACTIVE_ARCH = YES;
-				OTHER_CFLAGS = "";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-			};
-			name = Debug;
-		};
-		C01FCF5008A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				OTHER_CFLAGS = "";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1D6058940D05DD3E006BFB54 /* Debug */,
-				1D6058950D05DD3E006BFB54 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4F08A954540054247B /* Debug */,
-				C01FCF5008A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}

+ 0 - 100
Engine/lib/sdl/Xcode-iOS/Template/SDL iOS Application/main.c

@@ -1,100 +0,0 @@
-/*
- *  rectangles.c
- *  written by Holmes Futrell
- *  use however you want
- */
-
-#include "SDL.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 480
-
-int
-randomInt(int min, int max)
-{
-    return min + rand() % (max - min + 1);
-}
-
-void
-render(SDL_Renderer *renderer)
-{
-
-    SDL_Rect rect;
-    Uint8 r, g, b;
-
-    /* Clear the screen */
-    SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
-    SDL_RenderClear(renderer);
-
-    /*  Come up with a random rectangle */
-    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);
-    SDL_SetRenderDrawColor(renderer, r, g, b, 255);
-
-    /*  Fill the rectangle in the color */
-    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;
-
-    /* initialize SDL */
-    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
-        printf("Could not initialize SDL\n");
-        return 1;
-    }
-
-    /* seed random number generator */
-    srand(time(NULL));
-
-    /* create window and renderer */
-    window =
-        SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
-                         SDL_WINDOW_OPENGL);
-    if (!window) {
-        printf("Could not initialize Window\n");
-        return 1;
-    }
-
-    renderer = SDL_CreateRenderer(window, -1, 0);
-    if (!renderer) {
-        printf("Could not create renderer\n");
-        return 1;
-    }
-
-    /* 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;
-}

+ 2 - 2
Engine/lib/sdl/Xcode/SDL/Info-Framework.plist

@@ -19,10 +19,10 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>2.0.14</string>
+	<string>2.0.21</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>SDLX</string>
 	<string>SDLX</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>2.0.14</string>
+	<string>2.0.21</string>
 </dict>
 </dict>
 </plist>
 </plist>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 19 - 381
Engine/lib/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj


+ 0 - 22
Engine/lib/sdl/Xcode/SDL/hidapi/Info.plist

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
-	<key>CFBundleExecutable</key>
-	<string>$(EXECUTABLE_NAME)</string>
-	<key>CFBundleIdentifier</key>
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>$(PRODUCT_NAME)</string>
-	<key>CFBundlePackageType</key>
-	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
-	<key>CFBundleShortVersionString</key>
-	<string>$(CURRENT_PROJECT_VERSION)</string>
-	<key>CFBundleVersion</key>
-	<string>$(CURRENT_PROJECT_VERSION)</string>
-</dict>
-</plist>

+ 1 - 1
Engine/lib/sdl/Xcode/SDL/pkg-support/resources/License.txt

@@ -1,6 +1,6 @@
 
 
 Simple DirectMedia Layer
 Simple DirectMedia Layer
-Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
   
   
 This software is provided 'as-is', without any express or implied
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
 warranty.  In no event will the authors be held liable for any damages

+ 5 - 6
Engine/lib/sdl/acinclude/alsa.m4

@@ -72,11 +72,10 @@ no_alsa=""
     alsa_min_micro_version=`echo $min_alsa_version | \
     alsa_min_micro_version=`echo $min_alsa_version | \
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
 
-AC_LANG_SAVE
-AC_LANG_C
-AC_TRY_COMPILE([
+AC_LANG_PUSH([C])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <alsa/asoundlib.h>
 #include <alsa/asoundlib.h>
-], [
+]], [[
 /* ensure backward compatibility */
 /* ensure backward compatibility */
 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
@@ -108,13 +107,13 @@ AC_TRY_COMPILE([
 #    endif
 #    endif
 #  endif
 #  endif
 exit(0);
 exit(0);
-],
+]])],
   [AC_MSG_RESULT(found.)],
   [AC_MSG_RESULT(found.)],
   [AC_MSG_RESULT(not present.)
   [AC_MSG_RESULT(not present.)
    ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
    ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
    alsa_found=no]
    alsa_found=no]
 )
 )
-AC_LANG_RESTORE
+AC_LANG_POP([C])
 
 
 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
 if test "x$enable_alsatest" = "xyes"; then
 if test "x$enable_alsatest" = "xyes"; then

+ 38 - 30
Engine/lib/sdl/acinclude/esd.m4

@@ -8,7 +8,7 @@ dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
 dnl
 dnl
 AC_DEFUN([AM_PATH_ESD],
 AC_DEFUN([AM_PATH_ESD],
-[dnl 
+[dnl
 dnl Get the cflags and libraries from the esd-config script
 dnl Get the cflags and libraries from the esd-config script
 dnl
 dnl
 AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
 AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
@@ -48,6 +48,7 @@ AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run
     esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
     esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     if test "x$enable_esdtest" = "xyes" ; then
     if test "x$enable_esdtest" = "xyes" ; then
+      AC_LANG_PUSH([C])
       ac_save_CFLAGS="$CFLAGS"
       ac_save_CFLAGS="$CFLAGS"
       ac_save_LIBS="$LIBS"
       ac_save_LIBS="$LIBS"
       CFLAGS="$CFLAGS $ESD_CFLAGS"
       CFLAGS="$CFLAGS $ESD_CFLAGS"
@@ -57,38 +58,19 @@ dnl Now check if the installed ESD is sufficiently new. (Also sanity
 dnl checks the results of esd-config to some extent
 dnl checks the results of esd-config to some extent
 dnl
 dnl
       rm -f conf.esdtest
       rm -f conf.esdtest
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
-#include <string.h>
 #include <esd.h>
 #include <esd.h>
 
 
-char*
-my_strdup (char *str)
-{
-  char *new_str;
-  
-  if (str)
-    {
-      new_str = malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
-    }
-  else
-    new_str = NULL;
-  
-  return new_str;
-}
-
-int main ()
+int main (void)
 {
 {
   int major, minor, micro;
   int major, minor, micro;
-  char *tmp_version;
+  FILE *fp = fopen("conf.esdtest", "w");
 
 
-  system ("touch conf.esdtest");
+  if (fp) fclose(fp);
 
 
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_esd_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+  if (sscanf("$min_esd_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
      printf("%s, bad version string\n", "$min_esd_version");
      printf("%s, bad version string\n", "$min_esd_version");
      exit(1);
      exit(1);
    }
    }
@@ -110,15 +92,15 @@ int main ()
       return 1;
       return 1;
     }
     }
 }
 }
-
-],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+]])], [], [no_esd=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
        CFLAGS="$ac_save_CFLAGS"
        CFLAGS="$ac_save_CFLAGS"
        LIBS="$ac_save_LIBS"
        LIBS="$ac_save_LIBS"
+       AC_LANG_POP([C])
      fi
      fi
   fi
   fi
   if test "x$no_esd" = x ; then
   if test "x$no_esd" = x ; then
      AC_MSG_RESULT(yes)
      AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])     
+     ifelse([$2], , :, [$2])
   else
   else
      AC_MSG_RESULT(no)
      AC_MSG_RESULT(no)
      if test "$ESD_CONFIG" = "no" ; then
      if test "$ESD_CONFIG" = "no" ; then
@@ -133,10 +115,11 @@ int main ()
           echo "*** Could not run ESD test program, checking why..."
           echo "*** Could not run ESD test program, checking why..."
           CFLAGS="$CFLAGS $ESD_CFLAGS"
           CFLAGS="$CFLAGS $ESD_CFLAGS"
           LIBS="$LIBS $ESD_LIBS"
           LIBS="$LIBS $ESD_LIBS"
-          AC_TRY_LINK([
+          AC_LANG_PUSH([C])
+          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
 #include <stdio.h>
 #include <esd.h>
 #include <esd.h>
-],      [ return 0; ],
+]], [[ return 0; ]])],
         [ echo "*** The test program compiled, but did not run. This usually means"
         [ echo "*** The test program compiled, but did not run. This usually means"
           echo "*** that the run-time linker is not finding ESD or finding the wrong"
           echo "*** that the run-time linker is not finding ESD or finding the wrong"
           echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
           echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
@@ -152,6 +135,7 @@ int main ()
           echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
           echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
           CFLAGS="$ac_save_CFLAGS"
           CFLAGS="$ac_save_CFLAGS"
           LIBS="$ac_save_LIBS"
           LIBS="$ac_save_LIBS"
+          AC_LANG_POP([C])
        fi
        fi
      fi
      fi
      ESD_CFLAGS=""
      ESD_CFLAGS=""
@@ -162,3 +146,27 @@ int main ()
   AC_SUBST(ESD_LIBS)
   AC_SUBST(ESD_LIBS)
   rm -f conf.esdtest
   rm -f conf.esdtest
 ])
 ])
+
+dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
+dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
+dnl
+AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD],
+[dnl
+  AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
+  ac_save_ESD_CFLAGS="$ESD_CFLAGS"
+  ac_save_ESD_LIBS="$ESD_LIBS"
+  AM_PATH_ESD(0.2.21,
+    ifelse([$1], , [
+      AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
+      AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
+	[Define if you have esound with support of multiple recording clients.])],
+    [$1]),
+    ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
+    if test "x$ac_save_ESD_CFLAGS" != x ; then
+       ESD_CFLAGS="$ac_save_ESD_CFLAGS"
+    fi
+    if test "x$ac_save_ESD_LIBS" != x ; then
+       ESD_LIBS="$ac_save_ESD_LIBS"
+    fi
+  )
+])

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 251 - 176
Engine/lib/sdl/acinclude/libtool.m4


+ 90 - 37
Engine/lib/sdl/acinclude/ltoptions.m4

@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #   Written by Gary V. Vaughan, 2004
 #
 #
 # This file is free software; the Free Software Foundation gives
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 # modifications, as long as this notice is preserved.
 
 
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
 
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
 ])
 ])
 
 
 
 
@@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[
   dnl
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
   dnl archives by default:
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
+		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+		   [_LT_WITH_AIX_SONAME([aix])])
   ])
   ])
 ])# _LT_SET_OPTIONS
 ])# _LT_SET_OPTIONS
 
 
@@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
 ])
 ])
 
 
 dnl aclocal-1.4 backwards compatibility:
 dnl aclocal-1.4 backwards compatibility:
@@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
 ])
 ])
 
 
 dnl aclocal-1.4 backwards compatibility:
 dnl aclocal-1.4 backwards compatibility:
@@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
 
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
 # ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_SHARED],
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
 AC_ARG_ENABLE([shared],
@@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared],
     *)
     *)
       enable_shared=no
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	  enable_shared=yes
 	fi
 	fi
       done
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
       ;;
     esac],
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
 
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
 # ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_STATIC],
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
 AC_ARG_ENABLE([static],
@@ -226,14 +228,14 @@ AC_ARG_ENABLE([static],
     *)
     *)
      enable_static=no
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	  enable_static=yes
 	fi
 	fi
       done
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
       ;;
     esac],
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
 
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
 AC_ARG_ENABLE([fast-install],
@@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install],
     *)
     *)
       enable_fast_install=no
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	  enable_fast_install=yes
 	fi
 	fi
       done
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
       ;;
     esac],
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
 ])
 ])
 
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
 ])
 ])
 
 
 dnl aclocal-1.4 backwards compatibility:
 dnl aclocal-1.4 backwards compatibility:
@@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
 
 
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
 # _LT_WITH_PIC([MODE])
 # _LT_WITH_PIC([MODE])
 # --------------------
 # --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
 # LT_INIT options.
 # LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
 m4_define([_LT_WITH_PIC],
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC],
     *)
     *)
       pic_mode=default
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	  pic_mode=yes
 	fi
 	fi
       done
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
       ;;
     esac],
     esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+    [pic_mode=m4_default([$1], [default])])
 
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
 ])# _LT_WITH_PIC
@@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
 ])
 ])
 
 
 dnl aclocal-1.4 backwards compatibility:
 dnl aclocal-1.4 backwards compatibility:

+ 4 - 3
Engine/lib/sdl/acinclude/ltsugar.m4

@@ -1,6 +1,7 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
 #
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 # Written by Gary V. Vaughan, 2004
 #
 #
 # This file is free software; the Free Software Foundation gives
 # This file is free software; the Free Software Foundation gives
@@ -33,7 +34,7 @@ m4_define([_lt_join],
 # ------------
 # ------------
 # Manipulate m4 lists.
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -44,7 +45,7 @@ m4_define([lt_unquote], $1)
 
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different

+ 6 - 6
Engine/lib/sdl/acinclude/ltversion.m4

@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
 #
-#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #   Written by Scott James Remnant, 2004
 #
 #
 # This file is free software; the Free Software Foundation gives
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 
 # @configure_input@
 # @configure_input@
 
 
-# serial 3337 ltversion.m4
+# serial 4179 ltversion.m4
 # This file is part of GNU Libtool
 # This file is part of GNU Libtool
 
 
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
 
 
 AC_DEFUN([LTVERSION_VERSION],
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 _LT_DECL(, macro_revision, 0)
 ])
 ])

+ 4 - 3
Engine/lib/sdl/acinclude/lt~obsolete.m4

@@ -1,6 +1,7 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #   Written by Scott James Remnant, 2004.
 #
 #
 # This file is free software; the Free Software Foundation gives
 # This file is free software; the Free Software Foundation gives
@@ -11,7 +12,7 @@
 
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
 # which have later been changed to m4_define as they aren't part of the
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 # exported API, or moved to Autoconf or Automake where they belong.
 #
 #
@@ -25,7 +26,7 @@
 # included after everything else.  This provides aclocal with the
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
 #
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
 # Yes, that means every name once taken will need to remain here until

+ 275 - 0
Engine/lib/sdl/acinclude/pkg.m4

@@ -0,0 +1,275 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
+dnl Copyright © 2004 Scott James Remnant <[email protected]>.
+dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $2])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+        AC_MSG_RESULT([no])
+	m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	$3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR

+ 0 - 133
Engine/lib/sdl/acinclude/pkg_config.m4

@@ -1,133 +0,0 @@
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=m4_default([$1], [0.9.0])
-	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
-		PKG_CONFIG=""
-	fi
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
-    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_default([$2], [:])
-m4_ifvaln([$3], [else
-  $3])dnl
-fi])
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
-    pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
-    PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
-		     [pkg_failed=yes])
- else
-    pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
-   	AC_MSG_RESULT([no])
-        _PKG_SHORT_ERRORS_SUPPORTED
-        if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
-        else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
-	m4_default([$4], [AC_MSG_ERROR(
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT])dnl
-        ])
-elif test $pkg_failed = untried; then
-     	AC_MSG_RESULT([no])
-	m4_default([$4], [AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
-        ])
-else
-	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
-	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
-        AC_MSG_RESULT([yes])
-	$3
-fi[]dnl
-])# PKG_CHECK_MODULES

+ 6 - 2
Engine/lib/sdl/android-project/app/build.gradle

@@ -8,13 +8,13 @@ else {
 }
 }
 
 
 android {
 android {
-    compileSdkVersion 26
+    compileSdkVersion 31
     defaultConfig {
     defaultConfig {
         if (buildAsApplication) {
         if (buildAsApplication) {
             applicationId "org.libsdl.app"
             applicationId "org.libsdl.app"
         }
         }
         minSdkVersion 16
         minSdkVersion 16
-        targetSdkVersion 26
+        targetSdkVersion 31
         versionCode 1
         versionCode 1
         versionName "1.0"
         versionName "1.0"
         externalNativeBuild {
         externalNativeBuild {
@@ -35,6 +35,10 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
         }
     }
     }
+    applicationVariants.all { variant ->
+        tasks["merge${variant.name.capitalize()}Assets"]
+            .dependsOn("externalNativeBuild${variant.name.capitalize()}")
+    }
     if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
     if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
         sourceSets.main {
         sourceSets.main {
             jniLibs.srcDir 'libs'
             jniLibs.srcDir 'libs'

+ 1 - 1
Engine/lib/sdl/android-project/app/jni/src/Android.mk

@@ -13,6 +13,6 @@ LOCAL_SRC_FILES := YourSourceHere.c
 
 
 LOCAL_SHARED_LIBRARIES := SDL2
 LOCAL_SHARED_LIBRARIES := SDL2
 
 
-LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
+LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
 
 
 include $(BUILD_SHARED_LIBRARY)
 include $(BUILD_SHARED_LIBRARY)

+ 13 - 3
Engine/lib/sdl/android-project/app/src/main/AndroidManifest.xml

@@ -38,10 +38,14 @@
         android:name="android.hardware.microphone"
         android:name="android.hardware.microphone"
         android:required="false" /> -->
         android:required="false" /> -->
 
 
-    <!-- Allow writing to external storage -->
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <!-- Allow downloading to the external storage on Android 5.1 and older -->
+    <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="22" /> -->
+
     <!-- Allow access to Bluetooth devices -->
     <!-- Allow access to Bluetooth devices -->
-    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <!-- Currently this is just for Steam Controller support and requires setting SDL_HINT_JOYSTICK_HIDAPI_STEAM -->
+    <!-- <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> -->
+    <!-- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> -->
+
     <!-- Allow access to the vibrator -->
     <!-- Allow access to the vibrator -->
     <uses-permission android:name="android.permission.VIBRATE" />
     <uses-permission android:name="android.permission.VIBRATE" />
 
 
@@ -71,11 +75,17 @@
             android:alwaysRetainTaskState="true"
             android:alwaysRetainTaskState="true"
             android:launchMode="singleInstance"
             android:launchMode="singleInstance"
             android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
             android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
+            android:preferMinimalPostProcessing="true"
+            android:exported="true"
             >
             >
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
             </intent-filter>
+            <!-- Let Android know that we can handle some USB devices and should receive this event -->
+            <intent-filter>
+                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
+            </intent-filter>
             <!-- Drop file event -->
             <!-- Drop file event -->
             <!--
             <!--
             <intent-filter>
             <intent-filter>

+ 3 - 3
Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java

@@ -564,10 +564,10 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
         return "Steam Controller";
         return "Steam Controller";
     }
     }
 
 
-	@Override
+    @Override
     public UsbDevice getDevice() {
     public UsbDevice getDevice() {
-		return null;
-	}
+        return null;
+    }
 
 
     @Override
     @Override
     public boolean open() {
     public boolean open() {

+ 32 - 35
Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java

@@ -7,6 +7,7 @@ import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothManager;
 import android.bluetooth.BluetoothManager;
 import android.bluetooth.BluetoothProfile;
 import android.bluetooth.BluetoothProfile;
+import android.os.Build;
 import android.util.Log;
 import android.util.Log;
 import android.content.BroadcastReceiver;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Context;
@@ -104,36 +105,6 @@ public class HIDDeviceManager {
     private HIDDeviceManager(final Context context) {
     private HIDDeviceManager(final Context context) {
         mContext = context;
         mContext = context;
 
 
-        // Make sure we have the HIDAPI library loaded with the native functions
-        try {
-            SDL.loadLibrary("hidapi");
-        } catch (Throwable e) {
-            Log.w(TAG, "Couldn't load hidapi: " + e.toString());
-
-            AlertDialog.Builder builder = new AlertDialog.Builder(context);
-            builder.setCancelable(false);
-            builder.setTitle("SDL HIDAPI Error");
-            builder.setMessage("Please report the following error to the SDL maintainers: " + e.getMessage());
-            builder.setNegativeButton("Quit", new DialogInterface.OnClickListener() {
-                @Override
-                public void onClick(DialogInterface dialog, int which) {
-                    try {
-                        // If our context is an activity, exit rather than crashing when we can't
-                        // call our native functions.
-                        Activity activity = (Activity)context;
-        
-                        activity.finish();
-                    }
-                    catch (ClassCastException cce) {
-                        // Context wasn't an activity, there's nothing we can do.  Give up and return.
-                    }
-                }
-            });
-            builder.show();
-
-            return;
-        }
-        
         HIDDeviceRegisterCallback();
         HIDDeviceRegisterCallback();
 
 
         mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);
         mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);
@@ -148,9 +119,6 @@ public class HIDDeviceManager {
         {
         {
             mNextDeviceId = mSharedPreferences.getInt("next_device_id", 0);
             mNextDeviceId = mSharedPreferences.getInt("next_device_id", 0);
         }
         }
-
-        initializeUSB();
-        initializeBluetooth();
     }
     }
 
 
     public Context getContext() {
     public Context getContext() {
@@ -173,6 +141,9 @@ public class HIDDeviceManager {
 
 
     private void initializeUSB() {
     private void initializeUSB() {
         mUsbManager = (UsbManager)mContext.getSystemService(Context.USB_SERVICE);
         mUsbManager = (UsbManager)mContext.getSystemService(Context.USB_SERVICE);
+        if (mUsbManager == null) {
+            return;
+        }
 
 
         /*
         /*
         // Logging
         // Logging
@@ -275,6 +246,7 @@ public class HIDDeviceManager {
             0x15e4, // Numark
             0x15e4, // Numark
             0x162e, // Joytech
             0x162e, // Joytech
             0x1689, // Razer Onza
             0x1689, // Razer Onza
+            0x1949, // Lab126, Inc.
             0x1bad, // Harmonix
             0x1bad, // Harmonix
             0x24c6, // PowerA
             0x24c6, // PowerA
         };
         };
@@ -377,11 +349,17 @@ public class HIDDeviceManager {
     private void initializeBluetooth() {
     private void initializeBluetooth() {
         Log.d(TAG, "Initializing Bluetooth");
         Log.d(TAG, "Initializing Bluetooth");
 
 
-        if (mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
+        if (Build.VERSION.SDK_INT <= 30 &&
+            mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
             Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
             Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
             return;
             return;
         }
         }
 
 
+        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18)) {
+            Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
+            return;
+        }
+
         // Find bonded bluetooth controllers and create SteamControllers for them
         // Find bonded bluetooth controllers and create SteamControllers for them
         mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
         mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
         if (mBluetoothManager == null) {
         if (mBluetoothManager == null) {
@@ -564,6 +542,18 @@ public class HIDDeviceManager {
     ////////// JNI interface functions
     ////////// JNI interface functions
     //////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////
 
 
+    public boolean initialize(boolean usb, boolean bluetooth) {
+        Log.v(TAG, "initialize(" + usb + ", " + bluetooth + ")");
+
+        if (usb) {
+            initializeUSB();
+        }
+        if (bluetooth) {
+            initializeBluetooth();
+        }
+        return true;
+    }
+
     public boolean openDevice(int deviceID) {
     public boolean openDevice(int deviceID) {
         Log.v(TAG, "openDevice deviceID=" + deviceID);
         Log.v(TAG, "openDevice deviceID=" + deviceID);
         HIDDevice device = getDevice(deviceID);
         HIDDevice device = getDevice(deviceID);
@@ -577,7 +567,14 @@ public class HIDDeviceManager {
         if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {
         if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {
             HIDDeviceOpenPending(deviceID);
             HIDDeviceOpenPending(deviceID);
             try {
             try {
-                mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), 0));
+                final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
+                int flags;
+                if (Build.VERSION.SDK_INT >= 31) {
+                    flags = FLAG_MUTABLE;
+                } else {
+                    flags = 0;
+                }
+                mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
             } catch (Exception e) {
             } catch (Exception e) {
                 Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
                 Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
                 HIDDeviceOpenResult(deviceID, false);
                 HIDDeviceOpenResult(deviceID, false);

+ 188 - 75
Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -52,6 +52,7 @@ import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.TextView;
+import android.widget.Toast;
 
 
 import java.util.Hashtable;
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Locale;
@@ -62,6 +63,106 @@ import java.util.Locale;
 */
 */
 public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
 public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
     private static final String TAG = "SDL";
     private static final String TAG = "SDL";
+/*
+    // Display InputType.SOURCE/CLASS of events and devices
+    //
+    // SDLActivity.debugSource(device.getSources(), "device[" + device.getName() + "]");
+    // SDLActivity.debugSource(event.getSource(), "event");
+    public static void debugSource(int sources, String prefix) {
+        int s = sources;
+        int s_copy = sources;
+        String cls = "";
+        String src = "";
+        int tst = 0;
+        int FLAG_TAINTED = 0x80000000;
+
+        if ((s & InputDevice.SOURCE_CLASS_BUTTON) != 0)     cls += " BUTTON";
+        if ((s & InputDevice.SOURCE_CLASS_JOYSTICK) != 0)   cls += " JOYSTICK";
+        if ((s & InputDevice.SOURCE_CLASS_POINTER) != 0)    cls += " POINTER";
+        if ((s & InputDevice.SOURCE_CLASS_POSITION) != 0)   cls += " POSITION";
+        if ((s & InputDevice.SOURCE_CLASS_TRACKBALL) != 0)  cls += " TRACKBALL";
+
+
+        int s2 = s_copy & ~InputDevice.SOURCE_ANY; // keep class bits
+        s2 &= ~(  InputDevice.SOURCE_CLASS_BUTTON 
+                | InputDevice.SOURCE_CLASS_JOYSTICK
+                | InputDevice.SOURCE_CLASS_POINTER
+                | InputDevice.SOURCE_CLASS_POSITION
+                | InputDevice.SOURCE_CLASS_TRACKBALL);
+
+        if (s2 != 0) cls += "Some_Unkown";
+
+        s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
+
+        tst = InputDevice.SOURCE_BLUETOOTH_STYLUS;
+        if ((s & tst) == tst) src += " BLUETOOTH_STYLUS";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_DPAD;
+        if ((s & tst) == tst) src += " DPAD";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_GAMEPAD;
+        if ((s & tst) == tst) src += " GAMEPAD";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_HDMI;
+        if ((s & tst) == tst) src += " HDMI";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_JOYSTICK;
+        if ((s & tst) == tst) src += " JOYSTICK";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_KEYBOARD;
+        if ((s & tst) == tst) src += " KEYBOARD";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_MOUSE;
+        if ((s & tst) == tst) src += " MOUSE";
+        s2 &= ~tst;
+
+        if (Build.VERSION.SDK_INT >= 26) {
+            tst = InputDevice.SOURCE_MOUSE_RELATIVE;
+            if ((s & tst) == tst) src += " MOUSE_RELATIVE";
+            s2 &= ~tst;
+
+            tst = InputDevice.SOURCE_ROTARY_ENCODER;
+            if ((s & tst) == tst) src += " ROTARY_ENCODER";
+            s2 &= ~tst;
+        }
+        tst = InputDevice.SOURCE_STYLUS;
+        if ((s & tst) == tst) src += " STYLUS";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_TOUCHPAD;
+        if ((s & tst) == tst) src += " TOUCHPAD";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_TOUCHSCREEN;
+        if ((s & tst) == tst) src += " TOUCHSCREEN";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
+        if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_TRACKBALL;
+        if ((s & tst) == tst) src += " TRACKBALL";
+        s2 &= ~tst;
+
+        tst = InputDevice.SOURCE_ANY;
+        if ((s & tst) == tst) src += " ANY";
+        s2 &= ~tst;
+
+        if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
+        s2 &= ~FLAG_TAINTED;
+
+        if (s2 != 0) src += " Some_Unkown";
+
+        Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
+    }
+*/
 
 
     public static boolean mIsResumedCalled, mHasFocus;
     public static boolean mIsResumedCalled, mHasFocus;
     public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24);
     public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24);
@@ -163,7 +264,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
      */
      */
     protected String[] getLibraries() {
     protected String[] getLibraries() {
         return new String[] {
         return new String[] {
-            "hidapi",
             "SDL2",
             "SDL2",
             // "SDL2_image",
             // "SDL2_image",
             // "SDL2_mixer",
             // "SDL2_mixer",
@@ -378,11 +478,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     }
     }
 
 
     public static int getCurrentOrientation() {
     public static int getCurrentOrientation() {
-        final Context context = SDLActivity.getContext();
-        final Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
-
         int result = SDL_ORIENTATION_UNKNOWN;
         int result = SDL_ORIENTATION_UNKNOWN;
 
 
+        Activity activity = (Activity)getContext();
+        if (activity == null) {
+            return result;
+        }
+        Display display = activity.getWindowManager().getDefaultDisplay();
+
         switch (display.getRotation()) {
         switch (display.getRotation()) {
             case Surface.ROTATION_0:
             case Surface.ROTATION_0:
                 result = SDL_ORIENTATION_PORTRAIT;
                 result = SDL_ORIENTATION_PORTRAIT;
@@ -496,8 +599,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         // If we do, the normal hardware back button will no longer work and people have to use home,
         // If we do, the normal hardware back button will no longer work and people have to use home,
         // but the mouse right click will work.
         // but the mouse right click will work.
         //
         //
-        String trapBack = SDLActivity.nativeGetHint("SDL_ANDROID_TRAP_BACK_BUTTON");
-        if ((trapBack != null) && trapBack.equals("1")) {
+        boolean trapBack = SDLActivity.nativeGetHintBoolean("SDL_ANDROID_TRAP_BACK_BUTTON", false);
+        if (trapBack) {
             // Exit and let the mouse handler handle this button (if appropriate)
             // Exit and let the mouse handler handle this button (if appropriate)
             return;
             return;
         }
         }
@@ -604,7 +707,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     static final int COMMAND_CHANGE_TITLE = 1;
     static final int COMMAND_CHANGE_TITLE = 1;
     static final int COMMAND_CHANGE_WINDOW_STYLE = 2;
     static final int COMMAND_CHANGE_WINDOW_STYLE = 2;
     static final int COMMAND_TEXTEDIT_HIDE = 3;
     static final int COMMAND_TEXTEDIT_HIDE = 3;
-    static final int COMMAND_CHANGE_SURFACEVIEW_FORMAT = 4;
     static final int COMMAND_SET_KEEP_SCREEN_ON = 5;
     static final int COMMAND_SET_KEEP_SCREEN_ON = 5;
 
 
     protected static final int COMMAND_USER = 0x8000;
     protected static final int COMMAND_USER = 0x8000;
@@ -702,32 +804,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
                 }
                 }
                 break;
                 break;
             }
             }
-            case COMMAND_CHANGE_SURFACEVIEW_FORMAT:
-            {
-                int format = (Integer) msg.obj;
-                int pf;
-
-                if (SDLActivity.mSurface == null) {
-                    return;
-                }
-
-                SurfaceHolder holder = SDLActivity.mSurface.getHolder();
-                if (holder == null) {
-                    return;
-                }
-
-                if (format == 1) {
-                    pf = PixelFormat.RGBA_8888;
-                } else if (format == 2) {
-                    pf = PixelFormat.RGBX_8888;
-                } else {
-                    pf = PixelFormat.RGB_565;
-                }
-
-                holder.setFormat(pf);
-
-                break;
-            }
             default:
             default:
                 if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
                 if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
                     Log.e(TAG, "error handling message, command is " + msg.arg1);
                     Log.e(TAG, "error handling message, command is " + msg.arg1);
@@ -811,7 +887,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     public static native void nativeResume();
     public static native void nativeResume();
     public static native void nativeFocusChanged(boolean hasFocus);
     public static native void nativeFocusChanged(boolean hasFocus);
     public static native void onNativeDropFile(String filename);
     public static native void onNativeDropFile(String filename);
-    public static native void nativeSetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, int format, float rate);
+    public static native void nativeSetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate);
     public static native void onNativeResize();
     public static native void onNativeResize();
     public static native void onNativeKeyDown(int keycode);
     public static native void onNativeKeyDown(int keycode);
     public static native void onNativeKeyUp(int keycode);
     public static native void onNativeKeyUp(int keycode);
@@ -827,6 +903,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     public static native void onNativeSurfaceChanged();
     public static native void onNativeSurfaceChanged();
     public static native void onNativeSurfaceDestroyed();
     public static native void onNativeSurfaceDestroyed();
     public static native String nativeGetHint(String name);
     public static native String nativeGetHint(String name);
+    public static native boolean nativeGetHintBoolean(String name, boolean default_value);
     public static native void nativeSetenv(String name, String value);
     public static native void nativeSetenv(String name, String value);
     public static native void onNativeOrientationChanged(int orientation);
     public static native void onNativeOrientationChanged(int orientation);
     public static native void nativeAddTouch(int touchId, String name);
     public static native void nativeAddTouch(int touchId, String name);
@@ -986,11 +1063,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
      */
      */
     public static boolean supportsRelativeMouse()
     public static boolean supportsRelativeMouse()
     {
     {
-        // ChromeOS doesn't provide relative mouse motion via the Android 7 APIs
-        if (isChromebook()) {
-            return false;
-        }
-
         // DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under
         // DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under
         // Android 7 APIs, and simply returns no data under Android 8 APIs.
         // Android 7 APIs, and simply returns no data under Android 8 APIs.
         //
         //
@@ -1222,13 +1294,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         return SDLActivity.mSurface.getNativeSurface();
         return SDLActivity.mSurface.getNativeSurface();
     }
     }
 
 
-    /**
-     * This method is called by SDL using JNI.
-     */
-    public static void setSurfaceViewFormat(int format) {
-        mSingleton.sendCommand(COMMAND_CHANGE_SURFACEVIEW_FORMAT, format);
-    }
-
     // Input
     // Input
 
 
     /**
     /**
@@ -1239,8 +1304,21 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
 
 
         for (int id : ids) {
         for (int id : ids) {
             InputDevice device = InputDevice.getDevice(id);
             InputDevice device = InputDevice.getDevice(id);
-            if (device != null && (device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) != 0) {
-                nativeAddTouch(device.getId(), device.getName());
+            /* Allow SOURCE_TOUCHSCREEN and also Virtual InputDevices because they can send TOUCHSCREEN events */
+            if (device != null && ((device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) == InputDevice.SOURCE_TOUCHSCREEN
+                    || device.isVirtual())) {
+
+                int touchDevId = device.getId();
+                /*
+                 * Prevent id to be -1, since it's used in SDL internal for synthetic events
+                 * Appears when using Android emulator, eg:
+                 *  adb shell input mouse tap 100 100
+                 *  adb shell input touchscreen tap 100 100
+                 */
+                if (touchDevId < 0) {
+                    touchDevId -= 1;
+                }
+                nativeAddTouch(touchDevId, device.getName());
             }
             }
         }
         }
     }
     }
@@ -1514,6 +1592,19 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         return mLastCursorID;
         return mLastCursorID;
     }
     }
 
 
+    /**
+     * This method is called by SDL using JNI.
+     */
+    public static void destroyCustomCursor(int cursorID) {
+        if (Build.VERSION.SDK_INT >= 24) {
+            try {
+                mCursors.remove(cursorID);
+            } catch (Exception e) {
+            }
+        }
+        return;
+    }
+
     /**
     /**
      * This method is called by SDL using JNI.
      * This method is called by SDL using JNI.
      */
      */
@@ -1630,6 +1721,52 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         }
         }
         return 0;
         return 0;
     }
     }
+
+    /**
+     * This method is called by SDL using JNI.
+     */
+    public static int showToast(String message, int duration, int gravity, int xOffset, int yOffset)
+    {
+        if(null == mSingleton) {
+            return - 1;
+        }
+
+        try
+        {
+            class OneShotTask implements Runnable {
+                String mMessage;
+                int mDuration;
+                int mGravity;
+                int mXOffset;
+                int mYOffset;
+
+                OneShotTask(String message, int duration, int gravity, int xOffset, int yOffset) {
+                    mMessage  = message;
+                    mDuration = duration;
+                    mGravity  = gravity;
+                    mXOffset  = xOffset;
+                    mYOffset  = yOffset;
+                }
+
+                public void run() {
+                    try
+                    {
+                        Toast toast = Toast.makeText(mSingleton, mMessage, mDuration);
+                        if (mGravity >= 0) {
+                            toast.setGravity(mGravity, mXOffset, mYOffset);
+                        }
+                        toast.show();
+                    } catch(Exception ex) {
+                        Log.e(TAG, ex.getMessage());
+                    }
+                }
+            }
+            mSingleton.runOnUiThread(new OneShotTask(message, duration, gravity, xOffset, yOffset));
+        } catch(Exception ex) {
+            return -1;
+        }
+        return 0;
+    }
 }
 }
 
 
 /**
 /**
@@ -1754,30 +1891,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
             return;
             return;
         }
         }
 
 
-        int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
-        switch (format) {
-        case PixelFormat.RGBA_8888:
-            Log.v("SDL", "pixel format RGBA_8888");
-            sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
-            break;
-        case PixelFormat.RGBX_8888:
-            Log.v("SDL", "pixel format RGBX_8888");
-            sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
-            break;
-        case PixelFormat.RGB_565:
-            Log.v("SDL", "pixel format RGB_565");
-            sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
-            break;
-        case PixelFormat.RGB_888:
-            Log.v("SDL", "pixel format RGB_888");
-            // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
-            sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
-            break;
-        default:
-            Log.v("SDL", "pixel format unknown " + format);
-            break;
-        }
-
         mWidth = width;
         mWidth = width;
         mHeight = height;
         mHeight = height;
         int nDeviceWidth = width;
         int nDeviceWidth = width;
@@ -1800,7 +1913,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
 
 
         Log.v("SDL", "Window size: " + width + "x" + height);
         Log.v("SDL", "Window size: " + width + "x" + height);
         Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
         Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
-        SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
+        SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, mDisplay.getRefreshRate());
         SDLActivity.onNativeResize();
         SDLActivity.onNativeResize();
 
 
         // Prevent a screen distortion glitch,
         // Prevent a screen distortion glitch,
@@ -1895,7 +2008,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
             }
             }
         }
         }
 
 
-        if ((source & InputDevice.SOURCE_KEYBOARD) != 0) {
+        if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
             if (event.getAction() == KeyEvent.ACTION_DOWN) {
             if (event.getAction() == KeyEvent.ACTION_DOWN) {
                 if (SDLActivity.isTextInputEvent(event)) {
                 if (SDLActivity.isTextInputEvent(event)) {
                     SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
                     SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
@@ -1908,7 +2021,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
             }
             }
         }
         }
 
 
-        if ((source & InputDevice.SOURCE_MOUSE) != 0) {
+        if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
             // on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
             // on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
             // they are ignored here because sending them as mouse input to SDL is messy
             // they are ignored here because sending them as mouse input to SDL is messy
             if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
             if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {

+ 4 - 0
Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java

@@ -47,6 +47,10 @@ public class SDLAudioManager
             if (desiredChannels > 2) {
             if (desiredChannels > 2) {
                 desiredChannels = 2;
                 desiredChannels = 2;
             }
             }
+        }
+
+        /* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
+        if (Build.VERSION.SDK_INT < 22) {
             if (sampleRate < 8000) {
             if (sampleRate < 8000) {
                 sampleRate = 8000;
                 sampleRate = 8000;
             } else if (sampleRate > 48000) {
             } else if (sampleRate > 48000) {

+ 17 - 21
Engine/lib/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java

@@ -255,23 +255,21 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
 
 
     @Override
     @Override
     public boolean handleMotionEvent(MotionEvent event) {
     public boolean handleMotionEvent(MotionEvent event) {
-        if ((event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
-            int actionPointerIndex = event.getActionIndex();
-            int action = event.getActionMasked();
-            if (action == MotionEvent.ACTION_MOVE) {
-                SDLJoystick joystick = getJoystick(event.getDeviceId());
-                if (joystick != null) {
-                    for (int i = 0; i < joystick.axes.size(); i++) {
-                        InputDevice.MotionRange range = joystick.axes.get(i);
-                        /* Normalize the value to -1...1 */
-                        float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
-                        SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
-                    }
-                    for (int i = 0; i < joystick.hats.size() / 2; i++) {
-                        int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
-                        int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
-                        SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
-                    }
+        int actionPointerIndex = event.getActionIndex();
+        int action = event.getActionMasked();
+        if (action == MotionEvent.ACTION_MOVE) {
+            SDLJoystick joystick = getJoystick(event.getDeviceId());
+            if (joystick != null) {
+                for (int i = 0; i < joystick.axes.size(); i++) {
+                    InputDevice.MotionRange range = joystick.axes.get(i);
+                    /* Normalize the value to -1...1 */
+                    float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
+                    SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
+                }
+                for (int i = 0; i < joystick.hats.size() / 2; i++) {
+                    int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
+                    int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
+                    SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
                 }
                 }
             }
             }
         }
         }
@@ -319,6 +317,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
             KeyEvent.KEYCODE_BUTTON_X,
             KeyEvent.KEYCODE_BUTTON_X,
             KeyEvent.KEYCODE_BUTTON_Y,
             KeyEvent.KEYCODE_BUTTON_Y,
             KeyEvent.KEYCODE_BACK,
             KeyEvent.KEYCODE_BACK,
+            KeyEvent.KEYCODE_MENU,
             KeyEvent.KEYCODE_BUTTON_MODE,
             KeyEvent.KEYCODE_BUTTON_MODE,
             KeyEvent.KEYCODE_BUTTON_START,
             KeyEvent.KEYCODE_BUTTON_START,
             KeyEvent.KEYCODE_BUTTON_THUMBL,
             KeyEvent.KEYCODE_BUTTON_THUMBL,
@@ -360,6 +359,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
             (1 << 2),   // X -> X
             (1 << 2),   // X -> X
             (1 << 3),   // Y -> Y
             (1 << 3),   // Y -> Y
             (1 << 4),   // BACK -> BACK
             (1 << 4),   // BACK -> BACK
+            (1 << 6),   // MENU -> START
             (1 << 5),   // MODE -> GUIDE
             (1 << 5),   // MODE -> GUIDE
             (1 << 6),   // START -> START
             (1 << 6),   // START -> START
             (1 << 7),   // THUMBL -> LEFTSTICK
             (1 << 7),   // THUMBL -> LEFTSTICK
@@ -560,8 +560,6 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
 
 
         switch ( event.getSource() ) {
         switch ( event.getSource() ) {
             case InputDevice.SOURCE_JOYSTICK:
             case InputDevice.SOURCE_JOYSTICK:
-            case InputDevice.SOURCE_GAMEPAD:
-            case InputDevice.SOURCE_DPAD:
                 return SDLControllerManager.handleJoystickMotionEvent(event);
                 return SDLControllerManager.handleJoystickMotionEvent(event);
 
 
             case InputDevice.SOURCE_MOUSE:
             case InputDevice.SOURCE_MOUSE:
@@ -691,8 +689,6 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
 
 
         switch ( event.getSource() ) {
         switch ( event.getSource() ) {
             case InputDevice.SOURCE_JOYSTICK:
             case InputDevice.SOURCE_JOYSTICK:
-            case InputDevice.SOURCE_GAMEPAD:
-            case InputDevice.SOURCE_DPAD:
                 return SDLControllerManager.handleJoystickMotionEvent(event);
                 return SDLControllerManager.handleJoystickMotionEvent(event);
 
 
             case InputDevice.SOURCE_MOUSE:
             case InputDevice.SOURCE_MOUSE:

+ 3 - 3
Engine/lib/sdl/android-project/build.gradle

@@ -2,11 +2,11 @@
 
 
 buildscript {
 buildscript {
     repositories {
     repositories {
-        jcenter()
+        mavenCentral()
         google()
         google()
     }
     }
     dependencies {
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.2.0'
+        classpath 'com.android.tools.build:gradle:7.0.3'
 
 
         // NOTE: Do not place your application dependencies here; they belong
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
         // in the individual module build.gradle files
@@ -15,7 +15,7 @@ buildscript {
 
 
 allprojects {
 allprojects {
     repositories {
     repositories {
-        jcenter()
+        mavenCentral()
         google()
         google()
     }
     }
 }
 }

BIN=BIN
Engine/lib/sdl/android-project/gradle/wrapper/gradle-wrapper.jar


+ 3 - 3
Engine/lib/sdl/android-project/gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Mon Oct 23 13:51:26 PDT 2017
+#Thu Nov 11 18:20:34 PST 2021
 distributionBase=GRADLE_USER_HOME
 distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
 distributionPath=wrapper/dists
 distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+zipStoreBase=GRADLE_USER_HOME

+ 9 - 9
Engine/lib/sdl/autogen.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-#
+
 echo "Generating build information using autoconf"
 echo "Generating build information using autoconf"
 echo "This may take a while ..."
 echo "This may take a while ..."
 
 
@@ -9,15 +9,15 @@ cd "$srcdir"
 
 
 # Regenerate configuration files
 # Regenerate configuration files
 cat acinclude/* >aclocal.m4
 cat acinclude/* >aclocal.m4
-found=false
-for autoconf in autoconf autoconf259 autoconf-2.59
-do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
-done
-if test x$found = xfalse; then
-    echo "Couldn't find autoconf, aborting"
-    exit 1
+
+if test "$AUTOCONF"x = x; then
+  AUTOCONF=autoconf
 fi
 fi
+
+$AUTOCONF || exit 1
+rm aclocal.m4
+rm -rf autom4te.cache
+
 (cd test; sh autogen.sh)
 (cd test; sh autogen.sh)
 
 
-# Run configure for this platform
 echo "Now you are ready to run ./configure"
 echo "Now you are ready to run ./configure"

+ 1 - 1
Engine/lib/sdl/build-scripts/checker-buildbot.sh

@@ -27,7 +27,7 @@ cd checker-buildbot
 # The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
 # The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
 
 
 # You might want to do this for CMake-backed builds instead...
 # You might want to do this for CMake-backed builds instead...
-scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
+scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DSDL_ASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
 
 
 # ...or run configure without the scan-build wrapper...
 # ...or run configure without the scan-build wrapper...
 #CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0 -Wno-deprecated-declarations" LDFLAGS="-Wno-liblto" ../configure --enable-assertions=enabled
 #CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0 -Wno-deprecated-declarations" LDFLAGS="-Wno-liblto" ../configure --enable-assertions=enabled

+ 28 - 27
Engine/lib/sdl/build-scripts/g++-fat.sh → Engine/lib/sdl/build-scripts/clang++-fat.sh

@@ -2,35 +2,36 @@
 #
 #
 # Build Universal binaries on Mac OS X, thanks Ryan!
 # Build Universal binaries on Mac OS X, thanks Ryan!
 #
 #
-# Usage: ./configure CXX="sh g++-fat.sh" && make && rm -rf x86 x64
+# Usage: ./configure CXX="sh clang++-fat.sh" && make && rm -rf arm64 x64
 
 
 DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
 DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
 
 
-# Intel 32-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.6 \
+# Intel 64-bit compiler flags (10.6 runtime compatibility)
+CLANG_COMPILE_X64="clang++ -arch x86_64 -mmacosx-version-min=10.6 \
 -I/usr/local/include"
 -I/usr/local/include"
 
 
-GCC_LINK_X86="-mmacosx-version-min=10.6"
+CLANG_LINK_X64="-mmacosx-version-min=10.6"
 
 
-# Intel 64-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X64="g++ -arch x86_64 -mmacosx-version-min=10.6 \
+# ARM 64-bit compiler flags (11.0 runtime compatibility)
+CLANG_COMPILE_ARM64="clang++ -arch arm64 -mmacosx-version-min=11.0 \
 -I/usr/local/include"
 -I/usr/local/include"
 
 
-GCC_LINK_X64="-mmacosx-version-min=10.6"
+CLANG_LINK_ARM64="-mmacosx-version-min=11.0"
+
 
 
-# Output both PowerPC and Intel object files
+# Output both Intel and ARM object files
 args="$*"
 args="$*"
 compile=yes
 compile=yes
 link=yes
 link=yes
 while test x$1 != x; do
 while test x$1 != x; do
     case $1 in
     case $1 in
-        --version) exec g++ $1;;
-        -v) exec g++ $1;;
-        -V) exec g++ $1;;
-        -print-prog-name=*) exec g++ $1;;
-        -print-search-dirs) exec g++ $1;;
-        -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
-            GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
+        --version) exec clang++ $1;;
+        -v) exec clang++ $1;;
+        -V) exec clang++ $1;;
+        -print-prog-name=*) exec clang++ $1;;
+        -print-search-dirs) exec clang++ $1;;
+        -E) CLANG_COMPILE_ARM64="$CLANG_COMPILE_ARM64 -E"
+            CLANG_COMPILE_X64="$CLANG_COMPILE_X64 -E"
             compile=no; link=no;;
             compile=no; link=no;;
         -c) link=no;;
         -c) link=no;;
         -o) output=$2;;
         -o) output=$2;;
@@ -39,8 +40,8 @@ while test x$1 != x; do
     shift
     shift
 done
 done
 if test x$link = xyes; then
 if test x$link = xyes; then
-    GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
-    GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
+    CLANG_COMPILE_ARM64="$CLANG_COMPILE_ARM64 $CLANG_LINK_ARM64"
+    CLANG_COMPILE_X64="$CLANG_COMPILE_X64 $CLANG_LINK_X64"
 fi
 fi
 if test x"$output" = x; then
 if test x"$output" = x; then
     if test x$link = xyes; then
     if test x$link = xyes; then
@@ -50,9 +51,9 @@ if test x"$output" = x; then
     fi
     fi
 fi
 fi
 
 
-# Compile X86 32-bit
+# Compile ARM 64-bit
 if test x"$output" != x; then
 if test x"$output" != x; then
-    dir=x86/`dirname $output`
+    dir=arm64/`dirname $output`
     if test -d $dir; then
     if test -d $dir; then
         :
         :
     else
     else
@@ -61,19 +62,19 @@ if test x"$output" != x; then
 fi
 fi
 set -- $args
 set -- $args
 while test x$1 != x; do
 while test x$1 != x; do
-    if test -f "x86/$1" && test "$1" != "$output"; then
-        x86_args="$x86_args x86/$1"
+    if test -f "arm64/$1" && test "$1" != "$output"; then
+        arm64_args="$arm64_args arm64/$1"
     else
     else
-        x86_args="$x86_args $1"
+        arm64_args="$arm64_args $1"
     fi
     fi
     shift
     shift
 done
 done
-$GCC_COMPILE_X86 $x86_args || exit $?
+$CLANG_COMPILE_ARM64 $arm64_args || exit $?
 if test x"$output" != x; then
 if test x"$output" != x; then
-    cp $output x86/$output
+    cp $output arm64/$output
 fi
 fi
 
 
-# Compile X86 32-bit
+# Compile Intel 64-bit
 if test x"$output" != x; then
 if test x"$output" != x; then
     dir=x64/`dirname $output`
     dir=x64/`dirname $output`
     if test -d $dir; then
     if test -d $dir; then
@@ -91,11 +92,11 @@ while test x$1 != x; do
     fi
     fi
     shift
     shift
 done
 done
-$GCC_COMPILE_X64 $x64_args || exit $?
+$CLANG_COMPILE_X64 $x64_args || exit $?
 if test x"$output" != x; then
 if test x"$output" != x; then
     cp $output x64/$output
     cp $output x64/$output
 fi
 fi
 
 
 if test x"$output" != x; then
 if test x"$output" != x; then
-    lipo -create -o $output x86/$output x64/$output
+    lipo -create -o $output arm64/$output x64/$output
 fi
 fi

+ 36 - 33
Engine/lib/sdl/build-scripts/gcc-fat.sh → Engine/lib/sdl/build-scripts/clang-fat.sh

@@ -2,36 +2,37 @@
 #
 #
 # Build Universal binaries on Mac OS X, thanks Ryan!
 # Build Universal binaries on Mac OS X, thanks Ryan!
 #
 #
-# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf x86 x64
+# Usage: ./configure CC="sh clang-fat.sh" && make && rm -rf arm64 x64
 
 
 DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
 DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
 
 
-# Intel 32-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.6 \
+# Intel 64-bit compiler flags (10.6 runtime compatibility)
+CLANG_COMPILE_X64="clang -arch x86_64 -mmacosx-version-min=10.6 \
+-DMAC_OS_X_VERSION_MIN_REQUIRED=1060 \
 -I/usr/local/include"
 -I/usr/local/include"
 
 
-GCC_LINK_X86="-mmacosx-version-min=10.6"
+CLANG_LINK_X64="-mmacosx-version-min=10.6"
 
 
-# Intel 64-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X64="gcc -arch x86_64 -mmacosx-version-min=10.6 \
--DMAC_OS_X_VERSION_MIN_REQUIRED=1060 \
+# ARM 64-bit compiler flags (11.0 runtime compatibility)
+CLANG_COMPILE_ARM64="clang -arch arm64 -mmacosx-version-min=11.0 \
 -I/usr/local/include"
 -I/usr/local/include"
 
 
-GCC_LINK_X64="-mmacosx-version-min=10.6"
+CLANG_LINK_ARM64="-mmacosx-version-min=11.0"
+
 
 
-# Output both PowerPC and Intel object files
+# Output both Intel and ARM object files
 args="$*"
 args="$*"
 compile=yes
 compile=yes
 link=yes
 link=yes
 while test x$1 != x; do
 while test x$1 != x; do
     case $1 in
     case $1 in
-        --version) exec gcc $1;;
-        -v) exec gcc $1;;
-        -V) exec gcc $1;;
-        -print-prog-name=*) exec gcc $1;;
-        -print-search-dirs) exec gcc $1;;
-        -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
-            GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
+        --version) exec clang $1;;
+        -v) exec clang $1;;
+        -V) exec clang $1;;
+        -print-prog-name=*) exec clang $1;;
+        -print-search-dirs) exec clang $1;;
+        -E) CLANG_COMPILE_X64="$CLANG_COMPILE_X64 -E"
+            CLANG_COMPILE_ARM64="$CLANG_COMPILE_ARM64 -E"
             compile=no; link=no;;
             compile=no; link=no;;
         -c) link=no;;
         -c) link=no;;
         -o) output=$2;;
         -o) output=$2;;
@@ -40,8 +41,8 @@ while test x$1 != x; do
     shift
     shift
 done
 done
 if test x$link = xyes; then
 if test x$link = xyes; then
-    GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
-    GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
+    CLANG_COMPILE_X64="$CLANG_COMPILE_X64 $CLANG_LINK_X64"
+    CLANG_COMPILE_ARM64="$CLANG_COMPILE_ARM64 $CLANG_LINK_ARM64"
 fi
 fi
 if test x"$output" = x; then
 if test x"$output" = x; then
     if test x$link = xyes; then
     if test x$link = xyes; then
@@ -51,9 +52,9 @@ if test x"$output" = x; then
     fi
     fi
 fi
 fi
 
 
-# Compile X86 32-bit
+# Compile Intel 64-bit
 if test x"$output" != x; then
 if test x"$output" != x; then
-    dir=x86/`dirname $output`
+    dir=x64/`dirname $output`
     if test -d $dir; then
     if test -d $dir; then
         :
         :
     else
     else
@@ -62,21 +63,21 @@ if test x"$output" != x; then
 fi
 fi
 set -- $args
 set -- $args
 while test x$1 != x; do
 while test x$1 != x; do
-    if test -f "x86/$1" && test "$1" != "$output"; then
-        x86_args="$x86_args x86/$1"
+    if test -f "x64/$1" && test "$1" != "$output"; then
+        x64_args="$x64_args x64/$1"
     else
     else
-        x86_args="$x86_args $1"
+        x64_args="$x64_args $1"
     fi
     fi
     shift
     shift
 done
 done
-$GCC_COMPILE_X86 $x86_args || exit $?
+$CLANG_COMPILE_X64 $x64_args || exit $?
 if test x"$output" != x; then
 if test x"$output" != x; then
-    cp $output x86/$output
+    cp $output x64/$output
 fi
 fi
 
 
-# Compile X86 32-bit
+# Compile ARM 64-bit
 if test x"$output" != x; then
 if test x"$output" != x; then
-    dir=x64/`dirname $output`
+    dir=arm64/`dirname $output`
     if test -d $dir; then
     if test -d $dir; then
         :
         :
     else
     else
@@ -85,18 +86,20 @@ if test x"$output" != x; then
 fi
 fi
 set -- $args
 set -- $args
 while test x$1 != x; do
 while test x$1 != x; do
-    if test -f "x64/$1" && test "$1" != "$output"; then
-        x64_args="$x64_args x64/$1"
+    if test -f "arm64/$1" && test "$1" != "$output"; then
+        arm64_args="$arm64_args arm64/$1"
     else
     else
-        x64_args="$x64_args $1"
+        arm64_args="$arm64_args $1"
     fi
     fi
     shift
     shift
 done
 done
-$GCC_COMPILE_X64 $x64_args || exit $?
+$CLANG_COMPILE_ARM64 $arm64_args || exit $?
 if test x"$output" != x; then
 if test x"$output" != x; then
-    cp $output x64/$output
+    cp $output arm64/$output
 fi
 fi
 
 
+
 if test x"$output" != x; then
 if test x"$output" != x; then
-    lipo -create -o $output x86/$output x64/$output
+    lipo -create -o $output arm64/$output x64/$output
 fi
 fi
+

+ 59 - 0
Engine/lib/sdl/build-scripts/codechecker-buildbot.sh

@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# This is a script used by some Buildbot build workers to push the project
+#  through Clang's static analyzer and prepare the output to be uploaded
+#  back to the buildmaster. You might find it useful too.
+
+# Install Clang (you already have it on macOS, apt-get install clang
+#  on Ubuntu, etc), install CMake, and pip3 install codechecker.
+
+FINALDIR="$1"
+
+set -x
+set -e
+
+cd `dirname "$0"`
+cd ..
+
+rm -rf codechecker-buildbot
+if [ ! -z "$FINALDIR" ]; then
+    rm -rf "$FINALDIR"
+fi
+
+mkdir codechecker-buildbot
+cd codechecker-buildbot
+
+# We turn off deprecated declarations, because we don't care about these warnings during static analysis.
+cmake -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DSDL_ASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
+
+# CMake on macOS adds "-arch arm64" or whatever is appropriate, but this confuses CodeChecker, so strip it out.
+perl -w -pi -e 's/\-arch\s+.*?\s+//g;' compile_commands.json
+
+rm -rf ../analysis
+CodeChecker analyze compile_commands.json -o ./reports
+
+# "parse" returns 2 if there was a static analysis issue to report, but this
+#  does not signify an error in the parsing (that would be error code 1). Turn
+#  off the abort-on-error flag.
+set +e
+CodeChecker parse ./reports -e html -o ../analysis
+set -e
+
+cd ..
+chmod -R a+r analysis
+chmod -R go-w analysis
+find analysis -type d -exec chmod a+x {} \;
+if [ -x /usr/bin/xattr ]; then find analysis -exec /usr/bin/xattr -d com.apple.quarantine {} \; 2>/dev/null ; fi
+
+if [ ! -z "$FINALDIR" ]; then
+    mv analysis "$FINALDIR"
+else
+    FINALDIR=analysis
+fi
+
+rm -rf codechecker-buildbot
+
+echo "Done. Final output is in '$FINALDIR' ..."
+
+# end of codechecker-buildbot.sh ...
+

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 433 - 379
Engine/lib/sdl/build-scripts/config.guess


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1013 - 1087
Engine/lib/sdl/build-scripts/config.sub


+ 0 - 72
Engine/lib/sdl/build-scripts/config.sub.patch

@@ -1,72 +0,0 @@
---- config.sub.orig	2017-09-09 08:01:02.139023205 -0700
-+++ config.sub	2017-09-09 07:59:35.798264474 -0700
-@@ -364,6 +364,19 @@
- 	i*86 | x86_64)
- 	  basic_machine=$basic_machine-pc
- 	  ;;
-+	nacl64*)
-+		basic_machine=x86_64-pc
-+		os=-nacl
-+		;;
-+	nacl*)
-+		basic_machine=i686-pc
-+		os=-nacl
-+		;;
-+	pnacl*)
-+		# le32-unknown-pnacl comes from http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
-+		basic_machine=le32-unknown
-+		os=-pnacl
-+		;;
- 	# Object if more than one company name word.
- 	*-*-*)
- 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-@@ -877,6 +890,10 @@
- 		basic_machine=le32-unknown
- 		os=-nacl
- 		;;
-+	pnacl)
-+		basic_machine=le32-unknown
-+		os=-pnacl
-+		;;
- 	ncr3000)
- 		basic_machine=i486-ncr
- 		os=-sysv4
-@@ -1429,6 +1446,12 @@
- 			;;
- 		esac
- 		;;
-+	-nacl*)
-+		os=-nacl
-+		;;
-+	-pnacl*)
-+		os=-pnacl
-+		;;
- 	-nto-qnx*)
- 		;;
- 	-nto*)
-@@ -1459,6 +1482,9 @@
- 	-os400*)
- 		os=-os400
- 		;;
-+	-cegcc*)
-+		os=-cegcc
-+		;;
- 	-wince*)
- 		os=-wince
- 		;;
-@@ -1548,9 +1574,15 @@
- 		os=-dicos
- 		;;
- 	-nacl*)
-+        os=-nacl
-+        ;;
-+	-pnacl*)
-+		os=-pnacl
- 		;;
- 	-ios)
- 		;;
-+	-emscripten*)
-+		;;
- 	-none)
- 		;;
- 	*)

+ 1 - 1
Engine/lib/sdl/build-scripts/emscripten-buildbot.sh

@@ -55,7 +55,7 @@ mkdir buildbot
 pushd buildbot
 pushd buildbot
 
 
 echo "Configuring..."
 echo "Configuring..."
-emconfigure ../configure --host=wasm-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $?
+emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $?
 
 
 echo "Building..."
 echo "Building..."
 emmake $MAKE || exit $?
 emmake $MAKE || exit $?

+ 174 - 0
Engine/lib/sdl/build-scripts/fnsince.pl

@@ -0,0 +1,174 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use File::Basename;
+use Cwd qw(abs_path);
+
+my $wikipath = undef;
+foreach (@ARGV) {
+    $wikipath = abs_path($_), next if not defined $wikipath;
+}
+
+chdir(dirname(__FILE__));
+chdir('..');
+
+my @unsorted_releases = ();
+open(PIPEFH, '-|', 'git tag -l') or die "Failed to read git release tags: $!\n";
+
+while (<PIPEFH>) {
+    chomp;
+    if (/\Arelease\-(.*?)\Z/) {
+        push @unsorted_releases, $1;
+    }
+
+}
+close(PIPEFH);
+
+#print("\n\nUNSORTED\n");
+#foreach (@unsorted_releases) {
+#    print "$_\n";
+#}
+
+my @releases = sort {
+    my @asplit = split /\./, $a;
+    my @bsplit = split /\./, $b;
+    my $rc;
+    for (my $i = 0; $i < scalar(@asplit); $i++) {
+        return 1 if (scalar(@bsplit) <= $i);  # a is "2.0.1" and b is "2.0", or whatever.
+        my $aseg = $asplit[$i];
+        my $bseg = $bsplit[$i];
+        $rc = int($aseg) <=> int($bseg);
+        return $rc if ($rc != 0);  # found the difference.
+    }
+    return 0;  # still here? They matched completely?!
+} @unsorted_releases;
+
+# this happens to work for how SDL versions things at the moment.
+my $current_release = $releases[-1];
+my @current_release_segments = split /\./, $current_release;
+@current_release_segments[2] = '' . ($current_release_segments[2] + 2);
+my $next_release = join('.', @current_release_segments);
+
+#print("\n\nSORTED\n");
+#foreach (@releases) {
+#    print "$_\n";
+#}
+#print("\nCURRENT RELEASE: $current_release\n");
+#print("NEXT RELEASE: $next_release\n\n");
+
+push @releases, 'HEAD';
+
+my %funcs = ();
+foreach my $release (@releases) {
+    #print("Checking $release...\n");
+    next if ($release eq '2.0.0') || ($release eq '2.0.1');  # no dynapi before 2.0.2
+    my $assigned_release = ($release eq '2.0.2') ? '2.0.0' : $release;  # assume everything in 2.0.2--first with dynapi--was there since 2.0.0. We'll fix it up later.
+    my $tag = ($release eq 'HEAD') ? $release : "release-$release";
+    my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h";
+    open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n";
+    while (<PIPEFH>) {
+        chomp;
+        if (/\A\#define\s+(SDL_.*?)\s+SDL_.*?_REAL\Z/) {
+            my $fn = $1;
+            $funcs{$fn} = $assigned_release if not defined $funcs{$fn};
+        }
+    }
+    close(PIPEFH);
+}
+
+# Fixup the handful of functions that were added in 2.0.1 and 2.0.2 that we
+#  didn't have dynapi revision data about...
+$funcs{'SDL_GetSystemRAM'} = '2.0.1';
+$funcs{'SDL_GetBasePath'} = '2.0.1';
+$funcs{'SDL_GetPrefPath'} = '2.0.1';
+$funcs{'SDL_UpdateYUVTexture'} = '2.0.1';
+$funcs{'SDL_GL_GetDrawableSize'} = '2.0.1';
+$funcs{'SDL_Direct3D9GetAdapterIndex'} = '2.0.1';
+$funcs{'SDL_RenderGetD3D9Device'} = '2.0.1';
+
+$funcs{'SDL_RegisterApp'} = '2.0.2';
+$funcs{'SDL_UnregisterApp'} = '2.0.2';
+$funcs{'SDL_GetAssertionHandler'} = '2.0.2';
+$funcs{'SDL_GetDefaultAssertionHandler'} = '2.0.2';
+$funcs{'SDL_AtomicAdd'} = '2.0.2';
+$funcs{'SDL_AtomicGet'} = '2.0.2';
+$funcs{'SDL_AtomicGetPtr'} = '2.0.2';
+$funcs{'SDL_AtomicSet'} = '2.0.2';
+$funcs{'SDL_AtomicSetPtr'} = '2.0.2';
+$funcs{'SDL_HasAVX'} = '2.0.2';
+$funcs{'SDL_GameControllerAddMappingsFromRW'} = '2.0.2';
+$funcs{'SDL_acos'} = '2.0.2';
+$funcs{'SDL_asin'} = '2.0.2';
+$funcs{'SDL_vsscanf'} = '2.0.2';
+$funcs{'SDL_DetachThread'} = '2.0.2';
+$funcs{'SDL_GL_ResetAttributes'} = '2.0.2';
+$funcs{'SDL_DXGIGetOutputInfo'} = '2.0.2';
+
+# these are incorrect in the dynapi header, because we forgot to add them
+#  until a later release, but are available in the older release.
+$funcs{'SDL_WinRTGetFSPathUNICODE'} = '2.0.3';
+$funcs{'SDL_WinRTGetFSPathUTF8'} = '2.0.3';
+$funcs{'SDL_WinRTRunApp'} = '2.0.3';
+
+if (not defined $wikipath) {
+    foreach my $release (@releases) {
+        foreach my $fn (sort keys %funcs) {
+            print("$fn: $funcs{$fn}\n") if $funcs{$fn} eq $release;
+        }
+    }
+} else {
+    if (defined $wikipath) {
+        chdir($wikipath);
+        foreach my $fn (keys %funcs) {
+            my $revision = $funcs{$fn};
+            $revision = $next_release if $revision eq 'HEAD';
+            my $fname = "$fn.mediawiki";
+            if ( ! -f $fname ) {
+                #print STDERR "No such file: $fname\n";
+                next;
+            }
+
+            my @lines = ();
+            open(FH, '<', $fname) or die("Can't open $fname for read: $!\n");
+            my $added = 0;
+            while (<FH>) {
+                chomp;
+                if ((/\A\-\-\-\-/) && (!$added)) {
+                    push @lines, "== Version ==";
+                    push @lines, "";
+                    push @lines, "This function is available since SDL $revision.";
+                    push @lines, "";
+                    $added = 1;
+                }
+                push @lines, $_;
+                next if not /\A\=\=\s+Version\s+\=\=/;
+                $added = 1;
+                push @lines, "";
+                push @lines, "This function is available since SDL $revision.";
+                push @lines, "";
+                while (<FH>) {
+                    chomp;
+                    next if not (/\A\=\=\s+/ || /\A\-\-\-\-/);
+                    push @lines, $_;
+                    last;
+                }
+            }
+            close(FH);
+
+            if (!$added) {
+                push @lines, "== Version ==";
+                push @lines, "";
+                push @lines, "This function is available since SDL $revision.";
+                push @lines, "";
+            }
+
+            open(FH, '>', $fname) or die("Can't open $fname for write: $!\n");
+            foreach (@lines) {
+                print FH "$_\n";
+            }
+            close(FH);
+        }
+    }
+}
+

+ 80 - 0
Engine/lib/sdl/build-scripts/git-pre-push-hook.pl

@@ -0,0 +1,80 @@
+#!/usr/bin/perl -w
+
+# To use this script: symlink it to .git/hooks/pre-push, then "git push"
+#
+# This script is called by "git push" after it has checked the remote status,
+# but before anything has been pushed.  If this script exits with a non-zero
+# status nothing will be pushed.
+#
+# This hook is called with the following parameters:
+#
+# $1 -- Name of the remote to which the push is being done
+# $2 -- URL to which the push is being done
+#
+# If pushing without using a named remote those arguments will be equal.
+#
+# Information about the commits which are being pushed is supplied as lines to
+# the standard input in the form:
+#
+#   <local ref> <local sha1> <remote ref> <remote sha1>
+
+use warnings;
+use strict;
+
+my $remote = $ARGV[0];
+my $url = $ARGV[1];
+
+#print("remote: $remote\n");
+#print("url: $url\n");
+
+$url =~ s/\.git$//;  # change myorg/myproject.git to myorg/myproject
+$url =~ s#^git\@github\.com\:#https://github.com/#i;
+my $commiturl = $url =~ /\Ahttps?:\/\/github.com\// ? "$url/commit/" : '';
+
+my $z40 = '0000000000000000000000000000000000000000';
+my $reported = 0;
+
+while (<STDIN>) {
+    chomp;
+    my ($local_ref, $local_sha, $remote_ref, $remote_sha) = split / /;
+    #print("local_ref: $local_ref\n");
+    #print("local_sha: $local_sha\n");
+    #print("remote_ref: $remote_ref\n");
+    #print("remote_sha: $remote_sha\n");
+
+    my $range = '';
+    if ($remote_sha eq $z40) {  # New branch, examine all commits
+        $range = $local_sha;
+    } else { # Update to existing branch, examine new commits
+        $range = "$remote_sha..$local_sha";
+    }
+
+    my $gitcmd = "git log --reverse --oneline --no-abbrev-commit '$range'";
+    open(GITPIPE, '-|', $gitcmd) or die("\n\n$0: Failed to run '$gitcmd': $!\n\nAbort push!\n\n");
+    while (<GITPIPE>) {
+        chomp;
+        if (/\A([a-fA-F0-9]+)\s+(.*?)\Z/) {
+            my $hash = $1;
+            my $msg = $2;
+
+            if (!$reported) {
+                print("\nCommits expected to be pushed:\n");
+                $reported = 1;
+            }
+
+            #print("hash: $hash\n");
+            #print("msg: $msg\n");
+
+            print("$commiturl$hash -- $msg\n");
+        } else {
+            die("$0: Unexpected output from '$gitcmd'!\n\nAbort push!\n\n");
+        }
+    }
+    die("\n\n$0: Failing exit code from running '$gitcmd'!\n\nAbort push!\n\n") if !close(GITPIPE);
+}
+
+print("\n") if $reported;
+
+exit(0);  # Let the push go forward.
+
+# vi: set ts=4 sw=4 expandtab:

+ 218 - 204
Engine/lib/sdl/build-scripts/install-sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/bin/sh
 # install - install a program, script, or datafile
 # install - install a program, script, or datafile
 
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2020-11-14.01; # UTC
 
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
 # This script is compatible with the BSD install script, but was written
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 # from scratch.
 
 
+tab='	'
 nl='
 nl='
 '
 '
-IFS=" ""	$nl"
+IFS=" $tab$nl"
 
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
 doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 
 # Put in absolute file names if you don't have them in your path;
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
 # or use environment vars.
@@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 stripprog=${STRIPPROG-strip}
 
 
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
 posix_mkdir=
 posix_mkdir=
 
 
 # Desired mode of installed file.
 # Desired mode of installed file.
 mode=0755
 mode=0755
 
 
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
 chgrpcmd=
 chgrpcmd=
 chmodcmd=$chmodprog
 chmodcmd=$chmodprog
 chowncmd=
 chowncmd=
@@ -97,7 +87,7 @@ dir_arg=
 dst_arg=
 dst_arg=
 
 
 copy_on_change=false
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 
 usage="\
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -114,18 +104,28 @@ Options:
      --version  display version info and exit.
      --version  display version info and exit.
 
 
   -c            (ignored)
   -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
+  -C            install only if different (preserve data modification time)
   -d            create directories instead of installing files.
   -d            create directories instead of installing files.
   -g GROUP      $chgrpprog installed files to GROUP.
   -g GROUP      $chgrpprog installed files to GROUP.
   -m MODE       $chmodprog installed files to MODE.
   -m MODE       $chmodprog installed files to MODE.
   -o USER       $chownprog installed files to USER.
   -o USER       $chownprog installed files to USER.
+  -p            pass -p to $cpprog.
   -s            $stripprog installed files.
   -s            $stripprog installed files.
+  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.
   -t DIRECTORY  install into DIRECTORY.
   -t DIRECTORY  install into DIRECTORY.
   -T            report an error if DSTFILE is a directory.
   -T            report an error if DSTFILE is a directory.
 
 
 Environment variables override the default commands:
 Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   RMPROG STRIPPROG
   RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to [email protected].
+Automake home page: https://www.gnu.org/software/automake/
 "
 "
 
 
 while test $# -ne 0; do
 while test $# -ne 0; do
@@ -137,46 +137,62 @@ while test $# -ne 0; do
     -d) dir_arg=true;;
     -d) dir_arg=true;;
 
 
     -g) chgrpcmd="$chgrpprog $2"
     -g) chgrpcmd="$chgrpprog $2"
-	shift;;
+        shift;;
 
 
     --help) echo "$usage"; exit $?;;
     --help) echo "$usage"; exit $?;;
 
 
     -m) mode=$2
     -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
 
     -o) chowncmd="$chownprog $2"
     -o) chowncmd="$chownprog $2"
-	shift;;
+        shift;;
+
+    -p) cpprog="$cpprog -p";;
 
 
     -s) stripcmd=$stripprog;;
     -s) stripcmd=$stripprog;;
 
 
-    -t) dst_arg=$2
-	# Protect names problematic for 'test' and other utilities.
-	case $dst_arg in
-	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
-	esac
-	shift;;
+    -S) backupsuffix="$2"
+        shift;;
 
 
-    -T) no_target_directory=true;;
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
 
 
     --version) echo "$0 $scriptversion"; exit $?;;
     --version) echo "$0 $scriptversion"; exit $?;;
 
 
-    --)	shift
-	break;;
+    --) shift
+        break;;
 
 
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
 
     *)  break;;
     *)  break;;
   esac
   esac
   shift
   shift
 done
 done
 
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
   # When -t is used, the destination is already specified.
@@ -207,6 +223,15 @@ if test $# -eq 0; then
   exit 0
   exit 0
 fi
 fi
 
 
+if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
 if test -z "$dir_arg"; then
 if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=129; $do_exit" 1
@@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
 
 
     *[0-7])
     *[0-7])
       if test -z "$stripcmd"; then
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
       else
-	u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
     *)
       if test -z "$stripcmd"; then
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
       else
-	u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       fi
       cp_umask=$mode$u_plus_rw;;
       cp_umask=$mode$u_plus_rw;;
   esac
   esac
@@ -250,6 +275,10 @@ do
     dstdir=$dst
     dstdir=$dst
     test -d "$dstdir"
     test -d "$dstdir"
     dstdir_status=$?
     dstdir_status=$?
+    # Don't chown directories that already exist.
+    if test $dstdir_status = 0; then
+      chowncmd=""
+    fi
   else
   else
 
 
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -266,178 +295,148 @@ do
     fi
     fi
     dst=$dst_arg
     dst=$dst_arg
 
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       fi
       dstdir=$dst
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+	*/) dst=$dst$dstbase;;
+	*)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
       dstdir_status=0
     else
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       test -d "$dstdir"
       dstdir_status=$?
       dstdir_status=$?
     fi
     fi
   fi
   fi
 
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
   obsolete_mkdir_used=false
 
 
   if test $dstdir_status != 0; then
   if test $dstdir_status != 0; then
     case $posix_mkdir in
     case $posix_mkdir in
       '')
       '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+	# The $RANDOM variable is not portable (e.g., dash).  Use it
+	# here however when possible just to lower collision chance.
+	tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+	trap '
+	  ret=$?
+	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+	  exit $ret
+	' 0
+
+	# Because "mkdir -p" follows existing symlinks and we likely work
+	# directly in world-writeable /tmp, make sure that the '$tmpdir'
+	# directory is successfully created first before we actually test
+	# 'mkdir -p'.
+	if (umask $mkdir_umask &&
+	    $mkdirprog $mkdir_mode "$tmpdir" &&
+	    exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+	then
+	  if test -z "$dir_arg" || {
+	       # Check for POSIX incompatibilities with -m.
+	       # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+	       # other-writable bit of parent directory when it shouldn't.
+	       # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+	       test_tmpdir="$tmpdir/a"
+	       ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+	       case $ls_ld_tmpdir in
+		 d????-?r-*) different_mode=700;;
+		 d????-?--*) different_mode=755;;
+		 *) false;;
+	       esac &&
+	       $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+		 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+		 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+	       }
+	     }
+	  then posix_mkdir=:
+	  fi
+	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
 	else
 	else
-	  mkdir_mode=
+	  # Remove any dirs left behind by ancient mkdir implementations.
+	  rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
 	fi
 	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
+	trap '' 0;;
     esac
     esac
 
 
     if
     if
       $posix_mkdir && (
       $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
       )
     then :
     then :
     else
     else
 
 
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # mkdir does not conform to POSIX,
       # or it failed possibly due to a race condition.  Create the
       # or it failed possibly due to a race condition.  Create the
       # directory the slow way, step by step, checking for races as we go.
       # directory the slow way, step by step, checking for races as we go.
 
 
       case $dstdir in
       case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
       esac
 
 
-      eval "$initialize_posix_glob"
-
       oIFS=$IFS
       oIFS=$IFS
       IFS=/
       IFS=/
-      $posix_glob set -f
+      set -f
       set fnord $dstdir
       set fnord $dstdir
       shift
       shift
-      $posix_glob set +f
+      set +f
       IFS=$oIFS
       IFS=$oIFS
 
 
       prefixes=
       prefixes=
 
 
       for d
       for d
       do
       do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask $mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
       done
 
 
       if test -n "$prefixes"; then
       if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
       fi
     fi
     fi
   fi
   fi
@@ -450,14 +449,25 @@ do
   else
   else
 
 
     # Make a couple of temp file names in the proper directory.
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
 
     # Trap to clean up those temp files at exit.
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
 
 
     # Copy the file name to the temp name.
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    (umask $cp_umask &&
+     { test -z "$stripcmd" || {
+	 # Create $dsttmp read-write so that cp doesn't create it read-only,
+	 # which would cause strip to fail.
+	 if test -z "$doit"; then
+	   : >"$dsttmp" # No need to fork-exec 'touch'.
+	 else
+	   $doit touch "$dsttmp"
+	 fi
+       }
+     } &&
+     $doit_exec $cpprog "$src" "$dsttmp") &&
 
 
     # and set any options; do chmod last to preserve setuid bits.
     # and set any options; do chmod last to preserve setuid bits.
     #
     #
@@ -472,20 +482,24 @@ do
 
 
     # If -C, don't bother to copy if it wouldn't change the file.
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
+       set +f &&
        test "$old" = "$new" &&
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
     then
       rm -f "$dsttmp"
       rm -f "$dsttmp"
     else
     else
+      # If $backupsuffix is set, and the file being installed
+      # already exists, attempt a backup.  Don't worry if it fails,
+      # e.g., if mv doesn't support -f.
+      if test -n "$backupsuffix" && test -f "$dst"; then
+        $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+      fi
+
       # Rename the file to the real destination.
       # Rename the file to the real destination.
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
 
 
@@ -493,24 +507,24 @@ do
       # to itself, or perhaps because mv is so ancient that it does not
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       # 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.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
+        # 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.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
       }
       }
     fi || exit 1
     fi || exit 1
 
 
@@ -519,9 +533,9 @@ do
 done
 done
 
 
 # Local variables:
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # time-stamp-end: "; # UTC"
 # End:
 # End:

+ 0 - 190
Engine/lib/sdl/build-scripts/iosbuild.sh

@@ -1,190 +0,0 @@
-#!/bin/sh
-#
-# Build a fat binary for iOS
-
-# Number of CPUs (for make -j)
-NCPU=`sysctl -n hw.ncpu`
-if test x$NJOB = x; then
-    NJOB=$NCPU
-fi
-
-SRC_DIR=$(cd `dirname $0`/..; pwd)
-if [ "$PWD" = "$SRC_DIR" ]; then
-    PREFIX=$SRC_DIR/ios-build
-    if [ ! -d "$PREFIX" ]; then
-        mkdir $PREFIX
-    fi
-else
-    PREFIX=$PWD
-fi
-
-BUILD_I386_IOSSIM=YES
-BUILD_X86_64_IOSSIM=YES
-
-BUILD_IOS_ARMV7=YES
-BUILD_IOS_ARMV7S=YES
-BUILD_IOS_ARM64=YES
-
-# 13.4.0 - Mavericks
-# 14.0.0 - Yosemite
-# 15.0.0 - El Capitan
-DARWIN=darwin15.0.0
-
-XCODEDIR=`xcode-select --print-path`
-IOS_SDK_VERSION=`xcrun --sdk iphoneos --show-sdk-version`
-MIN_SDK_VERSION=6.0
-
-IPHONEOS_PLATFORM=`xcrun --sdk iphoneos --show-sdk-platform-path`
-IPHONEOS_SYSROOT=`xcrun --sdk iphoneos --show-sdk-path`
-
-IPHONESIMULATOR_PLATFORM=`xcrun --sdk iphonesimulator --show-sdk-platform-path`
-IPHONESIMULATOR_SYSROOT=`xcrun --sdk iphonesimulator --show-sdk-path`
-
-# Uncomment if you want to see more information about each invocation
-# of clang as the builds proceed.
-# CLANG_VERBOSE="--verbose"
-
-CC=clang
-CXX=clang
-
-SILENCED_WARNINGS="-Wno-unused-local-typedef -Wno-unused-function"
-
-CFLAGS="${CLANG_VERBOSE} ${SILENCED_WARNINGS} -DNDEBUG -g -O0 -pipe -fPIC -fobjc-arc"
-
-echo "PREFIX ..................... ${PREFIX}"
-echo "BUILD_MACOSX_X86_64 ........ ${BUILD_MACOSX_X86_64}"
-echo "BUILD_I386_IOSSIM .......... ${BUILD_I386_IOSSIM}"
-echo "BUILD_X86_64_IOSSIM ........ ${BUILD_X86_64_IOSSIM}"
-echo "BUILD_IOS_ARMV7 ............ ${BUILD_IOS_ARMV7}"
-echo "BUILD_IOS_ARMV7S ........... ${BUILD_IOS_ARMV7S}"
-echo "BUILD_IOS_ARM64 ............ ${BUILD_IOS_ARM64}"
-echo "DARWIN ..................... ${DARWIN}"
-echo "XCODEDIR ................... ${XCODEDIR}"
-echo "IOS_SDK_VERSION ............ ${IOS_SDK_VERSION}"
-echo "MIN_SDK_VERSION ............ ${MIN_SDK_VERSION}"
-echo "IPHONEOS_PLATFORM .......... ${IPHONEOS_PLATFORM}"
-echo "IPHONEOS_SYSROOT ........... ${IPHONEOS_SYSROOT}"
-echo "IPHONESIMULATOR_PLATFORM ... ${IPHONESIMULATOR_PLATFORM}"
-echo "IPHONESIMULATOR_SYSROOT .... ${IPHONESIMULATOR_SYSROOT}"
-echo "CC ......................... ${CC}"
-echo "CFLAGS ..................... ${CFLAGS}"
-echo "CXX ........................ ${CXX}"
-echo "CXXFLAGS ................... ${CXXFLAGS}"
-echo "LDFLAGS .................... ${LDFLAGS}"
-
-###################################################################
-# This section contains the build commands for each of the 
-# architectures that will be included in the universal binaries.
-###################################################################
-
-echo "$(tput setaf 2)"
-echo "###########################"
-echo "# i386 for iPhone Simulator"
-echo "###########################"
-echo "$(tput sgr0)"
-
-if [ "${BUILD_I386_IOSSIM}" == "YES" ]
-then
-    (
-        cd ${PREFIX}
-        make clean
-        ../configure --build=x86_64-apple-${DARWIN} --host=i386-ios-${DARWIN} --disable-shared --prefix=${PREFIX}/platform/i386-sim "CC=${CC}" "CFLAGS=${CFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch i386 -isysroot ${IPHONESIMULATOR_SYSROOT}" "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch i386 -isysroot ${IPHONESIMULATOR_SYSROOT}" LDFLAGS="-arch i386 -mios-simulator-version-min=${MIN_SDK_VERSION} ${LDFLAGS} -L${IPHONESIMULATOR_SYSROOT}/usr/lib/ -L${IPHONESIMULATOR_SYSROOT}/usr/lib/system" || exit 2
-        cp $SRC_DIR/include/SDL_config_iphoneos.h include/SDL_config.h
-        make -j10 || exit 3
-        make install
-    ) || exit $?
-fi
-
-echo "$(tput setaf 2)"
-echo "#############################"
-echo "# x86_64 for iPhone Simulator"
-echo "#############################"
-echo "$(tput sgr0)"
-
-if [ "${BUILD_X86_64_IOSSIM}" == "YES" ]
-then
-    (
-        cd ${PREFIX}
-        make clean
-        ../configure --build=x86_64-apple-${DARWIN} --host=x86_64-ios-${DARWIN} --disable-shared --prefix=${PREFIX}/platform/x86_64-sim "CC=${CC}" "CFLAGS=${CFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch x86_64 -isysroot ${IPHONESIMULATOR_SYSROOT}" "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS} -mios-simulator-version-min=${MIN_SDK_VERSION} -arch x86_64 -isysroot ${IPHONESIMULATOR_SYSROOT}" LDFLAGS="-arch x86_64 -mios-simulator-version-min=${MIN_SDK_VERSION} ${LDFLAGS} -L${IPHONESIMULATOR_SYSROOT}/usr/lib/ -L${IPHONESIMULATOR_SYSROOT}/usr/lib/system" || exit 2
-        cp $SRC_DIR/include/SDL_config_iphoneos.h include/SDL_config.h
-        make -j$NJOB || exit 3
-        make install
-    ) || exit $?
-fi
-
-echo "$(tput setaf 2)"
-echo "##################"
-echo "# armv7 for iPhone"
-echo "##################"
-echo "$(tput sgr0)"
-
-if [ "${BUILD_IOS_ARMV7}" == "YES" ]
-then
-    (
-        cd ${PREFIX}
-        make clean
-        ../configure --build=x86_64-apple-${DARWIN} --host=armv7-ios-${DARWIN} --disable-shared --prefix=${PREFIX}/platform/armv7-ios "CC=${CC}" "CFLAGS=${CFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch armv7 -isysroot ${IPHONEOS_SYSROOT}" "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS} -arch armv7 -isysroot ${IPHONEOS_SYSROOT}" LDFLAGS="-arch armv7 -miphoneos-version-min=${MIN_SDK_VERSION} ${LDFLAGS}" || exit 2
-        cp $SRC_DIR/include/SDL_config_iphoneos.h include/SDL_config.h
-        make -j$NJOB || exit 3
-        make install
-    ) || exit $?
-fi
-
-echo "$(tput setaf 2)"
-echo "###################"
-echo "# armv7s for iPhone"
-echo "###################"
-echo "$(tput sgr0)"
-
-if [ "${BUILD_IOS_ARMV7S}" == "YES" ]
-then
-    (
-        cd ${PREFIX}
-        make clean
-        ../configure --build=x86_64-apple-${DARWIN} --host=armv7s-ios-${DARWIN} --disable-shared --prefix=${PREFIX}/platform/armv7s-ios "CC=${CC}" "CFLAGS=${CFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch armv7s -isysroot ${IPHONEOS_SYSROOT}" "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch armv7s -isysroot ${IPHONEOS_SYSROOT}" LDFLAGS="-arch armv7s -miphoneos-version-min=${MIN_SDK_VERSION} ${LDFLAGS}" || exit 2
-        cp $SRC_DIR/include/SDL_config_iphoneos.h include/SDL_config.h
-        make -j$NJOB || exit 3
-        make install
-    ) || exit $?
-fi
-
-echo "$(tput setaf 2)"
-echo "##################"
-echo "# arm64 for iPhone"
-echo "##################"
-echo "$(tput sgr0)"
-
-if [ "${BUILD_IOS_ARM64}" == "YES" ]
-then
-    (
-        cd ${PREFIX}
-        make clean
-        ../configure --build=x86_64-apple-${DARWIN} --host=arm-ios-${DARWIN} --disable-shared --prefix=${PREFIX}/platform/arm64-ios "CC=${CC}" "CFLAGS=${CFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch arm64 -isysroot ${IPHONEOS_SYSROOT}" "CXX=${CXX}" "CXXFLAGS=${CXXFLAGS} -miphoneos-version-min=${MIN_SDK_VERSION} -arch arm64 -isysroot ${IPHONEOS_SYSROOT}" LDFLAGS="-arch arm64 -miphoneos-version-min=${MIN_SDK_VERSION} ${LDFLAGS}" || exit 2
-        cp $SRC_DIR/include/SDL_config_iphoneos.h include/SDL_config.h
-        make -j$NJOB || exit 3
-        make install
-    ) || exit $?
-fi
-
-echo "$(tput setaf 2)"
-echo "###################################################################"
-echo "# Create Universal Libraries and Finalize the packaging"
-echo "###################################################################"
-echo "$(tput sgr0)"
-
-(
-    cd ${PREFIX}/platform
-    mkdir -p universal
-    lipo x86_64-sim/lib/libSDL2.a i386-sim/lib/libSDL2.a arm64-ios/lib/libSDL2.a armv7s-ios/lib/libSDL2.a armv7-ios/lib/libSDL2.a -create -output universal/libSDL2.a
-)
-
-(
-    cd ${PREFIX}
-    mkdir -p lib
-    cp -r platform/universal/* lib
-    #rm -rf platform
-    lipo -info lib/libSDL2.a
-)
-
-echo Done!

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1887 - 653
Engine/lib/sdl/build-scripts/ltmain.sh


+ 13 - 13
Engine/lib/sdl/build-scripts/mkinstalldirs

@@ -1,7 +1,7 @@
 #! /bin/sh
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
 # mkinstalldirs --- make directory hierarchy
 
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2020-07-26.22; # UTC
 
 
 # Original author: Noah Friedman <[email protected]>
 # Original author: Noah Friedman <[email protected]>
 # Created: 1993-05-16
 # Created: 1993-05-16
@@ -92,6 +92,8 @@ case $dirmode in
   *)
   *)
     if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
     if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
        test ! -d ./--version; then
        test ! -d ./--version; then
+      echo "umask 22"
+      umask 22
       echo "mkdir -m $dirmode -p -- $*"
       echo "mkdir -m $dirmode -p -- $*"
       exec mkdir -m "$dirmode" -p -- "$@"
       exec mkdir -m "$dirmode" -p -- "$@"
     else
     else
@@ -104,6 +106,9 @@ case $dirmode in
     ;;
     ;;
 esac
 esac
 
 
+echo "umask 22"
+umask 22
+
 for file
 for file
 do
 do
   case $file in
   case $file in
@@ -132,21 +137,16 @@ do
 
 
       if test ! -d "$pathcomp"; then
       if test ! -d "$pathcomp"; then
 	errstatus=$lasterr
 	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
     fi
     fi
 
 
     pathcomp=$pathcomp/
     pathcomp=$pathcomp/
   done
   done
+
+  if test ! -z "$dirmode"; then
+    echo "chmod $dirmode $file"
+    chmod "$dirmode" "$file" || errstatus=$?
+  fi
 done
 done
 
 
 exit $errstatus
 exit $errstatus
@@ -154,9 +154,9 @@ exit $errstatus
 # Local Variables:
 # Local Variables:
 # mode: shell-script
 # mode: shell-script
 # sh-indentation: 2
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # time-stamp-end: "; # UTC"
 # End:
 # End:

+ 3 - 4
Engine/lib/sdl/build-scripts/os2-buildbot.sh

@@ -12,8 +12,7 @@ if [ -z "$WATCOM" ]; then
     echo "This is often something like '/usr/local/share/watcom'" 1>&2
     echo "This is often something like '/usr/local/share/watcom'" 1>&2
     exit 1
     exit 1
 fi
 fi
-
-export PATH="$WATCOM/binl:$PATH"
+export PATH="$WATCOM/binl64:$PATH"
 
 
 ZIPFILE="$1"
 ZIPFILE="$1"
 if [ -z $1 ]; then
 if [ -z $1 ]; then
@@ -31,8 +30,8 @@ rm -f $ZIPFILE
 wmake -f Makefile.os2
 wmake -f Makefile.os2
 rm -rf $ZIPDIR
 rm -rf $ZIPDIR
 mkdir -p $ZIPDIR
 mkdir -p $ZIPDIR
-chmod a+r SDL2.lib SDL2.dll
-mv SDL2.lib SDL2.dll $ZIPDIR/
+chmod 644 SDL2.dll SDL2.lib SDL2test.lib
+mv SDL2.dll SDL2.lib SDL2test.lib $ZIPDIR/
 cp -R include $ZIPDIR/
 cp -R include $ZIPDIR/
 zip -9r "buildbot/$ZIPFILE" $ZIPDIR
 zip -9r "buildbot/$ZIPFILE" $ZIPDIR
 
 

+ 4 - 4
Engine/lib/sdl/build-scripts/showrev.sh

@@ -5,9 +5,9 @@
 SDL_ROOT=$(dirname $0)/..
 SDL_ROOT=$(dirname $0)/..
 cd $SDL_ROOT
 cd $SDL_ROOT
 
 
-if [ -x "$(command -v hg)" ]; then
-    rev="$(hg parents --template 'hg-{rev}:{node|short}' 2>/dev/null)"
-    if [ $? = 0 ]; then
+if [ -x "$(command -v git)" ]; then
+    rev=$(echo "$(git remote get-url origin 2>/dev/null)@$(git rev-list HEAD~.. 2>/dev/null)")
+    if [ "$rev" != "@" ]; then
         echo $rev
         echo $rev
         exit 0
         exit 0
     fi
     fi
@@ -21,5 +21,5 @@ if [ -x "$(command -v p4)" ]; then
     fi
     fi
 fi
 fi
 
 
-echo "hg-0:baadf00d"
+echo ""
 exit 1
 exit 1

+ 1 - 1
Engine/lib/sdl/build-scripts/update-copyright.sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/bin/sh
 
 
 find . -type f -exec grep -Il "Copyright" {} \;     \
 find . -type f -exec grep -Il "Copyright" {} \;     \
-| grep -v \.hg                             \
+| grep -v \.git                             \
 | while read file;                            \
 | while read file;                            \
 do \
 do \
   LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \
   LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \

+ 2 - 3
Engine/lib/sdl/build-scripts/updaterev.sh

@@ -8,10 +8,9 @@ srcdir=..
 header=$outdir/include/SDL_revision.h
 header=$outdir/include/SDL_revision.h
 
 
 rev=`sh showrev.sh 2>/dev/null`
 rev=`sh showrev.sh 2>/dev/null`
-if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then
-    revnum=`echo $rev | sed 's,hg-\([0-9]*\).*,\1,'`
+if [ "$rev" != "" ]; then
     echo "#define SDL_REVISION \"$rev\"" >"$header.new"
     echo "#define SDL_REVISION \"$rev\"" >"$header.new"
-    echo "#define SDL_REVISION_NUMBER $revnum" >>"$header.new"
+    echo "#define SDL_REVISION_NUMBER 0" >>"$header.new"
     if diff $header $header.new >/dev/null 2>&1; then
     if diff $header $header.new >/dev/null 2>&1; then
         rm "$header.new"
         rm "$header.new"
     else
     else

+ 1258 - 0
Engine/lib/sdl/build-scripts/wikiheaders.pl

@@ -0,0 +1,1258 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Text::Wrap;
+
+my $srcpath = undef;
+my $wikipath = undef;
+my $warn_about_missing = 0;
+my $copy_direction = 0;
+
+foreach (@ARGV) {
+    $warn_about_missing = 1, next if $_ eq '--warn-about-missing';
+    $copy_direction = 1, next if $_ eq '--copy-to-headers';
+    $copy_direction = 1, next if $_ eq '--copy-to-header';
+    $copy_direction = -1, next if $_ eq '--copy-to-wiki';
+    $copy_direction = -2, next if $_ eq '--copy-to-manpages';
+    $srcpath = $_, next if not defined $srcpath;
+    $wikipath = $_, next if not defined $wikipath;
+}
+
+my $wordwrap_mode = 'mediawiki';
+sub wordwrap_atom {   # don't call this directly.
+    my $str = shift;
+    return fill('', '', $str);
+}
+
+sub wordwrap_with_bullet_indent {  # don't call this directly.
+    my $bullet = shift;
+    my $str = shift;
+    my $retval = '';
+
+    #print("WORDWRAP BULLET ('$bullet'):\n\n$str\n\n");
+
+    # You _can't_ (at least with Pandoc) have a bullet item with a newline in
+    #  MediaWiki, so _remove_ wrapping!
+    if ($wordwrap_mode eq 'mediawiki') {
+        $retval = "$bullet$str";
+        $retval =~ s/\n/ /gms;
+        $retval =~ s/\s+$//gms;
+        #print("WORDWRAP BULLET DONE:\n\n$retval\n\n");
+        return "$retval\n";
+    }
+
+    my $bulletlen = length($bullet);
+
+    # wrap it and then indent each line to be under the bullet.
+    $Text::Wrap::columns -= $bulletlen;
+    my @wrappedlines = split /\n/, wordwrap_atom($str);
+    $Text::Wrap::columns += $bulletlen;
+
+    my $prefix = $bullet;
+    my $usual_prefix = ' ' x $bulletlen;
+
+    foreach (@wrappedlines) {
+        $retval .= "$prefix$_\n";
+        $prefix = $usual_prefix;
+    }
+
+    return $retval;
+}
+
+sub wordwrap_one_paragraph {  # don't call this directly.
+    my $retval = '';
+    my $p = shift;
+    #print "\n\n\nPARAGRAPH: [$p]\n\n\n";
+    if ($p =~ s/\A([\*\-] )//) {  # bullet list, starts with "* " or "- ".
+        my $bullet = $1;
+        my $item = '';
+        my @items = split /\n/, $p;
+        foreach (@items) {
+            if (s/\A([\*\-] )//) {
+                $retval .= wordwrap_with_bullet_indent($bullet, $item);
+                $item = '';
+            }
+            s/\A\s*//;
+            $item .= "$_\n";   # accumulate lines until we hit the end or another bullet.
+        }
+        if ($item ne '') {
+            $retval .= wordwrap_with_bullet_indent($bullet, $item);
+        }
+    } else {
+        $retval = wordwrap_atom($p) . "\n";
+    }
+
+    return $retval;
+}
+
+sub wordwrap_paragraphs {  # don't call this directly.
+    my $str = shift;
+    my $retval = '';
+    my @paragraphs = split /\n\n/, $str;
+    foreach (@paragraphs) {
+        next if $_ eq '';
+        $retval .= wordwrap_one_paragraph($_);
+        $retval .= "\n";
+    }
+    return $retval;
+}
+
+my $wordwrap_default_columns = 76;
+sub wordwrap {
+    my $str = shift;
+    my $columns = shift;
+
+    $columns = $wordwrap_default_columns if not defined $columns;
+    $columns += $wordwrap_default_columns if $columns < 0;
+    $Text::Wrap::columns = $columns;
+
+    my $retval = '';
+
+    #print("\n\nWORDWRAP:\n\n$str\n\n\n");
+
+    $str =~ s/\A\n+//ms;
+
+    while ($str =~ s/(.*?)(\`\`\`.*?\`\`\`|\<syntaxhighlight.*?\<\/syntaxhighlight\>)//ms) {
+        #print("\n\nWORDWRAP BLOCK:\n\n$1\n\n ===\n\n$2\n\n\n");
+        $retval .= wordwrap_paragraphs($1); # wrap it.
+        $retval .= "$2\n\n";  # don't wrap it.
+    }
+
+    $retval .= wordwrap_paragraphs($str);  # wrap what's left.
+    $retval =~ s/\n+\Z//ms;
+
+    #print("\n\nWORDWRAP DONE:\n\n$retval\n\n\n");
+    return $retval;
+}
+
+# This assumes you're moving from Markdown (in the Doxygen data) to Wiki, which
+#  is why the 'md' section is so sparse.
+sub wikify_chunk {
+    my $wikitype = shift;
+    my $str = shift;
+    my $codelang = shift;
+    my $code = shift;
+
+    #print("\n\nWIKIFY CHUNK:\n\n$str\n\n\n");
+
+    if ($wikitype eq 'mediawiki') {
+        # convert `code` things first, so they aren't mistaken for other markdown items.
+        my $codedstr = '';
+        while ($str =~ s/\A(.*?)\`(.*?)\`//ms) {
+            my $codeblock = $2;
+            $codedstr .= wikify_chunk($wikitype, $1, undef, undef);
+            # Convert obvious SDL things to wikilinks, even inside `code` blocks.
+            $codeblock =~ s/\b(SDL_[a-zA-Z0-9_]+)/[[$1]]/gms;
+            $codedstr .= "<code>$codeblock</code>";
+        }
+
+        # Convert obvious SDL things to wikilinks.
+        $str =~ s/\b(SDL_[a-zA-Z0-9_]+)/[[$1]]/gms;
+
+        # Make some Markdown things into MediaWiki...
+
+        # bold+italic
+        $str =~ s/\*\*\*(.*?)\*\*\*/'''''$1'''''/gms;
+
+        # bold
+        $str =~ s/\*\*(.*?)\*\*/'''$1'''/gms;
+
+        # italic
+        $str =~ s/\*(.*?)\*/''$1''/gms;
+
+        # bullets
+        $str =~ s/^\- /* /gm;
+
+        $str = $codedstr . $str;
+
+        if (defined $code) {
+            $str .= "<syntaxhighlight lang='$codelang'>$code<\/syntaxhighlight>";
+        }
+    } elsif ($wikitype eq 'md') {
+        # Convert obvious SDL things to wikilinks.
+        $str =~ s/\b(SDL_[a-zA-Z0-9_]+)/[$1]($1)/gms;
+        if (defined $code) {
+            $str .= "```$codelang$code```";
+        }
+    }
+
+    #print("\n\nWIKIFY CHUNK DONE:\n\n$str\n\n\n");
+
+    return $str;
+}
+
+sub wikify {
+    my $wikitype = shift;
+    my $str = shift;
+    my $retval = '';
+
+    #print("WIKIFY WHOLE:\n\n$str\n\n\n");
+
+    while ($str =~ s/\A(.*?)\`\`\`(c\+\+|c)(.*?)\`\`\`//ms) {
+        $retval .= wikify_chunk($wikitype, $1, $2, $3);
+    }
+    $retval .= wikify_chunk($wikitype, $str, undef, undef);
+
+    #print("WIKIFY WHOLE DONE:\n\n$retval\n\n\n");
+
+    return $retval;
+}
+
+
+my $dewikify_mode = 'md';
+my $dewikify_manpage_code_indent = 1;
+
+sub dewikify_chunk {
+    my $wikitype = shift;
+    my $str = shift;
+    my $codelang = shift;
+    my $code = shift;
+
+    #print("\n\nDEWIKIFY CHUNK:\n\n$str\n\n\n");
+
+    if ($dewikify_mode eq 'md') {
+        if ($wikitype eq 'mediawiki') {
+            # Doxygen supports Markdown (and it just simply looks better than MediaWiki
+            # when looking at the raw headers), so do some conversions here as necessary.
+
+            $str =~ s/\[\[(SDL_[a-zA-Z0-9_]+)\]\]/$1/gms;  # Dump obvious wikilinks.
+
+            # <code></code> is also popular.  :/
+            $str =~ s/\<code>(.*?)<\/code>/`$1`/gms;
+
+            # bold+italic
+            $str =~ s/'''''(.*?)'''''/***$1***/gms;
+
+            # bold
+            $str =~ s/'''(.*?)'''/**$1**/gms;
+
+            # italic
+            $str =~ s/''(.*?)''/*$1*/gms;
+
+            # bullets
+            $str =~ s/^\* /- /gm;
+        }
+
+        if (defined $code) {
+            $str .= "```$codelang$code```";
+        }
+    } elsif ($dewikify_mode eq 'manpage') {
+        $str =~ s/\./\\[char46]/gms;  # make sure these can't become control codes.
+        if ($wikitype eq 'mediawiki') {
+            $str =~ s/\s*\[\[(SDL_[a-zA-Z0-9_]+)\]\]\s*/\n.BR $1\n/gms;  # Dump obvious wikilinks.
+
+            # <code></code> is also popular.  :/
+            $str =~ s/\s*\<code>(.*?)<\/code>\s*/\n.BR $1\n/gms;
+
+            # bold+italic
+            $str =~ s/\s*'''''(.*?)'''''\s*/\n.BI $1\n/gms;
+
+            # bold
+            $str =~ s/\s*'''(.*?)'''\s*/\n.B $1\n/gms;
+
+            # italic
+            $str =~ s/\s*''(.*?)''\s*/\n.I $1\n/gms;
+
+            # bullets
+            $str =~ s/^\* /\n\\\(bu /gm;
+        } else {
+            die("Unexpected wikitype when converting to manpages\n");   # !!! FIXME: need to handle Markdown wiki pages.
+        }
+
+        if (defined $code) {
+            $code =~ s/\A\n+//gms;
+            $code =~ s/\n+\Z//gms;
+            if ($dewikify_manpage_code_indent) {
+                $str .= "\n.IP\n"
+            } else {
+                $str .= "\n.PP\n"
+            }
+            $str .= ".EX\n$code\n.EE\n.PP\n";
+        }
+    } else {
+        die("Unexpected dewikify_mode\n");
+    }
+
+    #print("\n\nDEWIKIFY CHUNK DONE:\n\n$str\n\n\n");
+
+    return $str;
+}
+
+sub dewikify {
+    my $wikitype = shift;
+    my $str = shift;
+    return '' if not defined $str;
+
+    #print("DEWIKIFY WHOLE:\n\n$str\n\n\n");
+
+    $str =~ s/\A[\s\n]*\= .*? \=\s*?\n+//ms;
+    $str =~ s/\A[\s\n]*\=\= .*? \=\=\s*?\n+//ms;
+
+    my $retval = '';
+    while ($str =~ s/\A(.*?)<syntaxhighlight lang='?(.*?)'?>(.*?)<\/syntaxhighlight\>//ms) {
+        $retval .= dewikify_chunk($wikitype, $1, $2, $3);
+    }
+    $retval .= dewikify_chunk($wikitype, $str, undef, undef);
+
+    #print("DEWIKIFY WHOLE DONE:\n\n$retval\n\n\n");
+
+    return $retval;
+}
+
+sub usage {
+    die("USAGE: $0 <source code git clone path> <wiki git clone path> [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing]\n\n");
+}
+
+usage() if not defined $srcpath;
+usage() if not defined $wikipath;
+#usage() if $copy_direction == 0;
+
+my @standard_wiki_sections = (
+    'Draft',
+    '[Brief]',
+    'Deprecated',
+    'Syntax',
+    'Function Parameters',
+    'Return Value',
+    'Remarks',
+    'Version',
+    'Code Examples',
+    'Related Functions'
+);
+
+# Sections that only ever exist in the wiki and shouldn't be deleted when
+#  not found in the headers.
+my %only_wiki_sections = (  # The ones don't mean anything, I just need to check for key existence.
+    'Draft', 1,
+    'Code Examples', 1
+);
+
+
+my %headers = ();       # $headers{"SDL_audio.h"} -> reference to an array of all lines of text in SDL_audio.h.
+my %headerfuncs = ();   # $headerfuncs{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded!
+my %headerdecls = ();
+my %headerfuncslocation = ();   # $headerfuncslocation{"SDL_OpenAudio"} -> name of header holding SDL_OpenAudio define ("SDL_audio.h" in this case).
+my %headerfuncschunk = ();   # $headerfuncschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this function.
+my %headerfuncshasdoxygen = ();   # $headerfuncschunk{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function.
+
+my $incpath = "$srcpath/include";
+opendir(DH, $incpath) or die("Can't opendir '$incpath': $!\n");
+while (readdir(DH)) {
+    my $dent = $_;
+    next if not $dent =~ /\ASDL.*?\.h\Z/;  # just SDL*.h headers.
+    open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n");
+
+    my @contents = ();
+
+    while (<FH>) {
+        chomp;
+        my $decl;
+        my @templines;
+        my $str;
+        my $has_doxygen = 1;
+        if (/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {  # a function declaration without a doxygen comment?
+            @templines = ();
+            $decl = $_;
+            $str = '';
+            $has_doxygen = 0;
+        } elsif (not /\A\/\*\*\s*\Z/) {  # not doxygen comment start?
+            push @contents, $_;
+            next;
+        } else {   # Start of a doxygen comment, parse it out.
+            @templines = ( $_ );
+            while (<FH>) {
+                chomp;
+                push @templines, $_;
+                last if /\A\s*\*\/\Z/;
+                if (s/\A\s*\*\s*\`\`\`/```/) {  # this is a hack, but a lot of other code relies on the whitespace being trimmed, but we can't trim it in code blocks...
+                    $str .= "$_\n";
+                    while (<FH>) {
+                        chomp;
+                        push @templines, $_;
+                        s/\A\s*\*\s?//;
+                        if (s/\A\s*\`\`\`/```/) {
+                            $str .= "$_\n";
+                            last;
+                        } else {
+                            $str .= "$_\n";
+                        }
+                    }
+                } else {
+                    s/\A\s*\*\s*//;
+                    $str .= "$_\n";
+                }
+            }
+
+            $decl = <FH>;
+            $decl = '' if not defined $decl;
+            chomp($decl);
+            if (not $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {
+                #print "Found doxygen but no function sig:\n$str\n\n";
+                foreach (@templines) {
+                    push @contents, $_;
+                }
+                push @contents, $decl;
+                next;
+            }
+        }
+
+        my @decllines = ( $decl );
+
+        if (not $decl =~ /\)\s*;/) {
+            while (<FH>) {
+                chomp;
+                push @decllines, $_;
+                s/\A\s+//;
+                s/\s+\Z//;
+                $decl .= " $_";
+                last if /\)\s*;/;
+            }
+        }
+
+        $decl =~ s/\s+\);\Z/);/;
+        $decl =~ s/\s+\Z//;
+        #print("DECL: [$decl]\n");
+
+        my $fn = '';
+        if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
+            $fn = $6;
+            #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
+        } else {
+            #print "Found doxygen but no function sig:\n$str\n\n";
+            foreach (@templines) {
+                push @contents, $_;
+            }
+            foreach (@decllines) {
+                push @contents, $_;
+            }
+            next;
+        }
+
+        $decl = '';  # build this with the line breaks, since it looks better for syntax highlighting.
+        foreach (@decllines) {
+            if ($decl eq '') {
+                $decl = $_;
+                $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$2$3 /;
+            } else {
+                my $trimmed = $_;
+                # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
+                $trimmed =~ s/\A\s{24}//;  # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL "
+                $decl .= $trimmed;
+            }
+            $decl .= "\n";
+        }
+
+        #print("$fn:\n$str\n\n");
+
+        # There might be multiple declarations of a function due to #ifdefs,
+        #  and only one of them will have documentation. If we hit an
+        #  undocumented one before, delete the placeholder line we left for
+        #  it so it doesn't accumulate a new blank line on each run.
+        my $skipfn = 0;
+        if (defined $headerfuncshasdoxygen{$fn}) {
+            if ($headerfuncshasdoxygen{$fn} == 0) {  # An undocumented declaration already exists, nuke its placeholder line.
+                delete $contents[$headerfuncschunk{$fn}];  # delete DOES NOT RENUMBER existing elements!
+            } else {  # documented function already existed?
+                $skipfn = 1;  # don't add this copy to the list of functions.
+                if ($has_doxygen) {
+                    print STDERR "WARNING: Function '$fn' appears to be documented in multiple locations. Only keeping the first one we saw!\n";
+                }
+                push @contents, join("\n", @decllines);  # just put the existing declation in as-is.
+            }
+        }
+
+        if (!$skipfn) {
+            $headerfuncs{$fn} = $str;
+            $headerdecls{$fn} = $decl;
+            $headerfuncslocation{$fn} = $dent;
+            $headerfuncschunk{$fn} = scalar(@contents);
+            $headerfuncshasdoxygen{$fn} = $has_doxygen;
+            push @contents, join("\n", @templines);
+            push @contents, join("\n", @decllines);
+        }
+
+    }
+    close(FH);
+
+    $headers{$dent} = \@contents;
+}
+closedir(DH);
+
+
+# !!! FIXME: we need to parse enums and typedefs and structs and defines and and and and and...
+# !!! FIXME:  (but functions are good enough for now.)
+
+my %wikitypes = ();  # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki'
+my %wikifuncs = ();  # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikifuncs{"SDL_OpenAudio"}{"Remarks"}.
+my %wikisectionorder = ();   # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
+opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
+while (readdir(DH)) {
+    my $dent = $_;
+    my $type = '';
+    if ($dent =~ /\ASDL.*?\.(md|mediawiki)\Z/) {
+        $type = $1;
+    } else {
+        next;  # only dealing with wiki pages.
+    }
+
+    open(FH, '<', "$wikipath/$dent") or die("Can't open '$wikipath/$dent': $!\n");
+
+    my $current_section = '[start]';
+    my @section_order = ( $current_section );
+    my $fn = $dent;
+    $fn =~ s/\..*\Z//;
+    my %sections = ();
+    $sections{$current_section} = '';
+
+    while (<FH>) {
+        chomp;
+        my $orig = $_;
+        s/\A\s*//;
+        s/\s*\Z//;
+
+        if ($type eq 'mediawiki') {
+            if (/\A\= (.*?) \=\Z/) {
+                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
+                push @section_order, $current_section;
+                $sections{$current_section} = '';
+            } elsif (/\A\=\= (.*?) \=\=\Z/) {
+                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
+                push @section_order, $current_section;
+                $sections{$current_section} = '';
+                next;
+            } elsif (/\A\-\-\-\-\Z/) {
+                $current_section = '[footer]';
+                die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
+                push @section_order, $current_section;
+                $sections{$current_section} = '';
+                next;
+            }
+        } elsif ($type eq 'md') {
+            if (/\A\#+ (.*?)\Z/) {
+                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
+                push @section_order, $current_section;
+                $sections{$current_section} = '';
+                next;
+            } elsif (/\A\-\-\-\-\Z/) {
+                $current_section = '[footer]';
+                die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
+                push @section_order, $current_section;
+                $sections{$current_section} = '';
+                next;
+            }
+        } else {
+            die("Unexpected wiki file type. Fixme!\n");
+        }
+
+        $sections{$current_section} .= "$orig\n";
+    }
+    close(FH);
+
+    foreach (keys %sections) {
+        $sections{$_} =~ s/\A\n+//;
+        $sections{$_} =~ s/\n+\Z//;
+        $sections{$_} .= "\n";
+    }
+
+    if (0) {
+        foreach (@section_order) {
+            print("$fn SECTION '$_':\n");
+            print($sections{$_});
+            print("\n\n");
+        }
+    }
+
+    $wikitypes{$fn} = $type;
+    $wikifuncs{$fn} = \%sections;
+    $wikisectionorder{$fn} = \@section_order;
+}
+closedir(DH);
+
+
+if ($warn_about_missing) {
+    foreach (keys %wikifuncs) {
+        my $fn = $_;
+        if (not defined $headerfuncs{$fn}) {
+            print("WARNING: $fn defined in the wiki but not the headers!\n");
+        }
+    }
+
+    foreach (keys %headerfuncs) {
+        my $fn = $_;
+        if (not defined $wikifuncs{$fn}) {
+            print("WARNING: $fn defined in the headers but not the wiki!\n");
+        }
+    }
+}
+
+if ($copy_direction == 1) {  # --copy-to-headers
+    my %changed_headers = ();
+
+    $dewikify_mode = 'md';
+    $wordwrap_mode = 'md';   # the headers use Markdown format.
+
+    foreach (keys %headerfuncs) {
+        my $fn = $_;
+        next if not defined $wikifuncs{$fn};  # don't have a page for that function, skip it.
+        my $wikitype = $wikitypes{$fn};
+        my $sectionsref = $wikifuncs{$fn};
+        my $remarks = %$sectionsref{'Remarks'};
+        my $params = %$sectionsref{'Function Parameters'};
+        my $returns = %$sectionsref{'Return Value'};
+        my $version = %$sectionsref{'Version'};
+        my $related = %$sectionsref{'Related Functions'};
+        my $deprecated = %$sectionsref{'Deprecated'};
+        my $brief = %$sectionsref{'[Brief]'};
+        my $addblank = 0;
+        my $str = '';
+
+        $headerfuncshasdoxygen{$fn} = 1;  # Added/changed doxygen for this header.
+
+        $brief = dewikify($wikitype, $brief);
+        $brief =~ s/\A(.*?\.) /$1\n/;  # \brief should only be one sentence, delimited by a period+space. Split if necessary.
+        my @briefsplit = split /\n/, $brief;
+        $brief = shift @briefsplit;
+
+        if (defined $remarks) {
+            $remarks = join("\n", @briefsplit) . dewikify($wikitype, $remarks);
+        }
+
+        if (defined $brief) {
+            $str .= "\n" if $addblank; $addblank = 1;
+            $str .= wordwrap($brief) . "\n";
+        }
+
+        if (defined $remarks) {
+            $str .= "\n" if $addblank; $addblank = 1;
+            $str .= wordwrap($remarks) . "\n";
+        }
+
+        if (defined $deprecated) {
+            # !!! FIXME: lots of code duplication in all of these.
+            $str .= "\n" if $addblank; $addblank = 1;
+            my $v = dewikify($wikitype, $deprecated);
+            my $whitespacelen = length("\\deprecated") + 1;
+            my $whitespace = ' ' x $whitespacelen;
+            $v = wordwrap($v, -$whitespacelen);
+            my @desclines = split /\n/, $v;
+            my $firstline = shift @desclines;
+            $str .= "\\deprecated $firstline\n";
+            foreach (@desclines) {
+                $str .= "${whitespace}$_\n";
+            }
+        }
+
+        if (defined $params) {
+            $str .= "\n" if $addblank; $addblank = (defined $returns) ? 0 : 1;
+            my @lines = split /\n/, dewikify($wikitype, $params);
+            if ($wikitype eq 'mediawiki') {
+                die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|');  # Dump the '{|' start
+                while (scalar(@lines) >= 3) {
+                    my $name = shift @lines;
+                    my $desc = shift @lines;
+                    my $terminator = shift @lines;  # the '|-' or '|}' line.
+                    last if ($terminator ne '|-') and ($terminator ne '|}');  # we seem to have run out of table.
+                    $name =~ s/\A\|\s*//;
+                    $name =~ s/\A\*\*(.*?)\*\*/$1/;
+                    $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
+                    $desc =~ s/\A\|\s*//;
+                    #print STDERR "FN: $fn   NAME: $name   DESC: $desc TERM: $terminator\n";
+                    my $whitespacelen = length($name) + 8;
+                    my $whitespace = ' ' x $whitespacelen;
+                    $desc = wordwrap($desc, -$whitespacelen);
+                    my @desclines = split /\n/, $desc;
+                    my $firstline = shift @desclines;
+                    $str .= "\\param $name $firstline\n";
+                    foreach (@desclines) {
+                        $str .= "${whitespace}$_\n";
+                    }
+                }
+            } else {
+                die("write me");
+            }
+        }
+
+        if (defined $returns) {
+            $str .= "\n" if $addblank; $addblank = 1;
+            my $r = dewikify($wikitype, $returns);
+            my $retstr = "\\returns";
+            if ($r =~ s/\AReturn(s?) //) {
+                $retstr = "\\return$1";
+            }
+
+            my $whitespacelen = length($retstr) + 1;
+            my $whitespace = ' ' x $whitespacelen;
+            $r = wordwrap($r, -$whitespacelen);
+            my @desclines = split /\n/, $r;
+            my $firstline = shift @desclines;
+            $str .= "$retstr $firstline\n";
+            foreach (@desclines) {
+                $str .= "${whitespace}$_\n";
+            }
+        }
+
+        if (defined $version) {
+            # !!! FIXME: lots of code duplication in all of these.
+            $str .= "\n" if $addblank; $addblank = 1;
+            my $v = dewikify($wikitype, $version);
+            my $whitespacelen = length("\\since") + 1;
+            my $whitespace = ' ' x $whitespacelen;
+            $v = wordwrap($v, -$whitespacelen);
+            my @desclines = split /\n/, $v;
+            my $firstline = shift @desclines;
+            $str .= "\\since $firstline\n";
+            foreach (@desclines) {
+                $str .= "${whitespace}$_\n";
+            }
+        }
+
+        if (defined $related) {
+            # !!! FIXME: lots of code duplication in all of these.
+            $str .= "\n" if $addblank; $addblank = 1;
+            my $v = dewikify($wikitype, $related);
+            my @desclines = split /\n/, $v;
+            foreach (@desclines) {
+                s/\A(\:|\* )//;
+                s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
+                $str .= "\\sa $_\n";
+            }
+        }
+
+        my $header = $headerfuncslocation{$fn};
+        my $contentsref = $headers{$header};
+        my $chunk = $headerfuncschunk{$fn};
+
+        my @lines = split /\n/, $str;
+
+        my $addnewline = (($chunk > 0) && ($$contentsref[$chunk-1] ne '')) ? "\n" : '';
+
+        my $output = "$addnewline/**\n";
+        foreach (@lines) {
+            chomp;
+            s/\s*\Z//;
+            if ($_ eq '') {
+                $output .= " *\n";
+            } else {
+                $output .= " * $_\n";
+            }
+        }
+        $output .= " */";
+
+        #print("$fn:\n$output\n\n");
+
+        $$contentsref[$chunk] = $output;
+        #$$contentsref[$chunk+1] = $headerdecls{$fn};
+
+        $changed_headers{$header} = 1;
+    }
+
+    foreach (keys %changed_headers) {
+        my $header = $_;
+
+        # this is kinda inefficient, but oh well.
+        my @removelines = ();
+        foreach (keys %headerfuncslocation) {
+            my $fn = $_;
+            next if $headerfuncshasdoxygen{$fn};
+            next if $headerfuncslocation{$fn} ne $header;
+            # the index of the blank line we put before the function declaration in case we needed to replace it with new content from the wiki.
+            push @removelines, $headerfuncschunk{$fn};
+        }
+
+        my $contentsref = $headers{$header};
+        foreach (@removelines) {
+            delete $$contentsref[$_];  # delete DOES NOT RENUMBER existing elements!
+        }
+
+        my $path = "$incpath/$header.tmp";
+        open(FH, '>', $path) or die("Can't open '$path': $!\n");
+        foreach (@$contentsref) {
+            print FH "$_\n" if defined $_;
+        }
+        close(FH);
+        rename($path, "$incpath/$header") or die("Can't rename '$path' to '$incpath/$header': $!\n");
+    }
+
+} elsif ($copy_direction == -1) { # --copy-to-wiki
+    foreach (keys %headerfuncs) {
+        my $fn = $_;
+        next if not $headerfuncshasdoxygen{$fn};
+        my $wikitype = defined $wikitypes{$fn} ? $wikitypes{$fn} : 'mediawiki';  # default to MediaWiki for new stuff FOR NOW.
+        die("Unexpected wikitype '$wikitype'\n") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage'));
+
+        #print("$fn\n"); next;
+
+        $wordwrap_mode = $wikitype;
+
+        my $raw = $headerfuncs{$fn};  # raw doxygen text with comment characters stripped from start/end and start of each line.
+        next if not defined $raw;
+        $raw =~ s/\A\s*\\brief\s+//;  # Technically we don't need \brief (please turn on JAVADOC_AUTOBRIEF if you use Doxygen), so just in case one is present, strip it.
+
+        my @doxygenlines = split /\n/, $raw;
+        my $brief = '';
+        while (@doxygenlines) {
+            last if $doxygenlines[0] =~ /\A\\/;  # some sort of doxygen command, assume we're past the general remarks.
+            last if $doxygenlines[0] =~ /\A\s*\Z/;  # blank line? End of paragraph, done.
+            my $l = shift @doxygenlines;
+            chomp($l);
+            $l =~ s/\A\s*//;
+            $l =~ s/\s*\Z//;
+            $brief .= "$l ";
+        }
+
+        $brief =~ s/\A(.*?\.) /$1\n\n/;  # \brief should only be one sentence, delimited by a period+space. Split if necessary.
+        my @briefsplit = split /\n/, $brief;
+        $brief = wikify($wikitype, shift @briefsplit) . "\n";
+        @doxygenlines = (@briefsplit, @doxygenlines);
+
+        my $remarks = '';
+        # !!! FIXME: wordwrap and wikify might handle this, now.
+        while (@doxygenlines) {
+            last if $doxygenlines[0] =~ /\A\\/;  # some sort of doxygen command, assume we're past the general remarks.
+            my $l = shift @doxygenlines;
+            if ($l =~ /\A\`\`\`/) {  # syntax highlighting, don't reformat.
+                $remarks .= "$l\n";
+                while ((@doxygenlines) && (not $l =~ /\`\`\`\Z/)) {
+                    $l = shift @doxygenlines;
+                    $remarks .= "$l\n";
+                }
+            } else {
+                $l =~ s/\A\s*//;
+                $l =~ s/\s*\Z//;
+                $remarks .= "$l\n";
+            }
+        }
+
+        #print("REMARKS:\n\n $remarks\n\n");
+
+        $remarks = wordwrap(wikify($wikitype, $remarks));
+        $remarks =~ s/\A\s*//;
+        $remarks =~ s/\s*\Z//;
+
+        my $decl = $headerdecls{$fn};
+        #$decl =~ s/\*\s+SDLCALL/ *SDLCALL/;  # Try to make "void * Function" become "void *Function"
+        #$decl =~ s/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL/$2$3/;
+
+        my $syntax = '';
+        if ($wikitype eq 'mediawiki') {
+            $syntax = "<syntaxhighlight lang='c'>\n$decl</syntaxhighlight>\n";
+        } elsif ($wikitype eq 'md') {
+            $syntax = "```c\n$decl\n```\n";
+        } else { die("Expected wikitype '$wikitype'\n"); }
+
+        my %sections = ();
+        $sections{'[Brief]'} = $brief;  # include this section even if blank so we get a title line.
+        $sections{'Remarks'} = "$remarks\n" if $remarks ne '';
+        $sections{'Syntax'} = $syntax;
+
+        my @params = ();  # have to parse these and build up the wiki tables after, since Markdown needs to know the length of the largest string.  :/
+
+        while (@doxygenlines) {
+            my $l = shift @doxygenlines;
+            if ($l =~ /\A\\param\s+(.*?)\s+(.*)\Z/) {
+                my $arg = $1;
+                my $desc = $2;
+                while (@doxygenlines) {
+                    my $subline = $doxygenlines[0];
+                    $subline =~ s/\A\s*//;
+                    last if $subline =~ /\A\\/;  # some sort of doxygen command, assume we're past this thing.
+                    shift @doxygenlines;  # dump this line from the array; we're using it.
+                    if ($subline eq '') {  # empty line, make sure it keeps the newline char.
+                        $desc .= "\n";
+                    } else {
+                        $desc .= " $subline";
+                    }
+                }
+
+                $desc =~ s/[\s\n]+\Z//ms;
+
+                # We need to know the length of the longest string to make Markdown tables, so we just store these off until everything is parsed.
+                push @params, $arg;
+                push @params, $desc;
+            } elsif ($l =~ /\A\\r(eturns?)\s+(.*)\Z/) {
+                my $retstr = "R$1";  # "Return" or "Returns"
+                my $desc = $2;
+                while (@doxygenlines) {
+                    my $subline = $doxygenlines[0];
+                    $subline =~ s/\A\s*//;
+                    last if $subline =~ /\A\\/;  # some sort of doxygen command, assume we're past this thing.
+                    shift @doxygenlines;  # dump this line from the array; we're using it.
+                    if ($subline eq '') {  # empty line, make sure it keeps the newline char.
+                        $desc .= "\n";
+                    } else {
+                        $desc .= " $subline";
+                    }
+                }
+                $desc =~ s/[\s\n]+\Z//ms;
+                $sections{'Return Value'} = wordwrap("$retstr " . wikify($wikitype, $desc)) . "\n";
+            } elsif ($l =~ /\A\\deprecated\s+(.*)\Z/) {
+                my $desc = $1;
+                while (@doxygenlines) {
+                    my $subline = $doxygenlines[0];
+                    $subline =~ s/\A\s*//;
+                    last if $subline =~ /\A\\/;  # some sort of doxygen command, assume we're past this thing.
+                    shift @doxygenlines;  # dump this line from the array; we're using it.
+                    if ($subline eq '') {  # empty line, make sure it keeps the newline char.
+                        $desc .= "\n";
+                    } else {
+                        $desc .= " $subline";
+                    }
+                }
+                $desc =~ s/[\s\n]+\Z//ms;
+                $sections{'Deprecated'} = wordwrap(wikify($wikitype, $desc)) . "\n";
+            } elsif ($l =~ /\A\\since\s+(.*)\Z/) {
+                my $desc = $1;
+                while (@doxygenlines) {
+                    my $subline = $doxygenlines[0];
+                    $subline =~ s/\A\s*//;
+                    last if $subline =~ /\A\\/;  # some sort of doxygen command, assume we're past this thing.
+                    shift @doxygenlines;  # dump this line from the array; we're using it.
+                    if ($subline eq '') {  # empty line, make sure it keeps the newline char.
+                        $desc .= "\n";
+                    } else {
+                        $desc .= " $subline";
+                    }
+                }
+                $desc =~ s/[\s\n]+\Z//ms;
+                $sections{'Version'} = wordwrap(wikify($wikitype, $desc)) . "\n";
+            } elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
+                my $sa = $1;
+                $sa =~ s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
+                $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'};
+                if ($wikitype eq 'mediawiki') {
+                    $sections{'Related Functions'} .= ":[[$sa]]\n";
+                } elsif ($wikitype eq 'md') {
+                    $sections{'Related Functions'} .= "* [$sa](/$sa)\n";
+                } else { die("Expected wikitype '$wikitype'\n"); }
+            }
+        }
+
+        # Make sure this ends with a double-newline.
+        $sections{'Related Functions'} .= "\n" if defined $sections{'Related Functions'};
+
+        # We can build the wiki table now that we have all the data.
+        if (scalar(@params) > 0) {
+            my $str = '';
+            if ($wikitype eq 'mediawiki') {
+                while (scalar(@params) > 0) {
+                    my $arg = shift @params;
+                    my $desc = wikify($wikitype, shift @params);
+                    $str .= ($str eq '') ? "{|\n" : "|-\n";
+                    $str .= "|'''$arg'''\n";
+                    $str .= "|$desc\n";
+                }
+                $str .= "|}\n";
+            } elsif ($wikitype eq 'md') {
+                my $longest_arg = 0;
+                my $longest_desc = 0;
+                my $which = 0;
+                foreach (@params) {
+                    if ($which == 0) {
+                        my $len = length($_) + 4;
+                        $longest_arg = $len if ($len > $longest_arg);
+                        $which = 1;
+                    } else {
+                        my $len = length(wikify($wikitype, $_));
+                        $longest_desc = $len if ($len > $longest_desc);
+                        $which = 0;
+                    }
+                }
+
+                # Markdown tables are sort of obnoxious.
+                $str .= '| ' . (' ' x ($longest_arg+4)) . ' | ' . (' ' x $longest_desc) . " |\n";
+                $str .= '| ' . ('-' x ($longest_arg+4)) . ' | ' . ('-' x $longest_desc) . " |\n";
+
+                while (@params) {
+                    my $arg = shift @params;
+                    my $desc = wikify($wikitype, shift @params);
+                    $str .= "| **$arg** " . (' ' x ($longest_arg - length($arg))) . "| $desc" . (' ' x ($longest_desc - length($desc))) . " |\n";
+                }
+            } else {
+                die("Unexpected wikitype!\n");  # should have checked this elsewhere.
+            }
+            $sections{'Function Parameters'} = $str;
+        }
+
+        my $path = "$wikipath/$_.${wikitype}.tmp";
+        open(FH, '>', $path) or die("Can't open '$path': $!\n");
+
+        my $sectionsref = $wikifuncs{$fn};
+
+        foreach (@standard_wiki_sections) {
+            # drop sections we either replaced or removed from the original wiki's contents.
+            if (not defined $only_wiki_sections{$_}) {
+                delete($$sectionsref{$_});
+            }
+        }
+
+        my $wikisectionorderref = $wikisectionorder{$fn};
+
+        # Make sure there's a footer in the wiki that puts this function in CategoryAPI...
+        if (not $$sectionsref{'[footer]'}) {
+            $$sectionsref{'[footer]'} = '';
+            push @$wikisectionorderref, '[footer]';
+        }
+
+        # !!! FIXME: This won't be CategoryAPI if we eventually handle things other than functions.
+        my $footer = $$sectionsref{'[footer]'};
+        if ($wikitype eq 'mediawiki') {
+            $footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
+            $footer = '[[CategoryAPI]]' . (($footer eq '') ? "\n" : ", $footer");
+        } elsif ($wikitype eq 'md') {
+            $footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g;
+            $footer = '[CategoryAPI](CategoryAPI)' . (($footer eq '') ? '' : ', ') . $footer;
+        } else { die("Unexpected wikitype '$wikitype'\n"); }
+        $$sectionsref{'[footer]'} = $footer;
+
+        my $prevsectstr = '';
+        my @ordered_sections = (@standard_wiki_sections, defined $wikisectionorderref ? @$wikisectionorderref : ());  # this copies the arrays into one.
+        foreach (@ordered_sections) {
+            my $sect = $_;
+            next if $sect eq '[start]';
+            next if (not defined $sections{$sect} and not defined $$sectionsref{$sect});
+            my $section = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect};
+            if ($sect eq '[footer]') {
+                # Make sure previous section ends with two newlines.
+                if (substr($prevsectstr, -1) ne "\n") {
+                    print FH "\n\n";
+                } elsif (substr($prevsectstr, -2) ne "\n\n") {
+                    print FH "\n";
+                }
+                print FH "----\n";   # It's the same in Markdown and MediaWiki.
+            } elsif ($sect eq '[Brief]') {
+                if ($wikitype eq 'mediawiki') {
+                    print FH  "= $fn =\n\n";
+                } elsif ($wikitype eq 'md') {
+                    print FH "# $fn\n\n";
+                } else { die("Unexpected wikitype '$wikitype'\n"); }
+            } else {
+                if ($wikitype eq 'mediawiki') {
+                    print FH  "\n== $sect ==\n\n";
+                } elsif ($wikitype eq 'md') {
+                    print FH "\n## $sect\n\n";
+                } else { die("Unexpected wikitype '$wikitype'\n"); }
+            }
+
+            my $sectstr = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect};
+            print FH $sectstr;
+
+            $prevsectstr = $sectstr;
+
+            # make sure these don't show up twice.
+            delete($sections{$sect});
+            delete($$sectionsref{$sect});
+        }
+
+        print FH "\n\n";
+        close(FH);
+        rename($path, "$wikipath/$_.${wikitype}") or die("Can't rename '$path' to '$wikipath/$_.${wikitype}': $!\n");
+    }
+
+} elsif ($copy_direction == -2) { # --copy-to-manpages
+    # This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
+
+    my $manpath = "$srcpath/man";
+    mkdir($manpath);
+    $manpath .= "/man3";
+    mkdir($manpath);
+
+    $dewikify_mode = 'manpage';
+    $wordwrap_mode = 'manpage';
+
+    my $introtxt = '';
+    if (0) {
+    open(FH, '<', "$srcpath/LICENSE.txt") or die("Can't open '$srcpath/LICENSE.txt': $!\n");
+    while (<FH>) {
+        chomp;
+        $introtxt .= ".\\\" $_\n";
+    }
+    close(FH);
+    }
+
+    my $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`;
+    chomp($gitrev);
+
+    open(FH, '<', "$srcpath/include/SDL_version.h") or die("Can't open '$srcpath/include/SDL_version.h': $!\n");
+    my $majorver = 0;
+    my $minorver = 0;
+    my $patchver = 0;
+    while (<FH>) {
+        chomp;
+        if (/\A\#define SDL_MAJOR_VERSION\s+(\d+)\Z/) {
+            $majorver = int($1);
+        } elsif (/\A\#define SDL_MINOR_VERSION\s+(\d+)\Z/) {
+            $minorver = int($1);
+        } elsif (/\A\#define SDL_PATCHLEVEL\s+(\d+)\Z/) {
+            $patchver = int($1);
+        }
+    }
+    close(FH);
+    my $sdlversion = "$majorver.$minorver.$patchver";
+
+    foreach (keys %headerfuncs) {
+        my $fn = $_;
+        next if not defined $wikifuncs{$fn};  # don't have a page for that function, skip it.
+        my $wikitype = $wikitypes{$fn};
+        my $sectionsref = $wikifuncs{$fn};
+        my $remarks = %$sectionsref{'Remarks'};
+        my $params = %$sectionsref{'Function Parameters'};
+        my $returns = %$sectionsref{'Return Value'};
+        my $version = %$sectionsref{'Version'};
+        my $related = %$sectionsref{'Related Functions'};
+        my $examples = %$sectionsref{'Code Examples'};
+        my $deprecated = %$sectionsref{'Deprecated'};
+        my $brief = %$sectionsref{'[Brief]'};
+        my $decl = $headerdecls{$fn};
+        my $str = '';
+
+        $brief = "$brief";
+        $brief =~ s/\A[\s\n]*\= .*? \=\s*?\n+//ms;
+        $brief =~ s/\A[\s\n]*\=\= .*? \=\=\s*?\n+//ms;
+        $brief =~ s/\A(.*?\.) /$1\n/;  # \brief should only be one sentence, delimited by a period+space. Split if necessary.
+        my @briefsplit = split /\n/, $brief;
+        $brief = shift @briefsplit;
+        $brief = dewikify($wikitype, $brief);
+
+        if (defined $remarks) {
+            $remarks = dewikify($wikitype, join("\n", @briefsplit) . $remarks);
+        }
+
+        $str .= $introtxt;
+
+        $str .= ".\\\" This manpage content is licensed under Creative Commons\n";
+        $str .= ".\\\"  Attribution 4.0 International (CC BY 4.0)\n";
+        $str .= ".\\\"   https://creativecommons.org/licenses/by/4.0/\n";
+        $str .= ".\\\" This manpage was generated from SDL's wiki page for $fn:\n";
+        $str .= ".\\\"   https://wiki.libsdl.org/$fn\n";
+        $str .= ".\\\" Generated with SDL/build-scripts/wikiheaders.pl\n";
+        $str .= ".\\\"  revision $gitrev\n" if $gitrev ne '';
+        $str .= ".\\\" Please report issues in this manpage's content at:\n";
+        $str .= ".\\\"   https://github.com/libsdl-org/sdlwiki/issues/new?title=Feedback%20on%20page%20$fn\n";
+        $str .= ".\\\" Please report issues in the generation of this manpage from the wiki at:\n";
+        $str .= ".\\\"   https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$fn\n";
+        $str .= ".\\\" SDL can be found at https://libsdl.org/\n";
+
+        $str .= ".TH $fn 3 \"SDL $sdlversion\" \"Simple Directmedia Layer\" \"SDL$majorver FUNCTIONS\"\n";
+        $str .= ".SH NAME\n";
+
+        $str .= "$fn";
+        $str .= " \\- $brief" if (defined $brief);
+        $str .= "\n";
+
+        $str .= ".SH SYNOPSIS\n";
+        $str .= ".nf\n";
+        $str .= ".B #include \\(dqSDL.h\\(dq\n";
+        $str .= ".PP\n";
+
+        my @decllines = split /\n/, $decl;
+        foreach (@decllines) {
+            $str .= ".BI \"$_\n";
+        }
+        $str .= ".fi\n";
+
+        if (defined $remarks) {
+            $str .= ".SH DESCRIPTION\n";
+            $str .= $remarks . "\n";
+        }
+
+        if (defined $deprecated) {
+            $str .= ".SH DEPRECATED\n";
+            $str .= dewikify($wikitype, $deprecated) . "\n";
+        }
+
+        if (defined $params) {
+            $str .= ".SH FUNCTION PARAMETERS\n";
+            my @lines = split /\n/, $params;
+            if ($wikitype eq 'mediawiki') {
+                die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|');  # Dump the '{|' start
+                while (scalar(@lines) >= 3) {
+                    my $name = shift @lines;
+                    my $desc = shift @lines;
+                    my $terminator = shift @lines;  # the '|-' or '|}' line.
+                    last if ($terminator ne '|-') and ($terminator ne '|}');  # we seem to have run out of table.
+                    $name =~ s/\A\|\s*//;
+                    $name =~ s/\A\*\*(.*?)\*\*/$1/;
+                    $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
+                    $desc =~ s/\A\|\s*//;
+                    $desc = dewikify($wikitype, $desc);
+                    #print STDERR "FN: $fn   NAME: $name   DESC: $desc TERM: $terminator\n";
+
+                    $str .= ".TP\n";
+                    $str .= ".I $name\n";
+                    $str .= "$desc\n";
+                }
+            } else {
+                die("write me");
+            }
+        }
+
+        if (defined $returns) {
+            $str .= ".SH RETURN VALUE\n";
+            $str .= dewikify($wikitype, $returns) . "\n";
+        }
+
+        if (defined $examples) {
+            $str .= ".SH CODE EXAMPLES\n";
+            $dewikify_manpage_code_indent = 0;
+            $str .= dewikify($wikitype, $examples) . "\n";
+            $dewikify_manpage_code_indent = 1;
+        }
+
+        if (defined $version) {
+            $str .= ".SH AVAILABILITY\n";
+            $str .= dewikify($wikitype, $version) . "\n";
+        }
+
+        if (defined $related) {
+            $str .= ".SH SEE ALSO\n";
+            # !!! FIXME: lots of code duplication in all of these.
+            my $v = dewikify($wikitype, $related);
+            my @desclines = split /\n/, $v;
+            my $nextstr = '';
+            foreach (@desclines) {
+                s/\A(\:|\* )//;
+                s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
+                s/\A\.BR\s+//;  # dewikify added this, but we want to handle it.
+                s/\A\s+//;
+                s/\s+\Z//;
+                next if $_ eq '';
+                $str .= "$nextstr.BR $_ (3)";
+                $nextstr = ",\n";
+            }
+            $str .= "\n";
+        }
+
+        if (0) {
+        $str .= ".SH COPYRIGHT\n";
+        $str .= "This manpage is licensed under\n";
+        $str .= ".UR https://creativecommons.org/licenses/by/4.0/\n";
+        $str .= "Creative Commons Attribution 4.0 International (CC BY 4.0)\n";
+        $str .= ".UE\n";
+        $str .= ".PP\n";
+        $str .= "This manpage was generated from\n";
+        $str .= ".UR https://wiki.libsdl.org/$fn\n";
+        $str .= "SDL's wiki\n";
+        $str .= ".UE\n";
+        $str .= "using SDL/build-scripts/wikiheaders.pl";
+        $str .= " revision $gitrev" if $gitrev ne '';
+        $str .= ".\n";
+        $str .= "Please report issues in this manpage at\n";
+        $str .= ".UR https://github.com/libsdl-org/sdlwiki/issues/new\n";
+        $str .= "our bugtracker!\n";
+        $str .= ".UE\n";
+        }
+
+        my $path = "$manpath/$_.3.tmp";
+        open(FH, '>', $path) or die("Can't open '$path': $!\n");
+        print FH $str;
+        close(FH);
+        rename($path, "$manpath/$_.3") or die("Can't rename '$path' to '$manpath/$_.3': $!\n");
+    }
+}
+
+# end of wikiheaders.pl ...
+

+ 1 - 1
Engine/lib/sdl/build-scripts/winrtbuild.ps1

@@ -39,7 +39,7 @@
 #
 #
 
 
 # Base version of SDL, used for packaging purposes
 # Base version of SDL, used for packaging purposes
-$SDLVersion = "2.0.14"
+$SDLVersion = "2.0.21"
 
 
 # Gets the .bat file that sets up an MSBuild environment, given one of
 # Gets the .bat file that sets up an MSBuild environment, given one of
 # Visual Studio's, "PlatformToolset"s.
 # Visual Studio's, "PlatformToolset"s.

+ 53 - 13
Engine/lib/sdl/cmake/macros.cmake

@@ -1,5 +1,13 @@
+macro(ADD_TO_ALLOPTIONS _NEWNAME)
+  list(APPEND ALLOPTIONS ${_NEWNAME})
+  string(LENGTH ${_NEWNAME} _SLEN)
+  if(${LONGESTOPTIONNAME} LESS ${_SLEN})
+    set(LONGESTOPTIONNAME ${_SLEN})
+  endif()
+endmacro()
+
 macro(SET_OPTION _NAME _DESC)
 macro(SET_OPTION _NAME _DESC)
-  list(APPEND ALLOPTIONS ${_NAME})
+  add_to_alloptions(${_NAME})
   if(${ARGC} EQUAL 3)
   if(${ARGC} EQUAL 3)
     set(_DEFLT ${ARGV2})
     set(_DEFLT ${ARGV2})
   else()
   else()
@@ -9,12 +17,12 @@ macro(SET_OPTION _NAME _DESC)
 endmacro()
 endmacro()
 
 
 macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT)
 macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT)
-  list(APPEND ALLOPTIONS ${_NAME})
+  add_to_alloptions(${_NAME})
   cmake_dependent_option(${_NAME} ${_DESC} ${_DEFLT} ${_DEPTEST} ${_FAILDFLT})
   cmake_dependent_option(${_NAME} ${_DESC} ${_DEFLT} ${_DEPTEST} ${_FAILDFLT})
 endmacro()
 endmacro()
 
 
 macro(OPTION_STRING _NAME _DESC _VALUE)
 macro(OPTION_STRING _NAME _DESC _VALUE)
-  list(APPEND ALLOPTIONS ${_NAME})
+  add_to_alloptions(${_NAME})
   set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}")
   set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}")
   set(HAVE_${_NAME} ${_VALUE})
   set(HAVE_${_NAME} ${_VALUE})
 ENDMACRO()
 ENDMACRO()
@@ -42,12 +50,18 @@ macro(MESSAGE_TESTED_OPTION _NAME)
   if(${ARGC} EQUAL 2)
   if(${ARGC} EQUAL 2)
     set(_PAD ${ARGV1})
     set(_PAD ${ARGV1})
   endif()
   endif()
-  if(NOT HAVE_${_NAME})
-    set(HAVE_${_NAME} OFF)
-  elseif("${HAVE_${_NAME}}" MATCHES "1|TRUE|YES|Y")
-    set(HAVE_${_NAME} ON)
+  string(SUBSTRING "${_NAME}" 0 4 _NAMESTART)
+  if(_NAMESTART STREQUAL "SDL_")
+    string(SUBSTRING "${_NAME}" 4 -1 _STRIPPEDNAME)
+  else()
+    set(_STRIPPEDNAME "${_NAME}")
+  endif()
+  if(NOT HAVE_${_STRIPPEDNAME})
+    set(HAVE_${_STRIPPEDNAME} OFF)
+  elseif("${HAVE_${_STRIPPEDNAME}}" MATCHES "1|TRUE|YES|Y")
+    set(HAVE_${_STRIPPEDNAME} ON)
   endif()
   endif()
-  message(STATUS "  ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_NAME}}")
+  message(STATUS "  ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
 endmacro()
 endmacro()
 
 
 macro(LISTTOSTR _LIST _OUTPUT)
 macro(LISTTOSTR _LIST _OUTPUT)
@@ -64,10 +78,36 @@ macro(LISTTOSTR _LIST _OUTPUT)
   endforeach()
   endforeach()
 endmacro()
 endmacro()
 
 
-macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
-  set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
-  CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
-  set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
+macro(LISTTOSTRREV _LIST _OUTPUT)
+  if(${ARGC} EQUAL 3)
+    # prefix for each element
+    set(_LPREFIX ${ARGV2})
+  else()
+    set(_LPREFIX "")
+  endif()
+  # Do not use string(REPLACE ";" " ") here to avoid messing up list
+  # entries
+  foreach(_ITEM ${${_LIST}})
+    set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}")
+  endforeach()
 endmacro()
 endmacro()
 
 
+if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
+  macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
+    set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
+    set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
+    CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
+    set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
+  endmacro()
+else()
+  include(CheckOBJCSourceCompiles)
+  if (APPLE)
+      enable_language(OBJC)
+  endif()
+endif()
+
+if(CMAKE_VERSION VERSION_LESS 3.13.0)
+  macro(target_link_directories _TARGET _SCOPE)
+    link_directories(${ARGN})
+  endmacro()
+endif()

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 255
Engine/lib/sdl/cmake/sdlchecks.cmake


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 269 - 214
Engine/lib/sdl/configure


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 213 - 178
Engine/lib/sdl/configure.ac


+ 0 - 150
Engine/lib/sdl/debian/changelog

@@ -1,150 +0,0 @@
-libsdl2 (2.0.14) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.14
-
- -- Sam Lantinga <[email protected]>  Tue, 8 Dec 2020 17:54:33 -0800
-
-libsdl2 (2.0.13) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.13 for development builds
-
- -- Sam Lantinga <[email protected]>  Tue, 10 Mar 2020 18:24:22 -0800
-
-libsdl2 (2.0.12) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.12
-
- -- Sam Lantinga <[email protected]>  Sun, 1 Mar 2020 14:57:07 -0800
-
-libsdl2 (2.0.11) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.11 for development builds
-
- -- Sam Lantinga <[email protected]>  Sun, 22 Sep 2019 10:33:03 -0800
-
-libsdl2 (2.0.10) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.10
-
- -- Sam Lantinga <[email protected]>  Mon, 17 Jun 2019 08:48:47 -0800
-
-libsdl2 (2.0.9) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.9
-
- -- Sam Lantinga <[email protected]>  Wed, 26 Sep 2018 10:02:21 -0800
-
-libsdl2 (2.0.8) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.8
-
- -- Sam Lantinga <[email protected]>  Sat, 4 Nov 2017 21:21:53 -0800
-
-libsdl2 (2.0.7) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.7
-
- -- Sam Lantinga <[email protected]>  Thu, 12 Oct 2017 08:01:16 -0800
-
-libsdl2 (2.0.6) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.6
-
- -- Sam Lantinga <[email protected]>  Sat, 9 Sep 2017 07:29:36 -0800
-
-libsdl2 (2.0.5) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.5
-
- -- Sam Lantinga <[email protected]>  Mon, 28 Nov 2016 07:32:52 -0800
-
-libsdl2 (2.0.4) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.4
-
- -- Sam Lantinga <[email protected]>  Thu, 07 Jan 2016 11:02:39 -0800
-
-libsdl2 (2.0.3) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.3
-
- -- Sam Lantinga <[email protected]>  Sun, 9 Mar 2014 10:35:54 -0800
-
-libsdl2 (2.0.2) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.2
-
- -- Sam Lantinga <[email protected]>  Sun, 9 Feb 2014 2:55:59 -0800
-
-libsdl2 (2.0.1) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.1
-
- -- Sam Lantinga <[email protected]>  Wed, 23 Oct 2013 16:31:38 -0800
-
-libsdl2 (2.0.0) UNRELEASED; urgency=low
-
-  * SDL is now a native debian package.
-  * Removed udeb package
-  * Disabled DirectFB support by default, to avoid runtime dependencies
-
- -- Sam Lantinga <[email protected]>  Fri, 15 Feb 2013 08:55:04 -0800
-
-libsdl2 (2.0.0~20130127-1) UNRELEASED; urgency=low
-
-  * New upstream snapshot.
-
- -- Sam Hocevar <[email protected]>  Wed, 30 Jan 2013 23:01:12 +0100
-
-libsdl2 (2.0.0~20130103-1) unstable; urgency=low
-
-  [ Manuel A. Fernandez Montecelo ]
-  * debian/control:
-    - Updating maintainers/permissions:
-      - Add myself and Felix Geyer
-    - Update Build-Depends:
-      - Remove a few obsolete items
-      - Add items added lately to libsdl1.2, such as libts (touch screen)
-        support
-    - Add "libsdl2-dbg", analog to libsdl1.2-dbg
-    - Change "XC-Package-Type: udeb" to "Package-Type"
-  * debian/compat: set level 9
-  * debian/source/format: Set to "3.0 (quilt)"
-    - Remove README.source, not needed with new format
-  * debian/sdl2-config.1: Fix typo, "progams"->"programs"
-  * debian/libsdl2-dev.install:
-    - Remove "usr/lib/*/*.la", discouraged
-    - Add man pages: "usr/share/man/man3/*"
-  * debian/libsdl2-dev.manpages: add file to install local "sdl2-config.1"
-  * debian/sources: Removed, possible obsolete file from long ago?
-  * debian/copyright:
-    - Upstream updated to zlib/libpng
-    - Copyright-file format conversion to 1.0
-    - Complete revamp and detailed research about copyright and licenses used,
-      it's very messy but hopefully complete
-
-  [ Felix Geyer ]
-  * Simplify debian/rules by using dh(1).
-
- -- Manuel A. Fernandez Montecelo <[email protected]>  Sun, 27 Jan 2013 16:40:49 +0100
-
-libsdl2 (2.0~20120220c-1) experimental; urgency=low
-
-  * Upstream version was renamed to 2.0 (Closes: #669367).
-  * New upstream snapshot (Closes: #671506).
-  * This package no longer conflicts with libsdl-1.2.
-  * debian/rules: add multiarch support (Closes: #669364).
-
-  * debian/patches/fix_joystick_misc_axes.diff: fix a joystick remapping
-    bug causing some axes to malfunction.
-  * debian/patches/external_header_paths.diff: provide additional CFLAGS
-    so that headers such as SDL_syswm.h can be included (Closes: #669363).
-
- -- Sam Hocevar <[email protected]>  Thu, 17 May 2012 19:03:59 +0200
-
-libsdl-1.3 (1.3.0~20111204-1) experimental; urgency=low
-
-  * Initial upload from upstream snapshot.
-
- -- Sam Hocevar <[email protected]>  Sun, 04 Dec 2011 14:35:05 +0100
-

+ 0 - 1
Engine/lib/sdl/debian/compat

@@ -1 +0,0 @@
-9

+ 0 - 76
Engine/lib/sdl/debian/control

@@ -1,76 +0,0 @@
-Source: libsdl2
-Priority: optional
-Section: libs
-Maintainer: Debian SDL packages maintainers <[email protected]>
-Uploaders: Barry deFreese <[email protected]>,
-           Sam Hocevar <[email protected]>,
-           Manuel A. Fernandez Montecelo <[email protected]>,
-           Felix Geyer <[email protected]>,
-           Sam Lantinga <[email protected]>
-Standards-Version: 3.9.3
-Build-Depends: debhelper (>= 9),
-               dh-autoreconf,
-               dpkg-dev (>= 1.16.1~),
-               fcitx-libs-dev [linux-any],
-               libasound2-dev [linux-any],
-               libgl1-mesa-dev,
-               libpulse-dev,
-               libudev-dev [linux-any],
-               libdbus-1-dev [linux-any],
-               libibus-1.0-dev[linux-any],
-               libusb2-dev [kfreebsd-any],
-               libusbhid-dev [kfreebsd-any],
-               libx11-dev,
-               libxcursor-dev,
-               libxext-dev,
-               libxi-dev,
-               libxinerama-dev,
-               libxrandr-dev,
-               libxss-dev,
-               libxxf86vm-dev
-Homepage: http://www.libsdl.org/
-
-Package: libsdl2
-Architecture: any
-Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends}
-Depends: ${misc:Depends},
-         ${shlibs:Depends},
-         libudev0 [linux-any],
-         libdbus-1-3 [linux-any]
-Conflicts: libsdl-1.3-0
-Replaces: libsdl-1.3-0
-Description: Simple DirectMedia Layer
- SDL is a library that allows programs portable low level access to
- a video framebuffer, audio output, mouse, and keyboard.
- .
- This package contains the shared library, compiled with X11 graphics drivers and OSS, ALSA and PulseAudio sound drivers.
-
-Package: libsdl2-dev
-Section: libdevel
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
-         libsdl2 (= ${binary:Version}),
-         libc6-dev,
-         libgl1-mesa-dev
-Conflicts: libsdl-1.3-dev
-Replaces: libsdl-1.3-dev
-Description: Simple DirectMedia Layer development files
- SDL is a library that allows programs portable low level access to a video
- framebuffer, audio output, mouse, and keyboard.
- .
- This package contains files needed if you wish to use the SDL library in your own programs.
-
-Package: libsdl2-dbg
-Priority: extra
-Section: debug
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
-         libsdl2 (= ${binary:Version}),
-Description: Simple DirectMedia Layer debug files
- SDL is a library that allows programs portable low level access to a video
- framebuffer, audio output, mouse, and keyboard.
- .
- This package contains the debug symbols for the SDL library.

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio