The default cursor was being leaked on destruction as it is not in the cursor list, and subsequently SDL_DestroyCursor() wouldn't call the free function for it.
Some of the SDL_Convert_F32_to_*_SSE2 do not explicitly clamp the input,
but instead rely on saturating casts.
Inputs very far outside the valid [-1.0, 1.0] range may produce
an incorrect result, but I believe that is an acceptable trade-off.
The video core applies pending minimized/maximized/restored state to windows when they transition from the hidden to shown state, so no need to handle it internally anymore.
The 'orderOut' method has no effect on miniaturized windows, so 'close' must be used to remove the window from the desktop, dock, and window list in this case.
SDL holds a strong reference to the window (oneShot/releasedWhenClosed are 'NO'), and calling 'close' doesn't send a 'windowShouldClose' message, so it's safe to use for this purpose as nothing is implicitly released.
SDL considers a hidden window to be unmapped and blocks or defers certain operations until the window is shown again, however, the X11 and Cocoa backends would set the hidden flag when the window was minimized, which blocked the functionality of SDL_RestoreWindow().
Specify that a window with the hidden flag set is unmapped and not visible on the desktop or in the dock/taskbar without a call to SDL_ShowWindow(), and don't set the hidden flag in the X11 and Cocoa backends when the window is in the minimized state, but still mapped to the desktop.
Previously, `open()` was used with the default option of `newline=None`,
which means that “any '\n' characters written are translated to the
system default line separator”. Now, `xxd.py` always writes `\n` line
endings. This eliminates the need for the .gitattributes file.
On Windows, cmake/xxd.py generates text files with \r\n eol.
Because the in-repo files were stored with \n, and git considered
them as binary files, they were always considered out of date.
An alternative fix could be to let xxd.py generate binary files with \n.
But a .gitattributes file should also avoid people accidentally
converting line endings.
CMake's SDL_build_config.h force disables HAVE_STDIO_H when buiding
winrt in non-libc mode.
Becase CreateFileEx is not available in UWP mode, use CreateFile2
instead.
This usually manifests as a clicking sound, because it often produces
a value outside the range -1.0f to 1.0f based on whatever random data
is past the buffer, which later stages of audio conversion will clamp
to a maximum value for the audio format. Since this tends to be a single
bad sample generated at the end of the resampled buffer, it sounds like
a repeating click in streamed data.
I'd like a more efficient means to clamp this value to not overflow the
buffer, but this puts out the immediate fire.
This happens in the KMSDRM driver, once after video init, setting a blank default cursor, and once when creating a window when the KMSDRM mouse is initialized.
Also fixed a memory leak freeing the default cursor at shutdown
testcontroller expects to be able to call SDL_GetGamepadStringForButton() and find that name in the binding string
We can revisit this later if it becomes important to use new names in bindings. @smcv
The sequence order of the four paddles is not obvious, with SDL and Xbox
controllers swapping the order of P2 and P3 relative to each other.
If we group them into left and right, then it becomes more obvious.
Signed-off-by: Simon McVittie <smcv@collabora.com>
The ability to pass a pathlib.Path to open() was new in Python 3.6,
and the oldest branch of the Steam Runtime only has Python 3.5 available.
Even without considering retrocomputing, using the Path.open method is
more consistent with how we read the input 2 lines earlier.
Signed-off-by: Simon McVittie <smcv@collabora.com>