sdl2: update patches

This commit is contained in:
Leonid Pliushch 2019-08-20 21:06:34 +03:00 committed by Yaksh Bariya
parent aac60b38ba
commit 635c59e0af
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
21 changed files with 1080 additions and 708 deletions

View File

@ -1,12 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_config.h SDL2-2.0.9.mod/include/SDL_config.h
--- SDL2-2.0.9/include/SDL_config.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_config.h 2018-11-09 16:54:07.244857005 +0200
@@ -37,8 +37,6 @@
#include "SDL_config_macosx.h"
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
-#elif defined(__ANDROID__)
-#include "SDL_config_android.h"
#elif defined(__PSP__)
#include "SDL_config_psp.h"
#elif defined(__OS2__)

View File

@ -1,28 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_egl.h SDL2-2.0.9.mod/include/SDL_egl.h
--- SDL2-2.0.9/include/SDL_egl.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_egl.h 2018-11-09 16:54:15.701628001 +0200
@@ -24,7 +24,7 @@
*
* This is a simple file to encapsulate the EGL API headers.
*/
-#if !defined(_MSC_VER) && !defined(__ANDROID__)
+#if !defined(_MSC_VER)
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -421,15 +421,6 @@
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
-#elif defined(__ANDROID__) /* Android */
-
-struct ANativeWindow;
-struct egl_native_pixmap_t;
-
-typedef struct ANativeWindow *EGLNativeWindowType;
-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
-typedef void *EGLNativeDisplayType;
-
#elif defined(MIR_EGL_PLATFORM)
#include <mir_toolkit/mir_client_library.h>

View File

@ -1,21 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_main.h SDL2-2.0.9.mod/include/SDL_main.h
--- SDL2-2.0.9/include/SDL_main.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_main.h 2018-11-09 16:54:23.835061530 +0200
@@ -59,17 +59,6 @@
*/
#define SDL_MAIN_NEEDED
-#elif defined(__ANDROID__)
-/* On Android SDL provides a Java class in SDLActivity.java that is the
- main activity entry point.
-
- See docs/README-android.md for more details on extending that class.
- */
-#define SDL_MAIN_NEEDED
-
-/* We need to export SDL_main so it can be launched from Java */
-#define SDLMAIN_DECLSPEC DECLSPEC
-
#elif defined(__NACL__)
/* On NACL we use ppapi_simple to set up the application helper code,
then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before

View File

@ -1,15 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_platform.h SDL2-2.0.9.mod/include/SDL_platform.h
--- SDL2-2.0.9/include/SDL_platform.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_platform.h 2018-11-09 16:54:32.445167443 +0200
@@ -60,11 +60,6 @@
#undef __LINUX__
#define __LINUX__ 1
#endif
-#if defined(ANDROID) || defined(__ANDROID__)
-#undef __ANDROID__
-#undef __LINUX__ /* do we need to do this? */
-#define __ANDROID__ 1
-#endif
#if defined(__APPLE__)
/* lets us know what version of Mac OS X we're compiling on */

View File

