Commit Graph

110 Commits (6ee661398d94db9f6eac38b31269a3665432125a)

Author SHA1 Message Date
Sam Lantinga 658975f381 Fixed bug 3639 - SDL_GetPrefPath returns a path with two consecutive slashes on Unix if org is omitted
Fabian Greffrath

we use SDL_GetPrefPath() in Chocolate Doom to get a reasonable directory to save and restore config files and savegames:

https://github.com/chocolate-doom/chocolate-doom/blob/sdl2-branch/src/m_config.c#L2162

However, since there is no "organization" behind Chocolate Doom and there is really only one "product" called Chocolate Doom, we pass an empty string for the org parameter and the package string for app.

This leads to two consecutive slashes in the path returned by SDL_GetPrefPath() like this:

/home/user/.local/share//chocolate-doom/

While this is harmless, it sure looks bad.

I believe that it should be possible to either pass a NULL pointer for the org parameter or at least have the function detect an empty string as a means to express "there is no origanization, just a single product". The generation of the path string to be returned by the function will have to get adapted accordingly.
2017-08-11 11:32:00 -07:00
Sam Lantinga 222bacd86c Fixed bug 3682 - Toggle text input in checkkeys when the mouse is clicked
Eric Wasylishen

Small change to checkkeys so you can toggle text input mode with a mouse click.
This is needed for testing how dead keys react to toggling mouse input, i.e. these bugs:
2017-08-11 10:32:47 -07:00
Philipp Wiesemann 707ee5be26 Fixed typo in log message in testime program. 2017-07-09 23:00:35 +02:00
Philipp Wiesemann 705efc3532 Fixed handling only one event per frame in testshape program. 2017-06-24 23:45:19 +02:00
Philipp Wiesemann cb591ee611 Fixed ignoring first event in testshape program.
Found by Cppcheck.
2017-06-08 22:40:35 +02:00
Philipp Wiesemann 850185f401 Fixed crash if creating textures failed in testshape program. 2017-06-02 22:15:23 +02:00
Ryan C. Gordon 5dc350133f test: Makefile.in should copy bitmap and wave files to build directory.
I've lost count of the times I've forgotten to do this manually and wondered
why loopwave can't open sample.wav.  :)
2017-05-29 18:24:06 -04:00
Philipp Wiesemann 088f57a62a Removed unnecessary call to free() in testoverlay2 program. 2017-05-20 23:30:47 +02:00
Philipp Wiesemann fa3944ba39 Removed unused signal includes and handler in test programs. 2017-05-20 23:30:32 +02:00
Philipp Wiesemann 89499a0836 Removed unused field in loopwavequeue program.
Found by Cppcheck.
2017-04-29 22:50:23 +02:00
Philipp Wiesemann 266816b4aa Removed newlines from error messages. 2017-03-26 21:00:19 +02:00
Philipp Wiesemann 34a2a46f66 Removed unused constant in testgesture program. 2017-03-19 22:16:37 +01:00
Sam Lantinga 60ba8552d8 Backed out changeset e3fcdad257fc - testaudiocapture.c already does what we want 2017-03-16 16:45:12 -07:00
Sam Lantinga 570e286fd6 Added an audio recording test program 2017-03-15 11:39:54 -07:00
Sam Lantinga 6bdc0e724d Fixed tabs to spaces 2017-03-09 15:12:19 -08:00
Sam Lantinga aae481294d Added support to loopwave for hotplugging audio devices 2017-03-09 14:50:23 -08:00
Philipp Wiesemann 20c846ebe7 Fixed warning about implicit conversion in controllermap program. 2017-03-04 23:05:47 +01:00
Brandon Schaefer 94a69443c7 mistake: Revert the files that I did not mean to commit 2017-03-01 15:05:54 -08:00
Brandon Schaefer 7bbb13ea59 * Some refactoring and bug fixes. Thanks Micha? Kuchta! 2017-03-01 14:50:59 -08:00
Philipp Wiesemann dfa8fb3105 Fixed warnings if compiling loopwave programs with C++. 2017-02-19 21:05:42 +01:00
Sam Lantinga 6717a3d38d Added support for the HOTAS Warthog throttle 2017-01-31 12:23:29 -08:00
Sam Lantinga a156b0d994 Added the HOTAS Warthog as a flight stick 2017-01-31 10:20:09 -08:00
Philipp Wiesemann 5e78bc6474 Fixed copyright symbol in testgles2 program. 2017-01-21 22:00:40 +01:00
Sam Lantinga a395a90759 Fixed mapping the PG-9021 which, on Linux, emits a button partway through the trigger press along with axis motion all along the pull 2017-01-20 16:40:11 -08:00
Philipp Wiesemann 2b481015b2 Fixed warnings about missing initializers in testoverlay2 program. 2017-01-14 21:34:45 +01:00
Sam Lantinga a52d48c5ab Fixed bugs 2570, 3145, improved OpenGL ES context support on Windows and X11
Mark Callow

