Commit graph

5474 commits

Author SHA1 Message Date
Sam Lantinga
a4a01c70db Backed out use of @autorelease keyword for now, since it's not supported by older Xcode versions. 2013-02-11 17:40:09 -08:00
Sam Lantinga
d36265107b Backed out use of @autorelease keyword for now, since it's not supported by older Xcode versions. 2013-02-11 17:39:52 -08:00
Sam Lantinga
e2aa9f0afb Fixed compiler warning (and undefined behavior) in game controller event filter. 2013-02-11 17:25:58 -08:00
Sam Lantinga
8ec12be05a Workaround for NVIDIA bug in glXSwapIntervalEXT.
This works around a bug in NVIDIA's implementation of
       glXSwapIntervalEXT, where it ignores updates to what it *thinks* is the
       current value, even though glXQueryDrawable returns a different value.

       Bug reported to NVIDIA and will hopefully be a part of 319.xx.

       Also a fix for invalidly treating glXSwapIntervalEXT as having an int
       return value (it's void).
2013-02-11 17:02:13 -08:00
Sam Lantinga
354604b7bb Patch - Joystick coef[] doesn't support dial with low number of positions.
Simon <simon@mungewell.org>

I am working on joystick support for the SRW-S1 gaming wheel on Linux,
this device has 3 dials with only a few positions each.

At present SDL2 only fail to report the highest position value, due to the
interger math used for coef[]'s.

So with a 4 position switch I have input values (with evtest)
--
Event: time 1358967246.173186, type 3 (EV_ABS), code 9 (ABS_GAS), value 2
Event: time 1358967246.173186, -------------- SYN_REPORT ------------
Event: time 1358967246.369150, type 3 (EV_ABS), code 9 (ABS_GAS), value 1
Event: time 1358967246.369150, -------------- SYN_REPORT ------------
Event: time 1358967246.930277, type 3 (EV_ABS), code 9 (ABS_GAS), value 0
Event: time 1358967246.930277, -------------- SYN_REPORT ------------
Event: time 1358967249.369832, type 3 (EV_ABS), code 9 (ABS_GAS), value 1
Event: time 1358967249.369832, -------------- SYN_REPORT ------------
Event: time 1358967249.514382, type 3 (EV_ABS), code 9 (ABS_GAS), value 2
Event: time 1358967249.514382, -------------- SYN_REPORT ------------
Event: time 1358967249.626189, type 3 (EV_ABS), code 9 (ABS_GAS), value 3
Event: time 1358967249.626189, -------------- SYN_REPORT ------------
--

Testjoystick reports
--
Joystick has 6 axes, 1 hats, 0 balls, and 17 buttons
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: -32768
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: -32768
--

The attached patch 'shifts' the coef[], so that 1/2 values can be
computed/seen and allows testjoystick to report correctly.
--
Joystick has 6 axes, 1 hats, 0 balls, and 17 buttons
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: -32768
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: 32767
--

Cheers,
Simon
2013-02-11 16:51:00 -08:00
Sam Lantinga
7b84e779ec Fix for dropped joystick events contributed by Simon <simon@mungewell.org>
In my system SDL2 is dropping a chunk of joystick events, which result in
a 'stuck brake/accelerator' whilst playing a racing simulator. This
basically means SDL2 is unsuitable for use at this point...

The patch below detects this situation and forces a re-read of all
attached joystick axis - thus resync to the correct/current pedal
positions.
2013-02-11 16:45:24 -08:00
Sam Lantinga
b73214bd02 tree 97aca305664b
parent 6a9ca692cd65
author Edward Rudd <urkle@outoforder.cc> 1358030048 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030048 18000
revision 6822
branch default

rework and fix handling of hat to button mappings

- doesn't assume it's always mapped to dpad
- properly handles multiple hats (up to 4)
- properly handles multiple presses (e.g. up and right)
- properly handles multiple gamepads
2013-02-11 11:21:54 -08:00
Sam Lantinga
290c391df5 tree 0c86a223596d
parent 44e12dd8ee8e
author Edward Rudd <urkle@outoforder.cc> 1358030047 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030047 18000
revision 6821
branch default

Fix a bad mapping from "axis" to "button"
2013-02-11 11:21:19 -08:00
Sam Lantinga
65399f4c26 tree 8cbca1e6b293
parent 7ddddb71cec9
author Edward Rudd <urkle@outoforder.cc> 1358030045 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030045 18000
revision 6820
branch default

Consolidate iterating the SupportedControllers array

also fix memory leak when controller mapping not found
2013-02-11 11:20:49 -08:00
Sam Lantinga
831e12e08b Fixed building SDL under Xcode 2013-02-11 11:09:55 -08:00
Andreas Schiffler
da76be8927 Add SDL_test test suite; add fuzzer test cases; fix fuzzer bug; fix compiler warnings 2013-02-08 07:14:50 -08:00
Sam Lantinga
4e861f19ca Fixed bug 1711 - Comment in "manifest" element within android-project/AndroidManifest.xml is the source of troubles
ny00@outlook.com

Let me quote the following opening tag from
android-project/AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <!-- Replace org.libsdl.app with the identifier of your game, e.g.
         com.gamemaker.game
     -->
      package="org.libsdl.app"
      android:versionCode="1"
      android:versionName="1.0"
      android:installLocation="auto">

The comment (with the text "Replace org.libsdl.app with...") seems to be a
cause of troubles. Here are a few examples I've spotted:

1) While using nkd-build from android-ndk-r8d, I receive the following error:

