The present ini variable is from vbam 1.x and is behaviourally backwards where setting disablemmx to true actually enables mmx, 2.x builds should not be using the ini from 1.x for various reasons.
Previously, this function returned -1 or "true" but wxWidgets
defines constants for the returned values for FilterEvent()
overrides so use these instead.
Remove keychain unlock for codesigning, that doesn't work anymore, the
key has to be in the system keychain.
Use `zip -9yr` instead of `zip -9r` to make the .zip file of the .app so
that symlinks are preserved, this was creating a corrupted .app.
Don't build zip in the mac builder, use the system zip instead.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
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.
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.
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.
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>
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>
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>
- Joystick background input.
Set as enabled by default.
- Linux: `X11` and `Wayland` done.
1. `Wayland` does not allow to listen for keypresses for security reasons.
Discussion here: https://github.com/albertlauncher/albert/issues/309
2. For `X11` we can use `XQueryKeymap` to check keyboard state.
- Windows: done.
We use `GetAsyncKeyState` most significant bit to check if the key
is being pressed.
Followup on ff03bcc1.
Running wxrc from the build directory turned out to be unnecessary,
because the dlls were not there anyway, and we added them to the PATH.
And using absolute paths for the xrc sources puts them into the gettext
pot comments which is not what we want.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This adds the command-line option `-c` or `--config` to specify a custom
configuration file.
Co-authored-by: Fabrice de Gans-Riberi <steelskin+github@gmail.com>
Do not link `SDL2main` on any WIN32, not just MSVC.
Define `WIN32_CONSOLE_APP` for Debug mode builds on any WIN32, not just
MSVC.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>