Commit Graph

10652 Commits

Author SHA1 Message Date
Sam Lantinga
00aad31722 Fixed bug 4270 - Android HIDDeviceManager function needs to be public
Sylvain

Can't run an android app without declaring the JNI interface function as public.
2018-09-25 20:11:52 -07:00
Sam Lantinga
d2c63256f8 Fixed bug 4268 - Android_JNI_OpenAudioDevice function has error
alittle

where iscapture == 1

1.param set error

(*env)->CallStaticIntMethod(env, mAudioManagerClass, midCaptureOpen, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames)

param:audioBuffer16Bit need change to captureBuffer16Bit

2.logic error

if (is16Bit) {
        // ALITTLE Modify the source code
        if (iscapture) {
            audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)captureBuffer);
        } else {
            audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
            audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
        }
        // if (!iscapture) {
        //     audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
        // }
        // audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
    } else {
        // ALITTLE Modify the source code
        if (iscapture) {
            audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)captureBuffer);
        } else {
            audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
            audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
        }
        // if (!iscapture) {
        //     audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
        // }
        // audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
    }
2018-09-25 20:08:51 -07:00
Sam Lantinga
de4f287d7f Removed redundant SDL_GetColorKey() call. (thanks Sylvain!) 2018-09-25 19:53:16 -07:00
Ethan Lee
d62e66030e WinRT: Wait until audio device activation is complete and PrepDevice during OpenAudio 2018-09-25 01:45:12 -04:00
Sam Lantinga
84dcf914ec Added 8bitdo SF 30 PRO controller support for Linux / DInput mode (thanks Frank Hartung) 2018-09-25 19:41:33 -07:00
Sam Lantinga
8fbb4a7c28 Fixed building with newer Android NDK 2018-09-25 08:23:57 -07:00
Ozkan Sezer
6812a42fbb safer this way, just in case.. 2018-09-25 09:20:56 +03:00
Sam Lantinga
018357cfcc Fixed rare null pointer dereference 2018-09-24 20:31:24 -07:00
Sam Lantinga
2a05f4681b Fixed bug 4264 - SDL_CreateTextureFromSurface generates error message but returns ok
Anthony @ POW Games

SDL_CreateTextureFromSurface makes an internal call to SDL_GetColorKey which can return an error and spams the error log with "Surface doesn't have a colorkey" even though the original function didn't return an error.
2018-09-24 16:41:55 -07:00
Sam Lantinga
6d35b7a054 Fixed bug 4267 - linkage failure with --enable-hidapi because of missing libudev symbols
Ozkan Sezer

hidapi dynamic udev initial patch
2018-09-24 16:33:14 -07:00
Sam Lantinga
175f9bc0e2 Support relative mouse for Samsung DeX on Samsung Experience 9.5 or later (Android 8.1 or later) 2018-09-24 11:53:04 -07:00
Sam Lantinga
85b2a541a6 Fixed whitespace 2018-09-24 11:49:25 -07:00
Drew Pirrone-Brusse
11a6e91c74 Correct the name of the SDL shared library in CMake for Mac OS 2018-08-18 17:23:40 -04:00
Sam Lantinga
fe4b2aa419 Fixed bug 3166 - It would be nice, if SDL would support including SDL project as a subdirectory into another CMake project
Wayde Reitsma

After attempting to use SDL2 in the way described in this bug, I found the main issue was the includes not being added to the compiler command.

I found the issue was that the target_include_directories commands for the SDL2, SDL2-static and SDL2main targets only sets the public includes for installations using the INSTALL_INTERFACE generator expression.

