Commit graph

43 commits

Author SHA1 Message Date
Philipp Wiesemann
4755c05d29 linux: Changed internal functions to be static. 2017-06-11 22:30:58 +02:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Philipp Wiesemann
2a8a7f92b7 Fixed empty parameter list in signatures of internal functions. 2016-11-16 22:08:51 +01:00
Philipp Wiesemann
1d6a32758b Linux: Fixed memory leak in haptic implementation (thanks, Martin!).
Fixes Bugzilla #3238.
2016-07-20 21:01:14 +02:00
Ryan C. Gordon
2503e42a28 Use SDL's stdinc functions instead of C runtime calls.
--HG--
extra : histedit_source : e1d934044bdfa9a54c4f0e0b09f053f6ad2b84c8
2016-01-05 02:29:16 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
8038b8bb7f Fix crash on controller hotplug on linux.
CR: Sam
2015-09-30 15:38:30 -07:00
Ryan C. Gordon
f9158b31a1 Haptic/Linux: Keep track of device numbers properly to track duplicates.
Fixes Bugzilla #3014.

--HG--
extra : rebase_source : 0f5013166244c9d397acdaf74dcb8dd0187c7c6a
2015-06-16 00:57:45 -04:00
Sam Lantinga
819d3cc707 Fixed bug 2953 - Crash due to a bad cleanup in the SDL_SYS_HapticQuit function
Technically this is caused by the haptic devices not being closed at quit time, which we need to fix anyway, but this is a bandaid for now.
2015-06-14 19:21:13 -07:00
Philipp Wiesemann
e5cdbda294 Linux: Fixed not needed call to close() on error.
It was called if file descriptor was none and -1.
2015-06-08 20:46:09 +02:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
e08e2cd4eb Remove unnecessary parentheses and an unnecessary free() of a NULL pointer.
(Thanks, Simon!)

Fixes Bugzilla #2881.
2015-02-19 13:11:19 -05:00
Philipp Wiesemann
518802a5c1 Replaced free() with SDL_free() because related allocation also uses wrapper. 2014-12-04 21:41:30 +01:00
Sam Lantinga
ed670a5786 Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase handled as time instead of angle; + direction clarification
Elias Vanderstuyft

