Commit graph

38 commits

Author SHA1 Message Date
Philipp Wiesemann
518802a5c1 Replaced free() with SDL_free() because related allocation also uses wrapper. 2014-12-04 21:41:30 +01:00
Ryan C. Gordon
5ac5bdcea5 Haptic: Deal with negative periodic magnitudes (thanks, Elias!).
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs

The periodic magnitude parameter of the SDL Haptic API is based on the Linux
 FF API, so it means they are not directly compatible:
    'dwMagnitude' is a 'DWORD', which is unsigned.

Fixes Bugzilla #2701.

--HG--
extra : amend_source : eb0b85870149936fd451ddb0662841112ff93d07
2014-09-17 14:49:36 -04: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
Sam Lantinga
bdb4ce60cd Fixed bug 2631 - Mac: minor code cleanup
Alex Szpakowski

Some minor changes to the Mac-specific backend code:

- Fixed up some code style issues (mostly brace style inconsistencies).

- Fixed a compiler warning in SDL_cocoaevents.m.

- Removed some useless code now that the 10.7 SDK is required to build SDL.

- Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
2014-07-07 12:48:25 -07:00
Sam Lantinga
9c48dd8a60 Fixed compiler warning - HRESULT is set to FFERR_* values, but is an int 2014-06-25 01:43:58 -07:00
Philipp Wiesemann
e68f76da43 Removed empty statements. 2014-04-05 23:50:09 +02:00
Jørgen P. Tjernø
ca29983393 Mac: Fix error message for haptic subsystem.
We were calling SDL_Error instead of SDL_SetError when the haptic subsystem
wasn't initialized.
2014-02-25 17:25:49 -08: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
Edward Rudd
f08ead552b ignore hot plugs in mac haptic layer IF hap tics hasn't been initialized. 2014-02-07 09:35:13 -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
Ryan C. Gordon
884709423e Fixed memory leak. 2014-02-05 20:07:25 -05:00
Ryan C. Gordon
cece2c2b93 Make SDL_SYS_HapticMouse() count device indexes like HapticByDevIndex(). 2014-02-05 18:36:40 -05:00
Ryan C. Gordon
2757186774 Cleanup some vi footer comments, rename new PRIVATE_* funcs to MacHaptic_*. 2014-02-05 01:02:09 -05:00
Edward Rudd
00970c2034 Implement new backend methods for haptic and hot plugging on OS X 2014-02-04 18:17:16 -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
Sam Lantinga
08dfaaa2e6 Christoph Mallon: Remove pointless if (x) before SDL_free(x) 2013-08-29 08:29:21 -07: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
a1afe6c175 tree 5b46fd5b8c94
parent 971b278f0756
author Edward Rudd <urkle@outoforder.cc> 1358022907 18000
committer Edward Rudd <urkle@outoforder.cc> 1358022907 18000
revision 6819
branch default

Remove some redundant assigns
2013-02-11 21:47:13 -08:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Sam Lantinga
75ecf04ad9 Check return value, not unsigned "supported" flags 2011-12-31 13:28:07 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Ryan C. Gordon
1f5750981e Fixed compiler warning on 64-bit builds. 2011-08-22 13:41:35 -04:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
d5af47a5c7 Untested fix for bug 946 (SDL_HapticIndex returns 0 for all devices)
Edgar Simo      2011-02-20 09:02:31 PST

Linux uses fname, which is the name of the device path like for example
/dev/input/event3 so it shouldn't have the issue. However I can confirm that it
looks like haptic->index never gets properly set on windows. Have to look at
mac os x also. I'll see if I can fix it real quick now.
2011-02-20 09:28:13 -08:00
Sam Lantinga
182eefe860 Fixed compilation on Mac OS X 10.3.9
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403511
2009-01-19 15:15:03 +00:00
Sam Lantinga
d123950aa3 Reverted Bob's indent checkin
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403475
2009-01-10 21:50:26 +00:00
Bob Pendleton
44fa7675c8 I ran a global "make indent" it modified the following files.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403473
2009-01-09 20:43:30 +00:00
Edgar Simo
5001b4e35a Missing an include.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403180
2008-08-26 11:17:16 +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