I have written a patch to CMakeLists.txt that fixes this issue by adding another item to the target_include_directories commands, utilizing the BUILD_INTERFACE generator expression to correctly add the include directory during builds.
2018-09-24 08:41:59 -07:00
Sam Lantinga
162e9755c0 Removed button logging message 2018-09-21 09:41:21 -07:00
Sam Lantinga
5c51894da0 Added missing call to WindowsDeleteString() 2018-09-20 15:55:52 -07:00
Sam Lantinga
9cc586608e Added experimental support for Windows.Gaming.Input 2018-09-19 10:03:40 -07:00
Ryan C. Gordon
26215bb307 cmake: correctly report Vulkan support at configure time (thanks, Tiago!).
Fixes Bugzilla #4262.
2018-09-18 11:49:42 -04:00
Sam Lantinga
70b54e55ba Fixed NullPointerException if there's no singleton 2018-09-17 12:08:05 -07:00
Sam Lantinga
c37adc91b5 Store the API device refcount on the device itself, so if the device is disconnected and we have multiple application references to it, we only free it once. 2018-09-17 11:35:24 -07:00
Sam Lantinga
b59054a215 Fixed creating an Android game controller mapping for HIDAPI devices on initialization 2018-09-17 11:35:22 -07:00
Ozkan Sezer
0839e5f252 do not export hidapi symbols from SDL dlls (bug #4259). 2018-09-15 14:28:10 +03:00
Ozkan Sezer
d40d6c9e6c acinclude: rename ax_gcc_x86_cpuid.m4.htm to ax_gcc_x86_cpuid.m4 2018-09-15 09:24:04 +03:00
Ozkan Sezer
17c050cf15 fix permissions 2018-09-15 08:11:50 +03:00
Sam Lantinga
75f396a107 Added hints SDL_HINT_MOUSE_DOUBLE_CLICK_TIME and SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to allow tuning double-click sensitivity.
Also increased the default double-click radius to 32 pixels to be more forgiving for touch interfaces
2018-09-14 19:26:26 -07:00
Sam Lantinga
393f3ab5c4 Guard against Steam Controller input when we're shutting down. 2018-09-14 18:31:03 -07:00
Sam Lantinga
f6e4a90c39 Use atomic reference counting for the HID device object 2018-09-14 18:31:01 -07:00
Sam Lantinga
75ef160c65 Fixed crash launching under Steam on Mac OS X 2018-09-14 12:41:29 -07:00
Sam Lantinga
f4a9580326 Fixed Chinese IME support (thanks 树子。!) 2018-09-10 23:01:33 -07:00
Sam Lantinga
aa37b0e028 Fixed building on tvOS 2018-09-10 23:00:09 -07:00
Sam Lantinga
bfe8b97590 Fixed building on tvOS without any sensor support 2018-09-10 22:59:49 -07:00
Ozkan Sezer
ef5920a371 hidapi/SDL_hidapijoystick.c: fix build in C90 mode:
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_InitializeDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: (Each undeclared identifier is reported only once
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: for each function it appears in.)
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_UpdateDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:339: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:341: error: ISO C90 forbids mixed declarations and code
2018-09-07 11:03:24 +03:00
Ozkan Sezer
3918965ae9 SDL_sensor.h, SDL_video.h: remove comma at end of enumerator lists.
Avoids gcc -pedantic warnings, closes bug #4253.
2018-09-07 10:47:50 +03:00
Ryan C. Gordon
cdac13e19c metal: Make sure layer drawableSize is adjusted on resize.
Fixes Bugzilla #4250.
2018-09-06 00:56:13 -04:00
Ryan C. Gordon
3ac049e49c Fixed a comment typo. 2018-09-05 21:24:13 -04:00
Sam Lantinga
1c88fc1cbf Fixed bug 4002 - Android, nativeRunMain() fails on some phone with arm64-v8a
Sylvain

The issue is totally reproducible on P8 Lite.

"The dlopen() call doesn't include the app's native library directory. The behavior of  dlopen() by Android is not guaranteed".

Workaround in getMainSharedObject()

Just replace
    return library;
with
    return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;
2018-09-05 15:54:46 -07:00
Sam Lantinga
88d7d340f8 Speculatively disable rumble on the Razer Panthera Evo, which doesn't have rumble motors and probably hangs in the same way the Panthera does. 2018-09-05 15:28:06 -07:00
Sam Lantinga
1da5d57b3d Updated Xcode library version to match libtool output with Ozkan's change 2018-09-05 13:04:50 -07:00
Sam Lantinga
47eb5c669e Don't overwrite the default binding when changing the binding for a controller that was using the default. 2018-09-05 12:16:01 -07:00
Sam Lantinga
7fe3c4b2ad Added binding for Mad Catz FightStick TE S+ (PS3) on Mac OS X 2018-09-05 11:24:23 -07:00
Sam Lantinga
5d8d1ac764 Added support for the Razer Panthera Fightstick
Fixed bindings for the Mad Catz FightStick TE S+
2018-09-05 11:18:50 -07:00
Ozkan Sezer
1d8d253674 CMakeLists.txt: fix typo SDL_SENSORS_DISABLED -> SDL_SENSOR_DISABLED 2018-09-02 23:57:06 +03:00
Ryan C. Gordon
846526767d test: Makefile should copy .dat files for testoverlay2. 2018-09-02 00:35:11 -04:00
Ryan C. Gordon
3987531781 metal: SDL_UpdateYUVTexture shouldn't swap planes based on format. 2018-09-01 20:47:12 -04:00
Sam Lantinga
a28c07e23d Better fix to make sure we're only returning controllers from the HIDAPI joystick API 2018-08-31 18:10:21 -07:00
Sam Lantinga
789f59f5df Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID. 2018-08-31 17:47:34 -07:00
Ozkan Sezer
3512d4dbbb fix permissions 2018-08-30 12:50:10 +03:00
Sam Lantinga
aaa121432e Don't show the Razer Raiju sound interface as a game controller 2018-08-29 20:55:02 -07:00
Sam Lantinga
07f8de33f6 Fixed compiler warning and use higher precision in angle calculation 2018-08-29 20:23:42 -07:00
Sam Lantinga
f3e84167ad Don't rumble Bluetooth PS4 controllers by default, as that switches the controller into extended input report mode, which breaks games that use DirectInput. 2018-08-29 20:23:39 -07:00