Since SDL 2.0.14, KMOD_GUI is no longer a macro but an enum value:
https://hg.libsdl.org/SDL/rev/15a0bc9612e9
So this code broke as the enum value doesn't satisfy `defined()`.
This bug was responsible for audio on Windows not working without
forcefully setting the audio driver to DirectSound.
The problem was that WASAPI (or whatever API SDL2 was choosing)
defaults to an incompatible audio specification (possibly F32 sample
format - I didn't check).
Despite the `audio` struct requesting the S16 sample format, SDL2 was
granted permission to use whatever format it preferred because it was
given the `SDL_AUDIO_ALLOW_ANY_CHANGE` flag.
To fix this, I've removed that flag, effectively forcing SDL2 to use
the audio specification VBA-M requires.
Add to the loud notes at the top of the issue template and README.md
added in dfa97d8a to test the nightly to also do a factory reset.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Followup on 98b2fb6e.
To make a one element of empty string list in cmake, you have to set the
variable to `";"`.
If it is set to `""`, a subsequent `list(APPEND ...)` will consider the
variable unset.
With this fix, `/usr/bin/wx-config` is tried first on Gentoo, as was
intended in 98b2fb6e.
The rationale for this is that on Gentoo, app-eselect/eselect-wxwidgets
links `/usr/bin/wx-config` to the user's preferred version of wxWidgets,
while on other distributions such as Arch, we want to check for the 3.x
gtk3 variant explicitly first.
Also add a modeline to `VbamFunctions.cmake`.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add a note at the top of the issue template asking users to test the
nightly or master before reporting an issue.
Add a note to the top of the README.md as well.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Remove the `find_package(unofficial-gettext ...)` invocation for vcpkg
as it is no longer required, the normal `find_package(Gettext ...)`
mechanism works.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Some allocators return a non-null pointer when calling *alloc with
zero size, that will segfault upon access. Check for the size parameter
before allocating anything to ensure that the breakpoint and trace
fields will stay null when size >> 3 or size >> 1 is zero.
This is a major refactor of the wxSDLJoy class.
* Move handling of SDL objects creation and destruction to its own
class. This simplifies the lifespan of SDL-related objects.
* Re-add handling of HATs. This is necessary for DirectInput
controllers.
* Rename the public API for wxSDLJoy to be clearer.
* Add documentation for every class related to wxSDLJoy.
Update and rewrite the Windows Native Development Environment section of
the developer manual.
Update list of Chocolatey packages and give Chocolatey usage notes.
Update terminal setup instructions.
Add sample PowerShell `$profile` and `.vimrc`.
Rewrite and streamline the short PowerShell tutorial.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Default to latest, which is bionic, for earlier repositories, match all
intermediate release code names.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
I'm not sure what purpose this currently serves but I know that it
breaks the build when CMAKE_PREFIX_PATH is set to something nontrivial.
Stop doing that.
Adjust compiler flags to use `-std=gnu++17` for gcc/clang instead of
`-std=gnu++11` and `/std:c++17` for msvc.
Remove Ubuntu trusty job from travis (it's too old.)
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Stop setting the 4 plane data pointers in recording audio frames to the
sample stream. This confuses the converter and makes it write the right
channel to both channels.
- Fix#723.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Prefer the `wx-config` from PATH on Gentoo, because that points to the
eselected wxWidgets build.
This is already done for Win32 builds.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Hopefully fix various bugs caused by not differentiating between SDL
joystick_index and SDL_JoystickID (the joystick instance id.)
On controller disconnect, disconnect and reconnect all configured
devices because the SDL joystick index may change, and this will update
the mapping.
Also fix creating a state entry for the configured joystick even when
it's not connected, add the controller/joystick name to the connected
message and increase the poll time from 10ms to 25ms.
- Fix#718.
- Fix#726.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Assume an archlinux-like distribution based on the existence of
`/usr/bin/pacman` as the last test.
- Fix#710.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Start the joystick polling timer on pause and stop it on resume, so that
accelerators bound to joystick events are still processed.
Followup on def5d3e4.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Followup on 7031c1d1, which for some reason removed the calls to stop
the timer when a game is loaded and restart it when it is unloaded.
Add the calls back.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Remove the `evthandler` member and `Attach()` method from `wxSDLJoy`.
Add the `GetJoyEventHandler()` method to `MainFrame`, which returns the
window in focus, or the panel if the option for joystick background
input is enabled.
Remove the handler parameter in `wxSDLJoy::CreateAndSendEvent()` and
call `wxGetApp().frame->GetJoyEventHandler()` to get the handler.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>