Remove the dependency of the calculation of Linux "phase" on "period",
currently the "phase" parameter is interpreted as a time shift, instead of a phase shift.
The Linux input documentation is not clear about the exact units of the "phase" parameter (see http://lxr.free-electrons.com/source/include/uapi/linux/input.h?v=3.17#L1075 ),
but we're about to standardize the 'phase shift' interpretation into the Linux input documentation,
since this will ease the job of a driver to recalculate the effect's state when the user dynamically updates the "period" parameter.
2014-11-29 11:51:13 -08:00
Sam Lantinga
11db3a4830 Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase handled as time instead of angle; + direction clarification
Elias Vanderstuyft

It's not obvious from the general "haptic direction" description what the SDL direction actually means in terms of force magnitude sign,
currently its meaning is only reflected by the example.
2014-11-29 11:48:43 -08:00
Ryan C. Gordon
640631c6dc Haptic: Fix the saturation and deadband parameters' available range.
There was a misconception that Linux's saturation and deadband parameters -
on which the corresponding SDL parameters were based - use only half of the
possible range.

Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:47:42 -04:00
Ryan C. Gordon
f703b1b22c Haptic: Explicitly avoid floating point arithmetic if it's not needed.
Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:42:55 -04:00
Ryan C. Gordon
b9be113196 Haptic: DInput's POLAR direction actually matches Linux's direction.
Thanks, Elias!

Partially fixes Bugzilla #2686.

--HG--
extra : histedit_source : 214ecbc7baaf28e6c7ff1eee687ee66f356446eb
2014-08-16 16:41:25 -04:00
Ryan C. Gordon
a5d019efa3 Haptic: Don't interpret a direction of polar 35999 as "unsupported type".
(or linux-direction 0xFFFF)

Thanks, Elias!

Partially fixes Bugzilla #2686.

--HG--
extra : histedit_source : 767fa48d79fe8dfe8dda1f155ff1e19a470d7efc
2014-08-16 16:40:01 -04:00
Sam Lantinga
8072898dc9 Fixed bug 2562 - SDL_hapticlist/_tail not set correctly
Zachary L

SDL_hapticlist and SDL_hapticlist_tail are not set correctly when quitting the subsystem. This matters because they are represented as global variables. In the case you quit and reinitialize the subsystems, problems with dangling pointers arise.

For instance, SDL_hapticlist_tail will not be null on second initialization and because of the check on line 298, it will fail to set SDL_hapticlist appropriately. This can cause a few things to go wrong, like feeding SDL_strcmp a null fname which can cause a segfault.
2014-06-21 20:40:00 -07:00
Gabriel Jacobo
9faed54ab1 Zero out haptic linked list items on creation
(thanks to Turo Lamminen for the report!)
2014-02-24 10:25:02 -03:00
Ryan C. Gordon
f9cfc5f8da Fixed a typo. 2014-02-06 10:00:45 -05:00
Edward Rudd
7629872a1f Fix device counting in HapticMouse and JoystickOpen routines. 0 is the first item in the list not the last 2014-02-06 09:35:44 -05:00
Edward Rudd
c593f2045c fix indentation and spaces 2014-02-06 09:11:05 -05:00
Edward Rudd
f4141728b7 Rework haptic backend to properly support hotplugging of haptic devices.
* currently only linux backend updated.

--HG--
extra : rebase_source : ef39ed7c749a66ed5a261cf63a88b4e80a7afc88
2014-02-04 15:44:09 -05:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Ryan C. Gordon
82edee6971 Make internal SDL sources include SDL_internal.h instead of SDL_config.h
The new header will include SDL_config.h, but allows for other global stuff.

--HG--
extra : rebase_source : ddf4a4c0dc2c554b98c82700798f343cd91b16e3
2013-11-24 23:56:17 -05:00
Ryan C. Gordon
cd94a10070 Fixed comment typo. 2013-08-28 17:12:07 -04:00
Gabriel Jacobo
298ce1c1a7 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
c35c4a6f18 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Philipp Wiesemann
5b428b875f Corrected spelling in C source files. 2013-05-01 11:42:29 +02:00
Ryan C. Gordon
4f438b70a2 Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
c7f81eb3ca Fixed compile warning 2010-07-13 22:25:30 -07:00
Sam Lantinga
1d8567b304 Fixed bug #920
From Martin:

Alright... I corrected SDL_SYS_ToDirection in SDL_syshaptic.c in the linux
directory of haptic. Now in all 3 cases the same value is returned, at least.
Therefore now it should behave the same way as on Windows.

I added some comments and corrected the cases SDL_HAPTIC_CARTESIAN and
SDL_HAPTIC_SPHERICAL.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404433
2010-01-18 14:57:41 +00:00
Sam Lantinga
8a68fef797 Patch from David Carre:
I fixed a bug in the "SDL_DestroyRenderer()" function in the pandora x11 renderer (in fact the bug was in the "X11_GLES_MakeCurrent()" function) that was causing a crash when exiting SDL.

There was a problem while terminating the x11 egl window, that was preventing to quit/close SDL/SDL-window then reload SDL/SDL-window inside the same application.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403715
2009-07-30 14:53:57 +00:00
Edgar Simo
5f6b802b96 More verbosity and error checking.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403546
2009-02-21 18:03:22 +00:00
Sam Lantinga
4fd9c25fe6 Final merge of Google Summer of Code 2008 work...
Force Feedback for SDL
by Edgar Simo, mentored by Ryan C. Gordon

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403159
2008-08-25 09:55:03 +00:00