@ -1,25 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_rwops.h SDL2-2.0.9.mod/include/SDL_rwops.h
--- SDL2-2.0.9/include/SDL_rwops.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_rwops.h 2018-11-09 16:54:40.285263749 +0200
@@ -93,20 +93,7 @@
Uint32 type;
union
{
-#if defined(__ANDROID__)
- struct
- {
- void *fileNameRef;
- void *inputStreamRef;
- void *readableByteChannelRef;
- void *readMethod;
- void *assetFileDescriptorRef;
- long position;
- long size;
- long offset;
- int fd;
- } androidio;
-#elif defined(__WIN32__)
+#if defined(__WIN32__)
struct
{
SDL_bool append;

View File

@ -1,19 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_stdinc.h SDL2-2.0.9.mod/include/SDL_stdinc.h
--- SDL2-2.0.9/include/SDL_stdinc.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_stdinc.h 2018-11-09 16:54:52.125408951 +0200
@@ -332,7 +332,6 @@
/** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#if !defined(__ANDROID__)
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
typedef enum
{
@@ -340,7 +339,6 @@
} SDL_DUMMY_ENUM;
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
-#endif
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */

View File

@ -1,85 +0,0 @@
diff -uNr SDL2-2.0.9/include/SDL_system.h SDL2-2.0.9.mod/include/SDL_system.h
--- SDL2-2.0.9/include/SDL_system.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/include/SDL_system.h 2018-11-09 16:59:30.138749528 +0200
@@ -99,81 +99,6 @@
#endif /* __IPHONEOS__ */
-
-/* Platform specific functions for Android */
-#if defined(__ANDROID__) && __ANDROID__
-
-/**
- \brief Get the JNI environment for the current thread
-
- This returns JNIEnv*, but the prototype is void* so we don't need jni.h
- */
-extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
-
-/**
- \brief Get the SDL Activity object for the application
-
- This returns jobject, but the prototype is void* so we don't need jni.h
- The jobject returned by SDL_AndroidGetActivity is a local reference.
- It is the caller's responsibility to properly release it
- (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
- */
-extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
-
-/**
- \brief Return true if the application is running on Android TV
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
-
-/**
- \brief Return true if the application is running on a Chromebook
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
-
-/**
- \brief Return true is the application is running on a Samsung DeX docking station
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
-
-/**
- \brief Trigger the Android system back button behavior.
- */
-extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
-
-/**
- See the official Android developer guide for more information:
- http://developer.android.com/guide/topics/data/data-storage.html
-*/
-#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
-#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
-
-/**
- \brief Get the path used for internal storage for this application.
-
- This path is unique to your application and cannot be written to
- by other applications.
- */
-extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
-
-/**
- \brief Get the current state of external storage, a bitmask of these values:
- SDL_ANDROID_EXTERNAL_STORAGE_READ
- SDL_ANDROID_EXTERNAL_STORAGE_WRITE
-
- If external storage is currently unavailable, this will return 0.
-*/
-extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
-
-/**
- \brief Get the path used for external storage for this application.
-
- This path is unique to your application, but is public and can be
- written to by other applications.
- */
-extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
-
-#endif /* __ANDROID__ */
-
/* Platform specific functions for WinRT */
#if defined(__WINRT__) && __WINRT__

View File

@ -1,24 +0,0 @@
diff -uNr SDL2-2.0.9/src/SDL.c SDL2-2.0.9.mod/src/SDL.c
--- SDL2-2.0.9/src/SDL.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/SDL.c 2018-11-09 17:09:44.315855024 +0200
@@ -420,8 +420,6 @@
{
#if __AIX__
return "AIX";
-#elif __ANDROID__
- return "Android";
#elif __BSDI__
return "BSDI";
#elif __DREAMCAST__
@@ -478,10 +476,7 @@
SDL_bool
SDL_IsTablet()
{
-#if __ANDROID__
- extern SDL_bool SDL_IsAndroidTablet(void);
- return SDL_IsAndroidTablet();
-#elif __IPHONEOS__
+#if __IPHONEOS__
extern SDL_bool SDL_IsIPad(void);
return SDL_IsIPad();
#else

View File

@ -1,75 +0,0 @@
diff -uNr SDL2-2.0.9/src/SDL_log.c SDL2-2.0.9.mod/src/SDL_log.c
--- SDL2-2.0.9/src/SDL_log.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/SDL_log.c 2018-11-09 16:57:23.150571689 +0200
@@ -33,9 +33,6 @@
#include <stdio.h>
#endif
-#if defined(__ANDROID__)
-#include <android/log.h>
-#endif
#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_CRITICAL
#define DEFAULT_ASSERT_PRIORITY SDL_LOG_PRIORITY_WARN
@@ -70,27 +67,6 @@
"CRITICAL"
};
-#ifdef __ANDROID__
-static const char *SDL_category_prefixes[SDL_LOG_CATEGORY_RESERVED1] = {
- "APP",
- "ERROR",
- "SYSTEM",
- "AUDIO",
- "VIDEO",
- "RENDER",
- "INPUT"
-};
-
-static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
- ANDROID_LOG_UNKNOWN,
- ANDROID_LOG_VERBOSE,
- ANDROID_LOG_DEBUG,
- ANDROID_LOG_INFO,
- ANDROID_LOG_WARN,
- ANDROID_LOG_ERROR,
- ANDROID_LOG_FATAL
-};
-#endif /* __ANDROID__ */
void
@@ -247,19 +223,6 @@
va_end(ap);
}
-#ifdef __ANDROID__
-static const char *
-GetCategoryPrefix(int category)
-{
- if (category < SDL_LOG_CATEGORY_RESERVED1) {
- return SDL_category_prefixes[category];
- }
- if (category < SDL_LOG_CATEGORY_CUSTOM) {
- return "RESERVED";
- }
- return "CUSTOM";
-}
-#endif /* __ANDROID__ */
void
SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap)
@@ -391,13 +354,6 @@
SDL_free(tstr);
SDL_stack_free(output);
}
-#elif defined(__ANDROID__)
- {
- char tag[32];
-
- SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
- __android_log_write(SDL_android_priority[priority], tag, message);
- }
#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)
/* Technically we don't need SDL_VIDEO_DRIVER_COCOA, but that's where this function is defined for now.
*/

