* Implement the basics of controller auto mapping. From testing doesn't currenlty work.
Opening the controller requires the device index, but it is only known and guaranteed
at boot time or when a controller is connected.
* Use the SDL_INIT_GAMECONTROLLER flag to initialize the controller
subsystem. It automatically initializes the joystick subsystem too,
so SDL_INIT_JOYSTICK is not needed.
* Implement the SDLGameController class to handle open game controllers.
Based on the SDLJoystick implementation.
* Address review comments
* Changes SDLJoystick and SDLGameController to use a custom default
constructible destructor, to improve readability. The only deleters
used previously were SDL_JoystickClose and SDL_GameControllerClose,
respectively, plus null lambdas. Given that both SDL functions
accept null pointers with just an early return, this should be
functionally the same.
with just an early return
* warn the user when a controller mapping is not found
* Get axis direction and threshold from SDL_ExtendedGameControllerBind
* Reject analog bind if it's not axis, for the couple of examples present in SDL2.0.10's db.
Also add SDL_CONTROLLER_BINDTYPE_NONE for the button bind switch, with a better log message.
* sdl_impl.cpp: Log the error returned by SDL_GetError upon failure to open joystick
* sdl: only use extended binding on SDL2.0.6 and up
* sdl_impl.cpp: minor changes
* game_list: Eliminate redundant argument copies
Several functions can be taken by const reference to avoid copies
Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
* game_list: Make game list function naming consistent
Makes the naming consistent with the rest of the functions that are
present.
Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
Co-authored-by: Lioncash <mathew1800@gmail.com>
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
The feature wasn't working when the "single window mode" was off.
Changed the cursor setting to only affect the render_window and
moved to a signal/slot model to show the mouse.
* kernel/thread: Change owner_process to std::weak_ptr
Previously this leaked almost all kernel objects. In short, Threads own Processes which own HandleTables which own maps of Objects which include Threads.
Changing this to weak_ptr at least got the camera interfaces to destruct properly. Did not really check the other objects though, and I think there are probably more leaks.
* hle/kernel: Lock certain objects while deserializing
When deserializing other kernel objects, these objects (`MemoryRegion`s and `VMManager`s) can possibly get modified. To avoid inconsistent state caused by destructor side-effects, we may as well simply lock them until loading is fully completed.
* Fix silly typo
Somehow this didn't break?!
* Enable 'Accurate Multiplication' by default.
* Move 'Disk Shader Cache' to the 'Advanced' tab
* Prevent enabling 'Disk Shader Cache' when 'Enable Hardware Shader' or 'Accurate Multiplication' is disabled.
* Do not load 'Disk Shader Cache' when 'Accurate Multiplication' is disabled.
* Add a tooltip for 'Disk Shader Cache'.
* Forward declare ui and use unique_ptr
* ConfigureEnhancements: use unique_ptr for ui
* Use make_unique instead of new where applicable
* Move some of the ui includes that already used unique_ptr
* main.cpp: also make use of make_unique on Config
* Address review comments
The list of points is returned by const reference, so we don't need to
make a copy of every element in the list.
Co-authored-by: Lioncash <mathew1800@gmail.com>
The settings.h file doesn't actually need all of the definitions
on cam.h, only some of the enums. They can, therefore, be separated
into another file, which is included by settings.h instead.
The other changes are fixing files that included settings.h and
depended on indirect includes from includes of includes of cam.h
* Change "Toggle Speed Limit" to toggle between 100% and a custom value
This will change the shortcut for "Toggle Speed Limit" to make it swap between 100% and the value of "Limit Speed Percent" in the config. Old functionality is still there, but renamed to "Unthrottle".
* Complete reimplementation of the function
* Fix something that didn't get saved correctly
* Fix missing indentation
* Rewrite to keep only a single QSpinBox
* Second rewrite
* set Unthrottled to 0 in the Qspinbox
* Hotkey for Unthrottle
* minor improvements to the design
* Apply suggestions from code review
Co-authored-by: Ben <bene_thomas@web.de>
* Default slider values
* clang-format fixes
* Prevent the speed slider from changing size
...when an element in its row has variable width.
* Change "Game Speed" to "Emulation Speed"
* Apply suggestions from code review
`game_speed` to` emulation_speed`
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
* Fix for QSliders
* Revert "Prevent the speed slider from changing size"
This reverts commit ddaca20044.
* clang-format
...doesn't seem to stick to a choice
* Fix 2 for QSliders
Co-authored-by: B3n30 <benediktthomas@gmail.com>
Co-authored-by: Ben <bene_thomas@web.de>
Co-authored-by: Valentin Vanelslande <vvanelslandedev@gmail.com>
I'm not sure why we decided to have a boolean here, but apparently that wasn't the correct behaviour. According to HW tests, the Software Keyboard simply displays the default text when the button text provided is empty (**not necessarily all zero**). For example, if you set a text for one of the buttons and leave others empty, the button you set will have your text, while others will have their default texts. Removed the boolean and updated frontend code to make it correct.
* GUI: Deadzone controls for sdl engine at configuration input
Co-Authored-By: CJ Bok <cjbok@users.noreply.github.com>
* configure_input: Use slider to edit modifier scale
Co-Authored-By: Kewlan <kewlan@users.noreply.github.com>
* Address minor review comment
Co-Authored-By: Kewlan <kewlan@users.noreply.github.com>
Co-authored-by: CJ Bok <cjbok@users.noreply.github.com>
Co-authored-by: Kewlan <kewlan@users.noreply.github.com>
* swkbd: Fix a bug where clicking Cancel hangs the game
The text is validated in `Finalize`. If the validation fails, an error is returned and the applet is not actually finalized. This can result in hangs.
This is usually not a problem as the frontend is expected to validate the text passed to `Finalize`. However, when the user clicked on `Cancel`, the text is ignored and the frontend won't do any validation. Therefore, we should skip the validation here as well.
Also fixed a potential data race. All these functions should now be called on the same thread
* Address review comments
Renamed the fields
Remove close button
* Add and implement option to hide mouse on iniactivity
+ clang format
* Set mouse hide timeout as a constant
* Address review comments, decrease mouse inactivity timeout to 2500ms
* Hide mouse: fix menubar bugs
squashable
* Hide mouse: ensure status bar has the default pointer
* video_core/renderer_opengl: Move SurfaceParams into its own file
Some of its enums are needed outside of the rasterizer cache
and trying to use it caused circular dependencies.
* video_core/renderer_opengl: Overhaul the texture filter framework
This should make it less intrusive.
Now texture filtering doesn't have any mutable global state.
The texture filters now always upscale to the internal rendering resolution.
This simplifies the logic in UploadGLTexture and it simply takes the role of BlitTextures at the end of the function.
This also prevent extra blitting required when uploading to a framebuffer surface with a mismatched size.
* video_core/renderer_opengl: Use generated mipmaps for filtered textures
The filtered guest mipmaps often looked terrible.
* core/settings: Remove texture filter factor
* sdl/config: Remove texture filter factor
* qt/config: Remove texture filter factor