Alex Szpakowski
fbabf9bb94
iOS/tvOS: fix support for SDL_GameControllerGetButton(controller, GUIDE) with MFi controllers (thanks Caleb!)
...
Fixes bug #4463 .
2019-01-31 19:52:47 -04:00
Sylvain Becker
7f13432340
Add SDL_MEMALIGNED flag for SDL_Surface using aligned memory.
...
If an SDL_Surface has an aligned memory pointers, it should be freed
using SDL_SIMDFree() (will be used by SDL_ttf).
2019-01-31 11:45:31 +01:00
Sylvain Becker
8bf1215e1b
Add fast paths in BlitNtoNKey
...
All following conversions are faster (with colorkey, but no blending).
(ratio isn't very accurate)
ABGR8888 -> BGR888 : faster x9 (2699035 -> 297425)
ARGB8888 -> RGB888 : faster x8 (2659266 -> 296137)
BGR24 -> BGR24 : faster x5 (2232482 -> 445897)
BGR24 -> RGB24 : faster x4 (2150023 -> 448576)
BGR888 -> ABGR8888 : faster x8 (2649957 -> 307595)
BGRA8888 -> BGRX8888 : faster x9 (2696041 -> 297596)
BGRX8888 -> BGRA8888 : faster x8 (2662011 -> 299463)
BGRX8888 -> BGRX8888 : faster x9 (2733346 -> 295045)
RGB24 -> BGR24 : faster x4 (2154551 -> 485262)
RGB24 -> RGB24 : faster x4 (2149878 -> 484870)
RGB888 -> ARGB8888 : faster x8 (2762877 -> 324946)
RGBA8888 -> RGBX8888 : faster x8 (2657855 -> 297753)
RGBX8888 -> RGBA8888 : faster x8 (2661360 -> 296655)
RGBX8888 -> RGBX8888 : faster x8 (2649287 -> 308268)
2019-01-30 22:50:20 +01:00
Sylvain Becker
7bf5557a9b
Fix blit with blending (Blit_A) to RGB332 which has no palette
2019-01-30 17:16:08 +01:00
Sylvain Becker
d2bf7b1eb7
Fixed failing SDL_ConvertSurface() when blit has failed.
...
Some blit combination are not supported (eg ARGB8888 -> SDL_PIXELFORMAT_INDEX1MSB)
So prevent SDL_ConvertSurface from creating a broken surface, which cannot be blitted
2019-01-30 16:36:47 +01:00
Sylvain Becker
0842ea0534
Add explicit unsigned int and char types in (for bug 4290)
2019-01-30 15:31:07 +01:00
Sylvain Becker
24de164055
Fixed bug 4290 - add fastpaths for format conversion in BlitNtoN
...
All following conversion are faster (no colorkey, no blending).
(ratio isn't very accurate)
ABGR8888 -> ARGB8888 : faster x6 (2655837 -> 416607)
ABGR8888 -> BGR24 : faster x7 (2470117 -> 325693)
ABGR8888 -> RGB24 : faster x7 (2478107 -> 335445)
ABGR8888 -> RGB888 : faster x9 (3178524 -> 333859)
ARGB8888 -> ABGR8888 : faster x6 (2648366 -> 406977)
ARGB8888 -> BGR24 : faster x7 (2474978 -> 327819)
ARGB8888 -> BGR888 : faster x9 (3189072 -> 326710)
ARGB8888 -> RGB24 : faster x7 (2473689 -> 324729)
BGR24 -> ABGR8888 : faster x6 (2268763 -> 359946)
BGR24 -> ARGB8888 : faster x6 (2306393 -> 359213)
BGR24 -> BGR888 : faster x6 (2231141 -> 324195)
BGR24 -> RGB24 : faster x4 (1557835 -> 322033)
BGR24 -> RGB888 : faster x6 (2229854 -> 323849)
BGR888 -> ARGB8888 : faster x8 (3215202 -> 363137)
BGR888 -> BGR24 : faster x7 (2474775 -> 347916)
BGR888 -> RGB24 : faster x7 (2532783 -> 327354)
BGR888 -> RGB888 : faster x9 (3134634 -> 344987)
RGB24 -> ABGR8888 : faster x6 (2229486 -> 358919)
RGB24 -> ARGB8888 : faster x6 (2271587 -> 358521)
RGB24 -> BGR24 : faster x4 (1530913 -> 321149)
RGB24 -> BGR888 : faster x6 (2227284 -> 327453)
RGB24 -> RGB888 : faster x6 (2227125 -> 329061)
RGB888 -> ABGR8888 : faster x8 (3163292 -> 362445)
RGB888 -> BGR24 : faster x7 (2469489 -> 327127)
RGB888 -> BGR888 : faster x9 (3190526 -> 326022)
RGB888 -> RGB24 : faster x7 (2479084 -> 324982)
2019-01-30 15:23:33 +01:00
Alon Zakai
7a03352caf
Emscripten: No need for Runtime. for dynCalls
2019-01-29 12:21:22 +00:00
Alon Zakai
856123054a
Emscripten: Avoid SDL2 in JS global scope
...
After this fix, closure works with the LLVM wasm backend on SDL2.
2019-01-29 12:19:36 +00:00
Charlie Birks
b7ee95c93c
Emscripten: remove GLES_DeleteContext implementation
...
It was calling glClear without a context. The issue it was trying to
solve was actually that after destroying a window and creating a new one
, the contents of the old window were preserved. This no longer happens
since we resize the window to nothing on destroy.
2019-01-29 12:19:32 +00:00
Charlie Birks
2c7a6bb5a5
Emscripten: resize canvas to 0x0 in DestroyWindow
...
Closest we can get to actually destroying it
2019-01-29 12:19:23 +00:00
Charlie Birks
90c00ff7e5
Emscripten: don't zero the display mode before adding it
2019-01-29 12:19:06 +00:00
Charlie Birks
04d9fd58ed
Emscripten: use UTF8ToString instead of Pointer_stringify
2019-01-29 12:19:03 +00:00
Charlie Birks
3cc0c3510f
Emscripten: call emscripten_sample_gamepad_data
2019-01-29 12:19:00 +00:00
Charlie Birks
0ba2615a72
Emscripten: Use set_canvas_element_size
...
This will be needed for supporting multiple canvases and set_canvas_size
is deprecated anyway.
2019-01-29 12:18:56 +00:00
kichikuou
c6458411cd
Emscripten: Do not consume mouseup event outside of the canvas
2019-01-29 12:14:54 +00:00
Sylvain Beucler
7100810424
Emscripten: fix duplicate mousebuttonup/mousebuttondown events when touch events are disabled
2019-01-29 12:14:44 +00:00
Charlie Birks
74c7631bd4
Emscripten: use a fake size for external sizing check
...
The check would fail if the canvas happened to be the correct size
already. (#66 , mentioned in #58 )
2019-01-29 12:14:41 +00:00
Charlie Birks
50b7f5fe78
Emscripten: reset fullscreen_window when leaving fullscreen
...
If the browser left fullscreen mode by the user pressing ESC, the next
call to SDL_SetWindowFullscreen(1) will fail as it thinks the window is
already fullscreen. (#65 )
2019-01-29 12:14:33 +00:00
Sylvain Becker
bf51d0cd3f
Fixed bug 4024 - GameController error "Unexpected controller element"
...
If mapping string is terminated with a comma, there is no more values to parse.
2019-01-21 23:41:43 +01:00
Sylvain Becker
a5b10978a6
Revert SDL_gamecontrollerdb.h and sort_controllers.py from bug 4024
2019-01-21 20:49:08 +01:00
Sylvain Becker
5c25e0c158
Fixed bug 3827 - issue with MapRGB, palette and colorkey
...
For palette surface, SDL_MapRGB() returns different values whether colorkey is
set or not.
2019-01-21 19:53:06 +01:00
Sylvain Becker
fc8c0ac5b0
Fixed bug 3827 - issue with MapRGB, palette and colorkey
...
For a palettized surface, prevent SDL_MapRGB() value to change whether colorkey is set or not.
2019-01-21 18:45:15 +01:00
Sam Lantinga
91cad4e8ea
Fixed compiler warning
2019-01-20 13:53:16 -08:00
Sylvain Becker
a0d2344c8c
Android: some typos
2019-01-20 22:17:41 +01:00
Sylvain Becker
d3dec69065
Android: automatically attach to the JVM non-SDL threads
...
It allows a thread created with pthread_create() to access the JNI Env
2019-01-20 22:11:56 +01:00
Sam Lantinga
751d99f1fe
Fixed compiler warning on Android
2019-01-20 12:02:12 -08:00
Sylvain Becker
4deb7ba850
Fixed bug 3657 - Color-key doesn't work when an alpha channel is present
...
When surface format is the same as renderer format, it still needs an
intermediate conversion to transform colorkey to alpha.
2019-01-19 16:47:43 +01:00
Sylvain Becker
e6cf4a7523
Android: remove duplicate code in SDLGenericMotionListener_API24
...
and use parent method
2019-01-17 16:30:19 +01:00
Sylvain Becker
b331b1db3e
Android: remove another hard-coded constant for Samsung DeX (no op!)
2019-01-17 14:59:46 +01:00
Sylvain Becker
2e326cb656
Android: minor change in the evaluation of SOURCE_CLASS_JOYSTICK (no op!)
...
InputDevice.SOURCE_CLASS_* are one bit
More readable to check that the source has this class_joystick set,
compared to the other statements, where the source is gamepad or dpad.
(Clean-up from bug 3958)
2019-01-17 13:42:13 +01:00
Sylvain Becker
d446c52322
Android: remove hard-coded constant for Samsung DeX (no op!)
...
12290 = 0x3002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
SOURCE_MOUSE Constant Value: 8194 (0x00002002)
SOURCE_TOUCHSCREEN Constant Value: 4098 (0x00001002)
SOURCE_CLASS_POINTER Constant Value: 2 (0x00000002)
https://developer.android.com/reference/android/view/InputDevice.html
2019-01-17 12:25:19 +01:00
Sylvain Becker
39706e04b8
Android: prevent concurrency in Android_SetScreenResolution() when exiting
...
by checking Android_Window validity
- SDLThread: user application is exiting:
SDL_VideoQuit() and clearing SDL_GetVideoDevice()
- ActivityThread is changing orientation/size
surfaceChanged() > Android_SetScreenResolution() > SDL_GetVideoDevice()
- Separate function into Android_SetScreenResolution() and Android_SendResize(),
formating, and mark Android_DeviceWidth/Heigh as static
2019-01-17 11:05:05 +01:00
Sylvain Becker
830f87f3c5
Android: also update APP_PLATFORM to android-16 in Application.mk
...
https://hg.libsdl.org/SDL/rev/8db358c7a09a
https://hg.libsdl.org/SDL/rev/787e86a461f5
2019-01-17 09:28:30 +01:00
Sylvain Becker
1f0f29edc1
Fixed bug 4024 - remove trailing comma of Controller mappings
...
because it reports an error "Unexpected controller element"
2019-01-16 14:03:35 +01:00
Sylvain Becker
dbe91b2bcc
Android: add mutex protection to onNativeOrientationChanged
...
it's possible receive try to send an event between the check first for SDL_GetVideoDevice
and SDL_VideoQuit is called
2019-01-16 10:48:28 +01:00
Sylvain Becker
2322ef6e6b
Android: move static variable isPaused/isPausing to SDL_VideoData structure
...
- remove unneed check to Android_Window->driverdata
- add window check into context_backup/restore
2019-01-16 10:31:51 +01:00
Sylvain Becker
089bdbc56d
Android: merge SDLJoystickHandler_API12 and SDLJoystickHandler_API16
2019-01-16 09:22:20 +01:00
Sylvain Becker
3b3d2b97ca
Android: remove trailing spaces
2019-01-16 09:12:31 +01:00
Sylvain Becker
0c6417e562
Android: remove old code after Android-16 has been set as minimum requirement
2019-01-16 09:11:13 +01:00
Ryan C. Gordon
f20aabe611
evdev: don't debug log on a BTN_TOUCH from a non-touch device.
2019-01-14 19:43:25 -05:00
Ryan C. Gordon
a9d310b456
evdev: Add touchscreen mouse emulation and pressure support (thanks, Zach!).
...
This also solves reports of this log message:
"INFO: The key you just pressed is not recognized by SDL. To help get this
fixed, please report this to the SDL forums/mailing list
<https://discourse.libsdl.org/ > EVDEV KeyCode 330"
(EVDEV KeyCode 330 is BTN_TOUCH.)
Fixes Bugzilla #4147 .
2019-01-14 19:36:54 -05:00
Sylvain Becker
91f11c320e
Android: create Pause/ResumeSem semaphore at higher level than CreateWindow()
...
- If you call onPause() before CreateWindow(), SDLThread will run in infinite loop in background.
- If you call onPause() between a DestroyWindow() and a new CreateWindow(), semaphores are invalids.
SDLActivity.java: the first resume() starts the SDLThread, don't call
nativeResume() as it would post ResumeSem. And the first pause would
automatically be resumed.
2019-01-14 23:33:48 +01:00
Sylvain Becker
b3f07fa516
Android/openslES: fix Pause/ResumeDevices when openslES is not used
2019-01-14 22:56:57 +01:00
Sylvain Becker
4408f8a713
Android: minor, remove static attributes, move mIsSurfaceReady to SDLSurface
2019-01-14 21:34:12 +01:00
Sylvain Becker
5220445fe4
Android/openslES: check for non NULL variable, some intialization.
...
use the previous naming
2019-01-14 14:36:13 +01:00
Sylvain Becker
2aed23fd35
Android/openslES: start playing, after creating ressources
2019-01-14 14:31:06 +01:00
Sylvain Becker
17dcd9a61c
Android/openslES: set audio in paused/resumed state for Android event loop
...
And also in "stopped" state before closing the device.
2019-01-14 12:33:29 +01:00
Sylvain Becker
86070ac5ce
Android/openslES: move a few static variables to SDL_PrivateAudioData structure
2019-01-14 10:58:57 +01:00
Sylvain Becker
84ae64fd44
Android/openslES: register and use CloseDevice function.
2019-01-14 10:16:26 +01:00