The attached patch does the following for the X11 and Windows platforms, the only ones where SDL attempts to use context_create_es_profile:

- Adds SDL_HINT_OPENGL_ES_DRIVER by which the application can
  say to use the OpenGL ES driver & EGL rather than the Open GL
  driver. (For bug #2570)
- Adds code to {WIN,X11}_GL_InitExtensions to determine the maximum
  OpenGL ES version supported by the OpenGL driver (for bug #3145)
- Modifies the test that determines whether to use the OpenGL
  driver or the real OpenGL ES driver to take into account the
  hint, the requested and supported ES version and whether ES 1.X
  is being requested. (For bug #2570 & bug #3145)
- Enables the testgles2 test for __WINDOWS__ and __LINUX__ and adds
  the test to the VisualC projects.

With the fix in place I have run testdraw2, testgl and testgles2 without any issues and have run my own apps that use OpenGL, OpenGL ES 3 and OpenGL ES 1.1.
2017-01-10 08:54:33 -08:00
Ryan C. Gordon 97f19cc367 testresample: write correct length to the .wav header. 2017-01-09 15:56:11 -05:00
Ryan C. Gordon 38854e0333 audio: Improvements in channel conversion code. 2017-01-08 16:18:49 -05:00
Ryan C. Gordon 70c8bd2481 Fixed a bunch of compiler warnings in the test code. 2017-01-07 22:24:45 -05:00
Sam Lantinga 4938c5054e Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value.
This is useful for controller mapping programs to determine an axis' zero state
2017-01-04 10:28:07 -08:00
Sam Lantinga 1ddff75c70 Some controllers have trouble getting out to 20000 2017-01-04 05:09:02 -08:00
Sam Lantinga 082132a70c Fixed binding the D-pad on some Super NES style controllers
Fixed a case where partial trigger pull could be bound to another button

There is a fundamental problem not resolved by this commit:

Some controllers have axes (triggers, pedals, etc.) that don't start at zero, but we're guaranteed that if we get a value that it's correct. For these controllers, the current code works, where we take the first value we get and use that as the zero point and generate axis motion starting from that point on.

Other controllers have digital axes (D-pad) that assume a zero starting point, and the first value we get is the min or max axis value when the D-pad is moved. For these controllers, the current code thinks that the zero point is the axis value after the D-pad motion and this doesn't work.

My hypothesis is that the first class of devices is more common and that we should solve for that, and add an exception to SDL_JoystickAxesCenteredAtZero() as needed for the second class of devices.
2017-01-03 23:39:28 -08:00
Sam Lantinga 45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Philipp Wiesemann e61daa7270 Fixed warning and missing animation delay in testoverlay2 program. 2016-12-30 19:57:50 +01:00
Philipp Wiesemann c2b90f2df8 Fixed compiling of testgamecontroller program with C++. 2016-12-28 20:11:29 +01:00
Philipp Wiesemann de79828b9f Fixed warning about unused variable in controllermap program. 2016-12-28 20:11:12 +01:00
Sam Lantinga 21cb42d79b Make sure we go all the way back (within the XBox controller dead zone) to prevent accidentally binding axes inverted 2016-12-27 09:51:58 -08:00
Sam Lantinga 6d7da0887d Split controller axes into positive and negative sides so each can be bound independently.
Using this a D-Pad can be mapped to a thumbstick and vice versa.
Also added support for inverted axes, improving trigger binding support
2016-12-27 01:39:07 -08:00
Philipp Wiesemann b515b34dbb Fixed hotplug with more than one device in testjoystick program. 2016-12-16 22:58:32 +01:00
Philipp Wiesemann 0a3f9d0cfb Fixed warning about unused variable in controllermap program. 2016-12-16 22:58:16 +01:00
Sam Lantinga 0c5e7a1067 Fixed handling joysticks that send multiple events for a single control, e.g. both a button and axis event for a trigger.
Tested with the 8Bitdo NES30 Pro on Linux
2016-12-15 14:27:22 -08:00
Sam Lantinga 70aa2a5717 Only print out the controller mappings if we're not going to test a controller 2016-12-09 04:17:10 -08:00
Sam Lantinga 68d7be3949 Fixed bug 3508 - variably modified ?SDL_dummy_size? at file scope in test/testatomic.c
Ciro Santilli

GCC 6, Ubuntu 16.10, cd test; ./configure; make

/bin/sh config.status Makefile
config.status: creating Makefile
gcc -o loopwave loopwave.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
gcc -o testatomic testatomic.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
In file included from /usr/include/SDL2/SDL_main.h:25:0,
                 from /usr/include/SDL2/SDL.h:32,
                 from testatomic.c:14:
/usr/include/SDL2/SDL_stdinc.h:261:20: error: variably modified ?SDL_dummy_size? at file scope
        typedef int SDL_dummy_ ## name[(x) * 2 - 1]
                    ^
testatomic.c:106:1: note: in expansion of macro ?SDL_COMPILE_TIME_ASSERT?
 SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
 ^~~~~~~~~~~~~~~~~~~~~~~
Makefile:114: recipe for target 'testatomic' failed
make: *** [testatomic] Error 1

If I remove the line SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */ it works, lazy to figure out the best way to do this.
2016-12-06 00:40:09 -08:00
Sam Lantinga dd5d85a4e7 Added an API to iterate over game controller mappings 2016-11-29 06:36:57 -08:00
Ryan C. Gordon 35430a73f2 cpuinfo: first attempt at SDL_HasNEON() implementation. 2016-11-17 01:15:16 -05:00
Sam Lantinga c406f649b3 Added USB VID/PID information to the SDL test programs 2016-11-10 18:53:50 -08:00
Sam Lantinga 0396af651a Shifting a value by more than its bits isn't defined and has varying behavior depending on compiler and platform 2016-11-06 14:13:28 -08:00
Sam Lantinga 40b571c91e Fixed bug 3468 - _allshr in SDL_stdlib.c is not working properly
Mark Pizzolato

On Windows with Visual Studio, when building SDL as a static library using the x86 (32bit) mode, several intrinsic operations are implemented in code in SDL_stdlib.c.

One of these, _allshr() is not properly implemented and fails for some input.  As a result, some operations on 64bit data elements (long long) don't always work.

I classified this bug as a blocker since things absolutely don't work when the affected code is invoked.  The affected code is only invoked when SDL is compiled in x86 mode on Visual Studio when building a SDL as a static library.  This build environment isn't common, and hence the bug hasn't been noticed previously.

I reopened #2537 and mentioned this problem and provided a fix.  That fix is provided again here along with test code which could be added to some of the SDL test code.  This test code verifies that the x86 intrinsic routines produce the same results as the native x64 instructions which these routines emulate under the Microsoft compiler.  The point of the tests is to make sure that Visual Studio x86 code produces the same results as Visual Studio x64 code.  Some of the arguments (or boundary conditions) may produce different results on other compiler environments, so the tests really shouldn't be run on all compilers.  The test driver only actually exercised code when the compiler defines _MSC_VER, so the driver can generically be invoked without issue.
2016-11-06 10:01:08 -08:00
Sam Lantinga 5298830945 Fixed bug 3480 - minor update to NACL common.js
Sylvain

All latest official NACL examples have a slightly different 'common.js' file. It seems it has been updated in the meantime to fix a bug.
2016-11-05 01:48:14 -07:00
Philipp Wiesemann 98d188f5de Added call to SDL_HasAVX2() in platform test program. 2016-10-30 21:01:46 +01:00