mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-04-20 01:17:30 +00:00
rebuilt SDL2 for OSX/Win from mainstream SDL2-2.0.9 release:
post-release bug fixes up to hg-12379:5dc13016cf34 included. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1599 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
aaba723840
commit
8ccc4ac773
25 changed files with 138 additions and 46 deletions
|
@ -137,7 +137,7 @@
|
|||
|
||||
/* Enable MFi joystick support */
|
||||
#define SDL_JOYSTICK_MFI 1
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
/*#define SDL_JOYSTICK_HIDAPI 1*/
|
||||
|
||||
#ifdef __TVOS__
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
|
|
@ -204,6 +204,13 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened game controller, or -1 if it's not available
|
||||
*
|
||||
* For XInput controllers this returns the XInput user index.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened controller, if available.
|
||||
* If the vendor ID isn't available this function returns 0.
|
||||
|
|
|
@ -132,6 +132,12 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Get the player index of a joystick, or -1 if it's not available
|
||||
* This can be called before any joysticks are opened.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Return the GUID for the joystick at this index
|
||||
* This can be called before any joysticks are opened.
|
||||
|
@ -194,6 +200,13 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened joystick, or -1 if it's not available
|
||||
*
|
||||
* For XInput controllers this returns the XInput user index.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick);
|
||||
|
||||
/**
|
||||
* Return the GUID for this opened joystick
|
||||
*/
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define SDL_REVISION "hg-12339:86dcfbbcacaf"
|
||||
#define SDL_REVISION_NUMBER 12339
|
||||
#define SDL_REVISION "hg-12373:8feb5da6f2fb"
|
||||
#define SDL_REVISION_NUMBER 12373
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,47 @@
|
|||
|
||||
This is a list of major changes in SDL's version history.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.9:
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
General:
|
||||
* Added a new sensor API, initialized by passing SDL_INIT_SENSOR to SDL_Init(), and defined in SDL_sensor.h
|
||||
* Added an event SDL_SENSORUPDATE which is sent when a sensor is updated
|
||||
* Added SDL_GetDisplayOrientation() to return the current display orientation
|
||||
* Added an event SDL_DISPLAYEVENT which is sent when the display orientation changes
|
||||
* Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. (Thanks to Valve for contributing the PS4 and Nintendo Switch Pro controller support)
|
||||
* Added support for many other popular game controllers
|
||||
* Added SDL_JoystickGetDevicePlayerIndex(), SDL_JoystickGetPlayerIndex(), and SDL_GameControllerGetPlayerIndex() to get the player index for a controller. For XInput controllers this returns the XInput index for the controller.
|
||||
* Added SDL_GameControllerRumble() and SDL_JoystickRumble() which allow simple rumble without using the haptics API
|
||||
* Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened
|
||||
* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_TIME to control the mouse double-click time
|
||||
* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to control the mouse double-click radius, in pixels
|
||||
* Added SDL_HasColorKey() to return whether a surface has a colorkey active
|
||||
* Added SDL_HasAVX512F() to return whether the CPU has AVX-512F features
|
||||
* Added SDL_IsTablet() to return whether the application is running on a tablet
|
||||
* Added SDL_THREAD_PRIORITY_TIME_CRITICAL for threads that must run at the highest priority
|
||||
|
||||
Mac OS X:
|
||||
* Fixed black screen at start on Mac OS X Mojave
|
||||
|
||||
Linux:
|
||||
* Added SDL_LinuxSetThreadPriority() to allow adjusting the thread priority of native threads using RealtimeKit if available.
|
||||
|
||||
iOS:
|
||||
* Fixed Asian IME input
|
||||
|
||||
Android:
|
||||
* Updated required Android SDK to API 26, to match Google's new App Store requirements
|
||||
* Added support for wired USB Xbox, PS4, and Nintendo Switch Pro controllers
|
||||
* Added support for relative mouse mode on Android 7.0 and newer (except where it's broken, on Chromebooks and when in DeX mode with Samsung Experience 9.0)
|
||||
* Added support for custom mouse cursors on Android 7.0 and newer
|
||||
* Added the hint SDL_HINT_ANDROID_TRAP_BACK_BUTTON to control whether the back button will back out of the app (the default) or be passed to the application as SDL_SCANCODE_AC_BACK
|
||||
* Added SDL_AndroidBackButton() to trigger the Android system back button behavior when handling the back button in the application
|
||||
* Added SDL_IsChromebook() to return whether the app is running in the Chromebook Android runtime
|
||||
* Added SDL_IsDeXMode() to return whether the app is running while docked in the Samsung DeX
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
2.0.8:
|
||||
---------------------------------------------------------------------------
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
|
||||
/* Enable MFi joystick support */
|
||||
#define SDL_JOYSTICK_MFI 1
|
||||
#define SDL_JOYSTICK_HIDAPI 1
|
||||
/*#define SDL_JOYSTICK_HIDAPI 1*/
|
||||
|
||||
#ifdef __TVOS__
|
||||
#define SDL_SENSOR_DUMMY 1
|
||||
|
|
|
@ -204,6 +204,13 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened game controller, or -1 if it's not available
|
||||
*
|
||||
* For XInput controllers this returns the XInput user index.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened controller, if available.
|
||||
* If the vendor ID isn't available this function returns 0.
|
||||
|
|
|
@ -132,6 +132,12 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Get the player index of a joystick, or -1 if it's not available
|
||||
* This can be called before any joysticks are opened.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
||||
|
||||
/**
|
||||
* Return the GUID for the joystick at this index
|
||||
* This can be called before any joysticks are opened.
|
||||
|
@ -194,6 +200,13 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
|
|||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened joystick, or -1 if it's not available
|
||||
*
|
||||
* For XInput controllers this returns the XInput user index.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick);
|
||||
|
||||
/**
|
||||
* Return the GUID for this opened joystick
|
||||
*/
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define SDL_REVISION "hg-12339:86dcfbbcacaf"
|
||||
#define SDL_REVISION_NUMBER 12339
|
||||
#define SDL_REVISION "hg-12373:8feb5da6f2fb"
|
||||
#define SDL_REVISION_NUMBER 12373
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -60,6 +60,9 @@ extern void WIN_CoUninitialize(void);
|
|||
/* Returns SDL_TRUE if we're running on Windows Vista and newer */
|
||||
extern BOOL WIN_IsWindowsVistaOrGreater(void);
|
||||
|
||||
/* Returns SDL_TRUE if we're running on Windows 7 and newer */
|
||||
extern BOOL WIN_IsWindows7OrGreater(void);
|
||||
|
||||
/* You need to SDL_free() the result of this call. */
|
||||
extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
|
||||
|
||||
|
|
|
@ -117,50 +117,66 @@ OutOfMemory(void)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* WinMain, main, and wmain eventually call into here. */
|
||||
static int
|
||||
main_utf8(int argc, char *argv[])
|
||||
{
|
||||
SDL_SetMainReady();
|
||||
|
||||
/* Run the application main() code */
|
||||
return SDL_main(argc, argv);
|
||||
}
|
||||
|
||||
/* Gets the arguments with GetCommandLine, converts them to argc and argv
|
||||
and calls main_utf8 */
|
||||
and calls SDL_main */
|
||||
static int
|
||||
main_getcmdline()
|
||||
{
|
||||
char **argv;
|
||||
int argc;
|
||||
char *cmdline;
|
||||
char *cmdline = NULL;
|
||||
int retval = 0;
|
||||
int cmdalloc = 0;
|
||||
const TCHAR *text = GetCommandLine();
|
||||
const TCHAR *ptr;
|
||||
int argc_guess = 2; /* space for NULL and initial argument. */
|
||||
int rc;
|
||||
|
||||
/* make a rough guess of command line arguments. Overestimates if there
|
||||
are quoted things. */
|
||||
for (ptr = text; *ptr; ptr++) {
|
||||
if ((*ptr == ' ') || (*ptr == '\t')) {
|
||||
argc_guess++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Grab the command line */
|
||||
TCHAR *text = GetCommandLine();
|
||||
#if UNICODE
|
||||
cmdline = WIN_StringToUTF8(text);
|
||||
rc = WideCharToMultiByte(CP_UTF8, 0, text, -1, NULL, 0, NULL, NULL);
|
||||
if (rc > 0) {
|
||||
cmdalloc = rc + (sizeof (char *) * argc_guess);
|
||||
argv = (char **) VirtualAlloc(NULL, cmdalloc, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
|
||||
if (argv) {
|
||||
int rc2;
|
||||
cmdline = (char *) (argv + argc_guess);
|
||||
rc2 = WideCharToMultiByte(CP_UTF8, 0, text, -1, cmdline, rc, NULL, NULL);
|
||||
SDL_assert(rc2 == rc);
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* !!! FIXME: are these in the system codepage? We need to convert to UTF-8. */
|
||||
cmdline = SDL_strdup(text);
|
||||
rc = ((int) SDL_strlen(text)) + 1;
|
||||
cmdalloc = rc + (sizeof (char *) * argc_guess);
|
||||
argv = (char **) VirtualAlloc(NULL, cmdalloc, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
|
||||
if (argv) {
|
||||
cmdline = (char *) (argv + argc_guess);
|
||||
SDL_strcpy(cmdline, text);
|
||||
}
|
||||
#endif
|
||||
if (cmdline == NULL) {
|
||||
return OutOfMemory();
|
||||
}
|
||||
|
||||
/* Parse it into argv and argc */
|
||||
argc = ParseCommandLine(cmdline, NULL);
|
||||
argv = SDL_stack_alloc(char *, argc + 1);
|
||||
if (argv == NULL) {
|
||||
return OutOfMemory();
|
||||
}
|
||||
ParseCommandLine(cmdline, argv);
|
||||
SDL_assert(ParseCommandLine(cmdline, NULL) <= argc_guess);
|
||||
argc = ParseCommandLine(cmdline, argv);
|
||||
|
||||
retval = main_utf8(argc, argv);
|
||||
SDL_SetMainReady();
|
||||
|
||||
SDL_stack_free(argv);
|
||||
SDL_free(cmdline);
|
||||
/* Run the application main() code */
|
||||
retval = SDL_main(argc, argv);
|
||||
|
||||
VirtualFree(argv, cmdalloc, MEM_DECOMMIT);
|
||||
VirtualFree(argv, 0, MEM_RELEASE);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -178,21 +194,7 @@ console_ansi_main(int argc, char *argv[])
|
|||
int
|
||||
console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
|
||||
{
|
||||
int retval = 0;
|
||||
char **argv = SDL_stack_alloc(char*, argc + 1);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < argc; ++i) {
|
||||
argv[i] = WIN_StringToUTF8(wargv[i]);
|
||||
}
|
||||
argv[argc] = NULL;
|
||||
|
||||
retval = main_utf8(argc, argv);
|
||||
|
||||
/* !!! FIXME: we are leaking all the elements of argv we allocated. */
|
||||
SDL_stack_free(argv);
|
||||
|
||||
return retval;
|
||||
return main_getcmdline();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -124,6 +124,7 @@ SDL_GameControllerGetBindForButton
|
|||
SDL_GameControllerGetButton
|
||||
SDL_GameControllerGetButtonFromString
|
||||
SDL_GameControllerGetJoystick
|
||||
SDL_GameControllerGetPlayerIndex
|
||||
SDL_GameControllerGetProduct
|
||||
SDL_GameControllerGetProductVersion
|
||||
SDL_GameControllerGetStringForAxis
|
||||
|
@ -316,6 +317,7 @@ SDL_JoystickGetBall
|
|||
SDL_JoystickGetButton
|
||||
SDL_JoystickGetDeviceGUID
|
||||
SDL_JoystickGetDeviceInstanceID
|
||||
SDL_JoystickGetDevicePlayerIndex
|
||||
SDL_JoystickGetDeviceProduct
|
||||
SDL_JoystickGetDeviceProductVersion
|
||||
SDL_JoystickGetDeviceType
|
||||
|
@ -324,6 +326,7 @@ SDL_JoystickGetGUID
|
|||
SDL_JoystickGetGUIDFromString
|
||||
SDL_JoystickGetGUIDString
|
||||
SDL_JoystickGetHat
|
||||
SDL_JoystickGetPlayerIndex
|
||||
SDL_JoystickGetProduct
|
||||
SDL_JoystickGetProductVersion
|
||||
SDL_JoystickGetType
|
||||
|
|
|
@ -121,6 +121,7 @@
|
|||
++'_SDL_GameControllerGetButton'.'SDL2.DLL'..'SDL_GameControllerGetButton'
|
||||
++'_SDL_GameControllerGetButtonFromString'.'SDL2.DLL'..'SDL_GameControllerGetButtonFromString'
|
||||
++'_SDL_GameControllerGetJoystick'.'SDL2.DLL'..'SDL_GameControllerGetJoystick'
|
||||
++'_SDL_GameControllerGetPlayerIndex'.'SDL2.DLL'..'SDL_GameControllerGetPlayerIndex'
|
||||
++'_SDL_GameControllerGetProduct'.'SDL2.DLL'..'SDL_GameControllerGetProduct'
|
||||
++'_SDL_GameControllerGetProductVersion'.'SDL2.DLL'..'SDL_GameControllerGetProductVersion'
|
||||
++'_SDL_GameControllerGetStringForAxis'.'SDL2.DLL'..'SDL_GameControllerGetStringForAxis'
|
||||
|
@ -313,6 +314,7 @@
|
|||
++'_SDL_JoystickGetButton'.'SDL2.DLL'..'SDL_JoystickGetButton'
|
||||
++'_SDL_JoystickGetDeviceGUID'.'SDL2.DLL'..'SDL_JoystickGetDeviceGUID'
|
||||
++'_SDL_JoystickGetDeviceInstanceID'.'SDL2.DLL'..'SDL_JoystickGetDeviceInstanceID'
|
||||
++'_SDL_JoystickGetDevicePlayerIndex'.'SDL2.DLL'..'SDL_JoystickGetDevicePlayerIndex'
|
||||
++'_SDL_JoystickGetDeviceProduct'.'SDL2.DLL'..'SDL_JoystickGetDeviceProduct'
|
||||
++'_SDL_JoystickGetDeviceProductVersion'.'SDL2.DLL'..'SDL_JoystickGetDeviceProductVersion'
|
||||
++'_SDL_JoystickGetDeviceType'.'SDL2.DLL'..'SDL_JoystickGetDeviceType'
|
||||
|
@ -321,6 +323,7 @@
|
|||
++'_SDL_JoystickGetGUIDFromString'.'SDL2.DLL'..'SDL_JoystickGetGUIDFromString'
|
||||
++'_SDL_JoystickGetGUIDString'.'SDL2.DLL'..'SDL_JoystickGetGUIDString'
|
||||
++'_SDL_JoystickGetHat'.'SDL2.DLL'..'SDL_JoystickGetHat'
|
||||
++'_SDL_JoystickGetPlayerIndex'.'SDL2.DLL'..'SDL_JoystickGetPlayerIndex'
|
||||
++'_SDL_JoystickGetProduct'.'SDL2.DLL'..'SDL_JoystickGetProduct'
|
||||
++'_SDL_JoystickGetProductVersion'.'SDL2.DLL'..'SDL_JoystickGetProductVersion'
|
||||
++'_SDL_JoystickGetType'.'SDL2.DLL'..'SDL_JoystickGetType'
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue