Commit Graph

129 Commits

Author SHA1 Message Date
libretroadmin
5f94f36204 Explicit typecasts to bool 2023-08-16 17:10:59 +02:00
libretroadmin
aeff636a0f Minor cleanups to config_file.c 2023-07-17 09:45:52 +02:00
nfore
9ca5c5e623 Revive/rewrite Keyboard Overlay and OSK Toggle
Add keyboard overlay preset, keyboard submenu, and osk_toggle hotkey. Use overlay caching for osk_toggle.

For now, keyboard menu has only preset path, auto-scale toggle, and opacity.

Related fixes:
- input_keyboard_event: Don't check hotkey binds when device is RETRO_DEVICE_POINTER
- Add input_keymaps_translate_rk_to_ascii() for correct character input to input_keyboard_event
- input_overlay_poll: Delay clearing INPUT_OVERLAY_BLOCKED flag until there is no overlay input (Avoids stray input after osk_toggle)
- Send keyboard events for modifiers before other keys (for correct modifier+key input if hitboxes overlap)
2023-07-09 04:42:49 +02:00
nfore
8a81d39437 Overlay Caching
Adds overlay_cache_ptr to keep a disabled overlay in memory when it's expected to be shown again.

Most input_overlay_deinit calls are replaced with input_overlay_unload, which caches the overlay unless initing/deiniting core or disabling overlays.

Loading a cached overlay is done as a swap, intended for osk_toggle.

Related updates:
- Fewer parameters for the overlay loading task. Use current settings when enabling an overlay
- Add input_overlay_check_mouse_cursor() to preserve show/hide mouse behavior
- Don't apply input_overlay_show_mouse_cursor in windowed mode (controlled by mouse grab only)
- Remove some dead code
2023-07-09 04:42:49 +02:00
nfore
f1cdd7a807 Fix overlay block_x_separation regression
block_x_separation was being ignored by auto-scale
2023-07-08 19:08:59 +02:00
nfore
dd18152921 Fix overlay reach_x/y regression 2023-07-01 20:04:07 +02:00
libretroadmin
e8242253a7 Reduce strlcat calls where possible 2023-06-19 06:00:10 +02:00
libretroadmin
0517354181 * replace more strlcat calls with strlcpy
* Get rid of unnecessary string copies by clever usage of strlcpy
* Get rid of unnecessary temp variables when not needed
2023-06-18 22:37:01 +02:00
libretroadmin
01cd40b1fc Increase conf_key_base size a bit 2023-04-28 20:21:08 +02:00
libretroadmin
cce75e274f (task_overlay) Cut down on snprintfs 2023-04-28 20:18:53 +02:00
libretroadmin
07eddd7229 Cleanups 2023-04-23 16:09:24 +02:00
Valentin
b0b5a40d44
add overlay parameter to control x/y separation in auto-scale mode (#15106) 2023-03-31 01:33:39 +01:00
libretroadmin
04f510d503 Cleanup header includes 2022-12-05 15:10:19 +01:00
neil4
3b0db75782
Overlay cleanups; replace bools with flags (#14661) 2022-11-22 18:29:11 +01:00
neil4
3de186e374
Overlays: Ignore hitboxes with zero area (#14619)
I.e. Set 'reach_x' or 'reach_y' to zero to ensure no hitbox math is done

nits
2022-11-13 10:46:41 +01:00
neil4
b47fb0b807
Overlays: Add 'reach' and 'exclusive' for hitboxes (#14591)
Allows stretching hitboxes and handling their overlap

reach_up, reach_down, reach_left, reach_right:
- Stretches in one direction:
reach_x, reach_y
- Stretches symmetrically

exclusive:
- If true, blocks input from overlapped hitboxes
range_mod_exclusive:
- Similar, but only applies when this hitbox is extended by range_mod
- After range_mod takes effect, has priority over 'exclusive'

E.g. This creates a D-Pad area and extends its hitbox left & right 50%, up 15%, and down 30%. Then applies range_mod_exclusive:
overlay0_desc0 = "dpad_area,0.15,0.57,rect,0.166228,0.295516"
overlay0_desc0_reach_x = 1.5
overlay0_desc0_reach_up = 1.15
overlay0_desc0_reach_down = 1.3
overlay0_desc0_range_mod = 2.0
overlay0_desc0_range_mod_exclusive = true
2022-11-05 21:32:22 +01:00
neil4
2de52baf74
Overlays: Add eightway area types (#14565)
- New descriptors: 'dpad_area' and 'abxy_area'
- Each has a diagonal sensitivity setting, 100% being 8-way symmetry
- Buttons can be redefined in the cfg file

E.g. This would create a d-pad area, then redefine it to use analog directions:
overlay0_desc0 = "dpad_area,0.85,0.57,rect,0.166228,0.295516"
overlay0_desc0_up = "r_y_minus"
overlay0_desc0_down = "r_y_plus"
overlay0_desc0_left = "r_x_minus"
overlay0_desc0_right = "r_x_plus"
2022-10-30 06:31:27 +01:00
neil4
1dd165a3bf
Fix overlay next_index for unnamed targets (#14562) 2022-10-29 16:33:34 +02:00
libretroadmin
8ac1a36259 Don't do NULL termination on strings when passing to strlcpy and/or
a file_path function that calls strlcpy under the hood
2022-07-26 07:01:10 +02:00
Mark W. Kidd
b17dd28ff2 consolidate and comment input_remapping.h 2021-07-06 16:13:43 -04:00
twinaphex
d07043fe26 Reduce size of local char variables 2021-04-11 19:28:59 +02:00
twinaphex
357b7d68f6 (libretro-common) Rename rhash to lrc_hash
(rcheevos) Rename rhash to rc_hash
2020-12-28 19:55:54 +01:00
jdgleaver
8a5ebbf24d Add option to scale overlays automatically (with aspect ratio correction) 2020-09-17 17:23:07 +01:00
jdgleaver
b8ea4fd54e Overlay configuration improvements 2020-09-08 13:37:51 +01:00
Autechre
df245d4917
Merge pull request #11239 from jdgleaver/overlay-gamepad-hide
Add option to hide overlays when a gamepad is connected (Note: Restricted functionality on Android)
2020-08-26 20:23:47 +02:00
twinaphex
fe5307c4ac Use string_split_noalloc instead of string_split 2020-08-26 12:54:51 +02:00
jdgleaver
cc2e098dab Add option to hide overlays when a gamepad is connected (Note: Restricted functionality on Android) 2020-08-25 11:12:37 +01:00
twinaphex
87c0fb6323 Struct reordering 2020-08-14 18:58:09 +02:00
parport0
a4590acde9 Add options for moving the on-screen overlay 2020-06-11 15:39:23 +03:00
twinaphex
38135c505b Rearrange struct members based on size 2020-03-12 06:59:07 +01:00
jdgleaver
1df3e20bdd Add option to automatically rotate overlays 2019-10-04 12:15:57 +01:00
twinaphex
41a2fabb4e Create config_file_new_from_path_to_string 2019-07-18 12:03:50 +02:00
twinaphex
35a3d4ba73 (task_overlay) Use config_file_from_string 2019-07-16 19:32:27 +02:00
twinaphex
ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +02:00
twinaphex
bf6e580435 (tasks) Get rid of dependencies 2019-05-22 05:13:01 +02:00
twinaphex
bc2bdd5734 config_file_read not needed anymore 2019-04-30 13:37:10 +02:00
twinaphex
955a149ce9 Use config_file_read where we can assume we are reading a file 2019-04-22 01:56:24 +02:00
natinusala
c20ab3864d First version of menu widgets (gl only) 2019-02-06 20:48:24 +01:00
twinaphex
6761ec471d Silence some Coverity warnings 2018-04-12 21:39:31 +02:00
twinaphex
3fe6ecbce7 More static analyzer warning fixes 2018-03-29 14:19:24 +02:00
twinaphex
fae9223641 Remove hashes from task_overlay 2018-02-25 13:03:54 +01:00
David Walters
adffa5fc4c Fixes for overlay buttons 2017-12-17 12:36:18 +00:00
gblues
6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex
e16371b8a5 Merge input_config.c and input_driver.c 2017-08-31 02:25:04 +02:00
twinaphex
6b638cae8b prevent uninitialized variable 2017-05-31 02:21:43 +02:00
twinaphex
80d9d1f143 Rewrite task_queue 2017-05-14 20:43:48 +02:00
twinaphex
484fff5e28 Cleanups 2017-05-13 22:30:45 +02:00
twinaphex
558cb64438 Don't grab settings pointer during task_overlay_handler 2017-05-06 06:08:24 +02:00
twinaphex
969403fadb Header include cleanups 2017-04-29 13:20:50 +02:00
twinaphex
e6ab06a701 Move path variables 2017-04-29 00:39:29 +02:00