View File

@ -1,13 +0,0 @@
diff -uNr SDL2-2.0.9/src/atomic/SDL_atomic.c SDL2-2.0.9.mod/src/atomic/SDL_atomic.c
--- SDL2-2.0.9/src/atomic/SDL_atomic.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/atomic/SDL_atomic.c 2018-11-09 16:55:24.719140558 +0200
@@ -41,9 +41,7 @@
# if __has_builtin(__atomic_load_n)
/* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
It might be in a later NDK or we might need an extra library? --ryan. */
-# if !defined(__ANDROID__)
# define HAVE_ATOMIC_LOAD_N 1
-# endif
# endif
# elif defined(__GNUC__)
# if (__GNUC__ >= 5)

View File

@ -1,39 +0,0 @@
diff -uNr SDL2-2.0.9/src/dynapi/SDL_dynapi_procs.h SDL2-2.0.9.mod/src/dynapi/SDL_dynapi_procs.h
--- SDL2-2.0.9/src/dynapi/SDL_dynapi_procs.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/dynapi/SDL_dynapi_procs.h 2018-11-09 17:09:11.612148648 +0200
@@ -74,13 +74,6 @@
SDL_DYNAPI_PROC(void,SDL_iPhoneSetEventPump,(SDL_bool a),(a),)
#endif
-#ifdef __ANDROID__
-SDL_DYNAPI_PROC(void*,SDL_AndroidGetJNIEnv,(void),(),return)
-SDL_DYNAPI_PROC(void*,SDL_AndroidGetActivity,(void),(),return)
-SDL_DYNAPI_PROC(const char*,SDL_AndroidGetInternalStoragePath,(void),(),return)
-SDL_DYNAPI_PROC(int,SDL_AndroidGetExternalStorageState,(void),(),return)
-SDL_DYNAPI_PROC(const char*,SDL_AndroidGetExternalStoragePath,(void),(),return)
-#endif
SDL_DYNAPI_PROC(int,SDL_Init,(Uint32 a),(a),return)
SDL_DYNAPI_PROC(int,SDL_InitSubSystem,(Uint32 a),(a),return)
@@ -702,9 +695,6 @@
#ifdef __WINRT__
SDL_DYNAPI_PROC(SDL_WinRT_DeviceFamily,SDL_WinRTGetDeviceFamily,(void),(),return)
#endif
-#ifdef __ANDROID__
-SDL_DYNAPI_PROC(SDL_bool,SDL_IsAndroidTV,(void),(),return)
-#endif
SDL_DYNAPI_PROC(double,SDL_log10,(double a),(a),return)
SDL_DYNAPI_PROC(float,SDL_log10f,(float a),(a),return)
SDL_DYNAPI_PROC(char*,SDL_GameControllerMappingForDeviceIndex,(int a),(a),return)
@@ -712,11 +702,6 @@
SDL_DYNAPI_PROC(int,SDL_LinuxSetThreadPriority,(Sint64 a, int b),(a,b),return)
#endif
SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX512F,(void),(),return)
-#ifdef __ANDROID__
-SDL_DYNAPI_PROC(SDL_bool,SDL_IsChromebook,(void),(),return)
-SDL_DYNAPI_PROC(SDL_bool,SDL_IsDeXMode,(void),(),return)
-SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),return)
-#endif
SDL_DYNAPI_PROC(double,SDL_exp,(double a),(a),return)
SDL_DYNAPI_PROC(float,SDL_expf,(float a),(a),return)
SDL_DYNAPI_PROC(wchar_t*,SDL_wcsdup,(const wchar_t *a),(a),return)

View File