Invalid attribute name: <!-- replace org.libsdl.app with the identifier of your
game, e.g.
         com.gamemaker.game
     --
/home/ny00123/util/android-ndk-r8d/build/gmsl/__gmsl:512: *** non-numeric
second argument to `wordlist' function: ''.  Stop.

2) Repeating this but with android-ndk-r6b (an earlier revision), it reduces to
a warning and actual complication is not halted.

3) Following the instructions in README.android and using Eclipse (from a
recently downloaded ADT Bundle), I cannot seem to be able to create an Android
project from existing sources (one of the SDL test apps for now).
* On a side note, I can't find where I may choose the "Build Target" before
clicking "Finish", but it does not seem to be related to this bug report.
Anyway, following the choice of the project path and a click on "Finish",
nothing seems to occur.
If I rather do so after removing the above comment from AndroidManifest.xml,
though, the project appears on Eclipse as expected once I click on "Finish".
2013-02-08 01:12:48 -08:00
Sam Lantinga
069a2cce76 Fixed bug 1682 - Resize collapses window instantly to a size of 0 x 124.
Marco Schmidt

After sizing my main window (the only window in my application) through
grabbing the window border with the mouse the window collapses instantly to a
size of 0 x 124. In my application I can not resize the window to a normal size
again.

I tried to reproduce the problem - and here a the minimal steps I found.

I'm running WIN8 x64, VS2012Pro, HG SDL-2.0 tip, WIN32-Build.

Minimal steps to reproduce my problem:

- open solution SDL_VS2012
- make testdraw2 the start project
- pass command line option --resize to the debuggee testdraw2
- starting the application testdraw2
- try to resize the window
- the application window resizes to a minimal size 0 x 124.
- the application crashes to divide by zero .... (this is only the aftermath
but a unhandled error condition)
2013-02-08 01:04:07 -08:00
Sam Lantinga
352adba2df Fixed bug 1689 - Leaks galore in OS X Cocoa code.
Edward Rudd

This is to document the various leaks I'm finding in the Cocoa code in SDL 2.
2013-02-08 00:54:08 -08:00
Michael Sartain
079d0ee977 Add defines to disable setlocale and fork. Disable that code by default for now. 2013-02-05 12:10:54 -08:00
Michael Sartain
f398faa548 Use left facing arrow instead of right facing arrow for system cursor. 2013-02-05 12:09:59 -08:00
Sam Lantinga
9c258124d5 Use clang on Mac OS X, which is required for the @autorelease keyword 2013-02-03 14:03:49 -08:00
stopiccot
929560081c Replaced manual NSAutoreleasePool handing with @autorelease 2013-01-06 19:04:53 +03:00
Sam Lantinga
e1f76ef0ea Fixed setting the GUID for Bluetooth joysticks 2013-02-01 17:09:01 -08:00
Andreas Schiffler
ade15e571f Add tests to audio suite; update harness filter logic 2013-01-31 08:45:30 -08:00
Sam Lantinga
0c9fca187f Don't reset the mouse, that's actually bad behavior most of the time for windowed applications. 2013-01-27 20:37:14 -08:00
Gabriel Jacobo
9e1dc0a80d Fixes potential global reference leak on Android, by Philipp Wiesemann 2013-01-27 21:43:20 -03:00
Sam Lantinga
02db40b1b2 Updated build settings to use standard architectures 2013-01-27 15:56:28 -08:00
Sam Lantinga
4809ef4290 Fixed typo in documentation 2013-01-27 15:53:24 -08:00
Sam Lantinga
22321b18ef Fixed direction of rotation with OpenGL ES 2 2013-01-27 15:52:56 -08:00
Gabriel Jacobo
2420aca939 #1702,Android soft keyboard fails to pass all input, by Jonathan Dearborn 2013-01-26 12:31:55 -03:00
Sam Lantinga
4cec546dca Fixed crash when the game controller mapping hint is set - the hint was duplicated and not null terminated. 2013-01-25 14:25:19 -08:00
Andreas Schiffler
2e9dea31c5 Add mouse tests; update test suites 2013-01-24 07:58:59 -08:00
Andreas Schiffler
896befb67b Add tests to mouse suite; fix VS compiler warnings in tests 2013-01-23 08:03:19 -08:00
Tim Angus
bd462555d7 Fix warning in SDL_keyboard.h 2013-01-17 11:54:14 +00:00
Andreas Schiffler
b507ef3afa Add additional input validation to SDL_BuildAudioCVT; add additional tests to automation (audio, rwops) 2013-01-21 09:16:27 -08:00
Ryan C. Gordon
10fe9cd26f Added a newline to test buildbot and mercurial server upgrade. 2013-01-21 03:33:42 -05:00
Ryan C. Gordon
d41de59fc9 Cleaned out a few C++ single-line comments.
Should we bother doing this anymore? Is there really a C compiler we care
 about that doesn't support this?
2013-01-21 02:50:11 -05:00
Gabriel Jacobo
09cbdb12c9 Fixes bug 1696, thanks Paul Geerts!
Also adds a bit of information about asset loading on Android.
2013-01-14 20:20:33 -03:00
Andreas Schiffler
a971c6b291 Added timer test suite 2013-01-14 08:14:53 -08:00
Andreas Schiffler
02493c6188 Fix RWops test suite crash on Linux: remove unnecessary fclose 2013-01-14 07:20:55 -08:00
Andreas Schiffler
3bc9dbe16c Add input validation to SDL_GetKeyFromScancode; fix compiler warning in testautomation driver on Linux; update keyboard test suite 2013-01-13 22:55:26 -08:00
Sam Lantinga
175511b1a0 We don't have Visual CE support anymore 2013-01-13 14:31:53 -08:00
Andreas Schiffler
b4a190fb6f Update SDL_InvalidParamError to take param name; add additional fuzzer function; add new tests to keyboard test suite; improve surface test suite 2013-01-12 22:58:12 -08:00
Ryan C. Gordon
c1e8384624 Fixed logic bug. 2013-01-12 14:06:58 -05:00
Ryan C. Gordon
89124cba8b Fix a memory leak. We need to clean up our autorelease pool code at some point. 2013-01-12 14:04:51 -05:00
Andreas Schiffler
a20096403e Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite 2013-01-11 20:36:39 -08:00
Andreas Schiffler
054a17097d Added 3 more test cases to keyboard suite 2013-01-10 23:26:49 -08:00
Gabriel Jacobo
678523ea7c Android: Access APK files using AssetFileDescriptor 2013-01-08 09:30:53 -03:00
Gabriel Jacobo
b2b90c9f49 Fixed SDLActivity::audioInit return type, thanks Andreas! 2013-01-08 08:28:39 -03:00
Andreas Schiffler
17b81066ba Merged with tip 2013-01-07 07:39:46 -08:00
Andreas Schiffler
71eabe59cb Add a few keyboard tests; fix missing input validation in SDL_GetKeyFromName 2013-01-07 07:39:15 -08:00
Gabriel Jacobo
070defcf11 Fix Audio Buffer allocation on Android >= 4.2 2013-01-07 12:22:26 -03:00
Andreas Schiffler
5220df817b Add new test suite (mouse) with a few new tests 2013-01-06 18:19:30 -08:00
Andreas Schiffler
687ba034f6 Add new test suites (events, keyboard, syswm, video) with a few new tests each 2013-01-06 15:17:59 -08:00