@ -1,64 +0,0 @@
diff -uNr SDL2-2.0.9/src/file/SDL_rwops.c SDL2-2.0.9.mod/src/file/SDL_rwops.c
--- SDL2-2.0.9/src/file/SDL_rwops.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/file/SDL_rwops.c 2018-11-09 16:56:08.653007577 +0200
@@ -51,10 +51,6 @@
#include "cocoa/SDL_rwopsbundlesupport.h"
#endif /* __APPLE__ */
-#ifdef __ANDROID__
-#include "../core/android/SDL_android.h"
-#include "SDL_system.h"
-#endif
#if __NACL__
#include "nacl_io/nacl_io.h"
@@ -515,48 +511,7 @@
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
return NULL;
}
-#if defined(__ANDROID__)
-#ifdef HAVE_STDIO_H
- /* Try to open the file on the filesystem first */
- if (*file == '/') {
- FILE *fp = fopen(file, mode);
- if (fp) {
- return SDL_RWFromFP(fp, 1);
- }
- } else {
- /* Try opening it from internal storage if it's a relative path */
- char *path;
- FILE *fp;
-
- path = SDL_stack_alloc(char, PATH_MAX);
- if (path) {
- SDL_snprintf(path, PATH_MAX, "%s/%s",
- SDL_AndroidGetInternalStoragePath(), file);
- fp = fopen(path, mode);
- SDL_stack_free(path);
- if (fp) {
- return SDL_RWFromFP(fp, 1);
- }
- }
- }
-#endif /* HAVE_STDIO_H */
-
- /* Try to open the file from the asset system */
- rwops = SDL_AllocRW();
- if (!rwops)
- return NULL; /* SDL_SetError already setup by SDL_AllocRW() */
- if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
- SDL_FreeRW(rwops);
- return NULL;
- }
- rwops->size = Android_JNI_FileSize;
- rwops->seek = Android_JNI_FileSeek;
- rwops->read = Android_JNI_FileRead;
- rwops->write = Android_JNI_FileWrite;
- rwops->close = Android_JNI_FileClose;
- rwops->type = SDL_RWOPS_JNIFILE;
-
-#elif defined(__WIN32__)
+#if defined(__WIN32__)
rwops = SDL_AllocRW();
if (!rwops)
return NULL; /* SDL_SetError already setup by SDL_AllocRW() */

View File

@ -1,155 +0,0 @@
diff -uNr SDL2-2.0.9/src/joystick/SDL_gamecontroller.c SDL2-2.0.9.mod/src/joystick/SDL_gamecontroller.c
--- SDL2-2.0.9/src/joystick/SDL_gamecontroller.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/joystick/SDL_gamecontroller.c 2018-11-09 17:03:00.684548640 +0200
@@ -34,10 +34,6 @@
#include "../events/SDL_events_c.h"
#endif
-#if defined(__ANDROID__)
-#include "SDL_system.h"
-#endif
-
/* Many controllers turn the center button into an instantaneous button press */
#define SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS 250
@@ -887,119 +883,6 @@
return pControllerMapping;
}
-#ifdef __ANDROID__
-/*
- * Helper function to guess at a mapping based on the elements reported for this controller
- */
-static ControllerMapping_t *SDL_CreateMappingForAndroidController(const char *name, SDL_JoystickGUID guid)
-{
- SDL_bool existing;
- char name_string[128];
- char mapping_string[1024];
- int button_mask;
- int axis_mask;
-
- button_mask = SDL_SwapLE16(*(Uint16*)(&guid.data[sizeof(guid.data)-4]));
- axis_mask = SDL_SwapLE16(*(Uint16*)(&guid.data[sizeof(guid.data)-2]));
- if (!button_mask && !axis_mask) {
- /* Accelerometer, shouldn't have a game controller mapping */
- return NULL;
- }
-
- /* Remove any commas in the name */
- SDL_strlcpy(name_string, name, sizeof(name_string));
- {
- char *spot;
- for (spot = name_string; *spot; ++spot) {
- if (*spot == ',') {
- *spot = ' ';
- }
- }
- }
- SDL_snprintf(mapping_string, sizeof(mapping_string), "none,%s,", name_string);
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_A)) {
- SDL_strlcat(mapping_string, "a:b0,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_B)) {
- SDL_strlcat(mapping_string, "b:b1,", sizeof(mapping_string));
- } else if (button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) {
- /* Use the back button as "B" for easy UI navigation with TV remotes */
- SDL_strlcat(mapping_string, "b:b4,", sizeof(mapping_string));
- button_mask &= ~(1 << SDL_CONTROLLER_BUTTON_BACK);
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_X)) {
- SDL_strlcat(mapping_string, "x:b2,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_Y)) {
- SDL_strlcat(mapping_string, "y:b3,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) {
- SDL_strlcat(mapping_string, "back:b4,", sizeof(mapping_string));
- }
-#if 0 /* The guide button generally isn't functional (or acts as a home button) on most Android controllers */
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_GUIDE)) {
- SDL_strlcat(mapping_string, "guide:b5,", sizeof(mapping_string));
-#if 0 /* Actually this will be done in Steam */
- } else if (button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) {
- /* The guide button doesn't exist, use the start button instead,
- so you can do Steam guide button chords and open the Steam overlay.
- */
- SDL_strlcat(mapping_string, "guide:b6,", sizeof(mapping_string));
- button_mask &= ~(1 << SDL_CONTROLLER_BUTTON_START);
-#endif
- }
-#endif
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) {
- SDL_strlcat(mapping_string, "start:b6,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_LEFTSTICK)) {
- SDL_strlcat(mapping_string, "leftstick:b7,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_RIGHTSTICK)) {
- SDL_strlcat(mapping_string, "rightstick:b8,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_LEFTSHOULDER)) {
- SDL_strlcat(mapping_string, "leftshoulder:b9,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)) {
- SDL_strlcat(mapping_string, "rightshoulder:b10,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_DPAD_UP)) {
- SDL_strlcat(mapping_string, "dpup:b11,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_DPAD_DOWN)) {
- SDL_strlcat(mapping_string, "dpdown:b12,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_DPAD_LEFT)) {
- SDL_strlcat(mapping_string, "dpleft:b13,", sizeof(mapping_string));
- }
- if (button_mask & (1 << SDL_CONTROLLER_BUTTON_DPAD_RIGHT)) {
- SDL_strlcat(mapping_string, "dpright:b14,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_LEFTX)) {
- SDL_strlcat(mapping_string, "leftx:a0,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_LEFTY)) {
- SDL_strlcat(mapping_string, "lefty:a1,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_RIGHTX)) {
- SDL_strlcat(mapping_string, "rightx:a2,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_RIGHTY)) {
- SDL_strlcat(mapping_string, "righty:a3,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_TRIGGERLEFT)) {
- SDL_strlcat(mapping_string, "lefttrigger:a4,", sizeof(mapping_string));
- }
- if (axis_mask & (1 << SDL_CONTROLLER_AXIS_TRIGGERRIGHT)) {
- SDL_strlcat(mapping_string, "righttrigger:a5,", sizeof(mapping_string));
- }
- return SDL_PrivateAddMappingForGUID(guid, mapping_string,
- &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT);
-}
-#endif /* __ANDROID__ */
-
-
/*
* Helper function to determine pre-calculated offset to certain joystick mappings
*/
@@ -1025,11 +908,6 @@
mapping = s_pXInputMapping;
}
}
-#ifdef __ANDROID__
- if (!mapping && name && !SDL_IsJoystickHIDAPI(guid)) {
- mapping = SDL_CreateMappingForAndroidController(name, guid);
- }
-#endif
if (!mapping) {
mapping = s_pDefaultMapping;
}
@@ -1315,8 +1193,6 @@
#ifdef CONTROLLER_MAPPING_FILE
#define STRING(X) SDL_STRINGIFY_ARG(X)
return SDL_strlcpy(path, STRING(CONTROLLER_MAPPING_FILE), size) < size;
-#elif defined(__ANDROID__)
- return SDL_snprintf(path, size, "%s/controller_map.txt", SDL_AndroidGetInternalStoragePath()) < size;
#else
return SDL_FALSE;
#endif

View File

@ -1,26 +0,0 @@
diff -uNr SDL2-2.0.9/src/joystick/SDL_gamecontrollerdb.h SDL2-2.0.9.mod/src/joystick/SDL_gamecontrollerdb.h
--- SDL2-2.0.9/src/joystick/SDL_gamecontrollerdb.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/joystick/SDL_gamecontrollerdb.h 2018-11-09 17:03:52.268480237 +0200
@@ -559,22 +559,6 @@
"03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,",
"030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,",
#endif
-#if defined(__ANDROID__)
- "05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,",
- "05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
- "050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
- "050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
- "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,", /* Extremely slow in Bluetooth mode on Android */
- "050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
- "050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,",
- "050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,",
- "050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,",
- "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,",
- "05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,",
- "050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,",
- "050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
- "050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", /* The DPAD doesn't seem to work on this controller on Android TV? */
-#endif
#if defined(SDL_JOYSTICK_MFI)
"05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,",
"05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,",

View File

@ -1,12 +0,0 @@
diff -uNr SDL2-2.0.9/src/joystick/SDL_sysjoystick.h SDL2-2.0.9.mod/src/joystick/SDL_sysjoystick.h
--- SDL2-2.0.9/src/joystick/SDL_sysjoystick.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/joystick/SDL_sysjoystick.h 2018-11-09 17:04:46.285771392 +0200
@@ -74,7 +74,7 @@
struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */
};
-#if defined(__IPHONEOS__) || defined(__ANDROID__)
+#if defined(__IPHONEOS__)
#define HAVE_STEAMCONTROLLERS
#define USE_STEAMCONTROLLER_HIDAPI
#elif defined(__LINUX__)

View File

@ -1,24 +0,0 @@
diff -uNr SDL2-2.0.9/src/stdlib/SDL_getenv.c SDL2-2.0.9.mod/src/stdlib/SDL_getenv.c
--- SDL2-2.0.9/src/stdlib/SDL_getenv.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/stdlib/SDL_getenv.c 2018-11-09 16:57:33.934034207 +0200
@@ -29,9 +29,6 @@
#include "../core/windows/SDL_windows.h"
#endif
-#if defined(__ANDROID__)
-#include "../core/android/SDL_android.h"
-#endif
#include "SDL_stdinc.h"
@@ -175,10 +172,6 @@
char *
SDL_getenv(const char *name)
{
-#if defined(__ANDROID__)
- /* Make sure variables from the application manifest are available */
- Android_JNI_GetManifestEnvironmentVariables();
-#endif
/* Input validation */
if (!name || !*name) {

View File

@ -1,23 +0,0 @@
diff -uNr SDL2-2.0.9/src/thread/pthread/SDL_systhread.c SDL2-2.0.9.mod/src/thread/pthread/SDL_systhread.c
--- SDL2-2.0.9/src/thread/pthread/SDL_systhread.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/thread/pthread/SDL_systhread.c 2018-11-09 16:57:44.624162105 +0200
@@ -51,9 +51,6 @@
#include "SDL_thread.h"
#include "../SDL_thread_c.h"
#include "../SDL_systhread.h"
-#ifdef __ANDROID__
-#include "../../core/android/SDL_android.h"
-#endif
#ifdef __HAIKU__
#include <kernel/OS.h>
@@ -72,9 +69,6 @@
static void *
RunThread(void *data)
{
-#ifdef __ANDROID__
- Android_JNI_SetupThread();
-#endif
SDL_RunThread(data);
return NULL;
}

View File

@ -1,16 +0,0 @@
diff -uNr SDL2-2.0.9/src/video/SDL_video.c SDL2-2.0.9.mod/src/video/SDL_video.c
--- SDL2-2.0.9/src/video/SDL_video.c 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/video/SDL_video.c 2018-11-09 16:58:16.844546616 +0200
@@ -1435,12 +1435,6 @@
return NULL;
}
- /* Some platforms have OpenGL enabled by default */
-#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__
- if (!_this->is_dummy && !(flags & SDL_WINDOW_VULKAN)) {
- flags |= SDL_WINDOW_OPENGL;
- }
-#endif
if (flags & SDL_WINDOW_OPENGL) {
if (!_this->GL_CreateContext) {
SDL_SetError("OpenGL support is either not configured in SDL "

View File

@ -1,12 +0,0 @@
diff -uNr SDL2-2.0.9/src/video/khronos/KHR/khrplatform.h SDL2-2.0.9.mod/src/video/khronos/KHR/khrplatform.h
--- SDL2-2.0.9/src/video/khronos/KHR/khrplatform.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/video/khronos/KHR/khrplatform.h 2018-11-09 16:57:54.124275632 +0200
@@ -101,8 +101,6 @@
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
-#elif defined(__ANDROID__)
-# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif

View File

@ -1,20 +0,0 @@
diff -uNr SDL2-2.0.9/src/video/khronos/vulkan/vk_platform.h SDL2-2.0.9.mod/src/video/khronos/vulkan/vk_platform.h
--- SDL2-2.0.9/src/video/khronos/vulkan/vk_platform.h 2018-10-31 17:07:22.000000000 +0200
+++ SDL2-2.0.9.mod/src/video/khronos/vulkan/vk_platform.h 2018-11-09 16:58:07.281099306 +0200
@@ -51,16 +51,6 @@
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
-#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
- #error "Vulkan isn't supported for the 'armeabi' NDK ABI"
-#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
- // On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
- // calling convention, i.e. float parameters are passed in registers. This
- // is true even if the rest of the application passes floats on the stack,
- // as it does by default when compiling for the armeabi-v7a NDK ABI.
- #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
- #define VKAPI_CALL
- #define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR

File diff suppressed because it is too large Load Diff