280 Commits

Author SHA1 Message Date
libretroadmin
9a5b2063b7 Simplify video_shader_replace_wildcards 2024-12-25 06:49:58 +01:00
libretroadmin
44238e909f Consistent viewport naming conventions 2024-12-24 22:50:51 +01:00
libretroadmin
8074a833aa Cleanups/less string copies and indirection 2024-12-24 21:07:31 +01:00
libretroadmin
ca7e53e3ca string_replace_substring - move out implicit strlen 2024-12-23 00:40:09 +01:00
libretroadmin
b90c2d440c Another buildfix 2024-12-22 22:11:19 +01:00
libretroadmin
f8317a2a7e C89_BUILD fix 2024-12-22 22:09:54 +01:00
libretroadmin
b3e5c578b3 Faster shader capabilities queries 2024-12-22 21:58:51 +01:00
libretroadmin
70f55f5976 video_shader_replace_wildcards - do away with the string arrays
and do string concatenation instead
2024-12-22 19:31:46 +01:00
LibretroAdmin
739f2ff55c
Reduce calls to path_remove_extension - use fill_pathname instead (#17270)
* Reduce calls to path_remove_extension - use fill_pathname instead

* More fill_pathname usage
2024-12-20 21:40:58 -08:00
libretroadmin
4521f6bcb2 Cleanups 2024-12-18 20:15:58 +01:00
libretroadmin
f047c247f9 (gfx/video_shader_parse) Readability 2024-12-18 15:54:42 +01:00
Eric Warmenhoven
10a1154b06
Avoid calling strlcpy when copying string onto itself (#17031) 2024-09-24 19:24:46 -05:00
libretroadmin
71326a7eaa fill_pathnam_expanded_and_absolute - pass size parameter to function 2024-09-13 20:38:02 +02:00
libretroadmin
bd8ed67205 Dehardcode size parameter for strlcpy call 2024-09-13 20:22:20 +02:00
Eric Warmenhoven
9135065bfc
Fix strlcpy being passed a length that's too long (#16998) 2024-09-13 11:11:24 -07:00
libretroadmin
14b1af9e1a Revert "Start reducing size of video_shader_pass struct to reduce"
This reverts commit 0ab10f73c29f25a7e4763accfdf80ffd61208803.
2024-09-11 19:17:20 +02:00
libretroadmin
23bd9686e5 Silence unused variable warnings 2024-09-11 15:48:43 +02:00
libretroadmin
5892551f75 Avoid strlen calls in video_shader_replace_wildcards 2024-09-10 16:33:08 +02:00
libretroadmin
285e38bd87 (video_shader_parse) Cleanups 2024-09-09 22:47:33 +02:00
libretroadmin
6020877043 Cleanups 2024-09-09 22:01:37 +02:00
libretroadmin
0ab10f73c2 Start reducing size of video_shader_pass struct to reduce
massive size of video_shader struct
2024-09-09 18:28:38 +02:00
libretroadmin
e675ea7e29 Variable cleanups - add TODO/FIXME notes for spurious variable sizes 2024-09-09 15:22:08 +02:00
libretroadmin
b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
2024-09-09 05:47:32 +02:00
libretroadmin
9efb498bde (config_file) Use flags 2024-09-08 18:12:12 +02:00
libretroadmin
d60d320e76 Simplified parameter parsing to have all shader formats use the same slang method
(when HAVE_SLANG and HAVE_SPIRV_CROSS are defined) - backport of HyperSpaceMadness' PR
2024-09-08 15:25:40 +02:00
zoltanvb
57c17d559f
Use CLI shader path for shader dir init if present (#16196)
If shader is given on command line, use it for directory init.
Fixes #16181, shader cycle should now work using the dir of the
shader passed to CLI.
2024-08-19 09:55:20 -07:00
libretroadmin
0ced85b91d Get rid of some unnecessary strlcat usage 2024-06-16 15:09:31 +02:00
libretroadmin
bd7a0f7f0a Explicit typecast to bool for some flag to bool conversions 2023-08-16 00:16:03 +02:00
libretroadmin
c8e6506687 Fix --disable-menu errors 2023-08-14 23:36:19 +02:00
sonninnos
8bdf0e157d Shader preset save fix + cleanup 2023-07-20 17:44:43 +02:00
libretroadmin
9e34f22a29 Silence Xcode code warnings + general cleanups 2023-07-14 18:05:54 +02:00
libretroadmin
22dc6aff5a Rework some snprintf/strlcat calls 2023-06-21 09:25:04 +02:00
libretroadmin
b7e122a4fa Replace more strlcat calls 2023-06-20 17:56:45 +02:00
libretroadmin
2ab38eaf98 Reduce some local char variables which were unnecessarily big,
and reduce some temp char variables
2023-06-18 12:31:49 +02:00
libretroadmin
631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
Grisly Glee
4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
libretroadmin
735500ff66 Warning fixes and style nits 2023-05-29 15:30:54 +02:00
libretroadmin
9f5a73ef07 Silence warnings and fix Android build 2023-05-10 21:59:50 +02:00
libretroadmin
91ea92e50b Get rid of some menu_driver_ctl commands 2023-05-10 21:30:09 +02:00
libretroadmin
1f2bd96459 (video_shader_parse.c) Namespace some functions, random misc cleanups 2023-04-23 11:24:03 +02:00
libretroadmin
0422dfb5b5 Cleanups 2023-02-28 18:32:11 +01:00
HyperspaceMadness
e4a11cff59
Shader Preset - Wildcard Replacement in Paths on Load (#15023)
When a simple preset loads, wildcards which are found in paths inside the presets will 
be replaced with values coming from the current RetroArch context.  This will operate
on both texture paths and reference paths.

This would allow you to do things like have one preset which could be used with the entire list of images from the Bezel Project

E.G. 
    "/shaders/MyBackground_$VID-DRV$ _$CORE$.png" 
would be replaced with
   "/shaders/MyBackground_glcore_YabaSanshiro.png"
If  no file found at that path, the path will revert to the original path, so operates as a fallback
   "/shaders/MyBackground_$VID-DRV$ _$CORE$.png" 

  * Possible wildcards/tokens to be replaced:
 * 
 *   $CONTENT-DIR$ -> Content Directory of the game rom
 * 
 *   $CORE$       -> Core name
 * 
 *   $GAME$       -> Game ROM's name
 * 
 *   $VID-DRV$   -> Video Driver: Currently active driver, possible replacement values:
 *       glcore
 *       gl
 *       vulkan
 *       d3d11
 *       d3d9_hlsl
 *       "N/A"
 * 
 *   $VID-DRV-SHADER-EXT$   -> Video Driver Shader File Extension: The extension of shaders type supported by the current video driver:
 *       cg
 *       glsl
 *       slang
 * 
 *   $VID-DRV-PRESET-EXT$   -> Video Driver Preset File Extension: The extension of shaders type supported by the current video driver:
 *       cgp
 *       glslp
 *       slangp
 * 
 *   $CORE-REQ-ROT$   -> Core Requested Rotation: Rotation the core is requesting, possible replacement values:
 *       CORE-REQ-ROT-0
 *       CORE-REQ-ROT-90
 *       CORE-REQ-ROT-180
 *       CORE-REQ-ROT-270
 * 
 *   $VID-ALLOW-CORE-ROT$   -> Video Allow Core Rotation: Reflects Retroarch's setting allowing the core requested rotation to affect the final rotation:
 *       VID-ALLOW-CORE-ROT-OFF
 *       VID-ALLOW-CORE-ROT-ON
 * 
 *   $VID-USER-ROT$   -> Video User Rotation: Rotation the core is requesting, possible replacement values, does not affect the UI:
 *       VID-USER-ROT-0
 *       VID-USER-ROT-90
 *       VID-USER-ROT-180
 *       VID-USER-ROT-270
 * 
 *   $VID-FINAL-ROT$   -> Video Final Rotation: Rotation which is the sum of the user rotation and the core rotation if it has been allowed, does not affect the UI:
 *       VID-FINAL-ROT-0
 *       VID-FINAL-ROT-90
 *       VID-FINAL-ROT-180
 *       VID-FINAL-ROT-270
 * 
 *   $SCREEN-ORIENT$   -> Screen Orientation: User adjusted screen orientation, will change windows from landscape to portrait, including the Retroarch UI:
 *       SCREEN-ORIENT-0
 *       SCREEN-ORIENT-90
 *       SCREEN-ORIENT-180
 *       SCREEN-ORIENT-270
 * 
 *   $VIEW-ASPECT-ORIENT$   -> Viewport Aspect Orientation: Orientation of the aspect ratio of the RetroArch viewport
 *       VIEW-ASPECT-ORIENT-HORZ
 *       VIEW-ASPECT-ORIENT-VERT
 * 
 *   $CORE-ASPECT-ORIENT$   -> Core Aspect Orientation: Orientation of the aspect ratio requested by the core
 *       CORE-ASPECT-ORIENT-HORZ
 *       CORE-ASPECT-ORIENT-VERT
 * 
 *   $PRESET_DIR$  -> Preset directory's name
 * 
 *   $PRESET$     -> Preset's name
 * 
 * If no wildcards are found within the path, or the path 
 * after replacing the wildcards does not exist on disk,
 * the path returned will be unaffected.
2023-02-26 19:06:57 +01:00
reallibretroadmin
dc35763677 (Mac) Silence warnings 2023-02-18 17:15:52 +01:00
libretroadmin
6624126885 (MSVC) silence warnings 2023-02-18 17:04:23 +01:00
libretroadmin
539c47faa3 Indenting nit 2023-01-22 16:29:03 +01:00
libretroadmin
8a3686df58 Revert "Header cleanups - don't include retroarch.h everywhere"
This reverts commit 0e3b478f8c00b015aec9a78d13e73277500e5449.
2023-01-08 09:05:46 +01:00
libretroadmin
0e3b478f8c Header cleanups - don't include retroarch.h everywhere 2023-01-08 08:56:57 +01:00
libretroadmin
0c42e339e1 Silence some warnings that popup in Xcode 2023-01-04 18:42:35 +01:00
libretroadmin
e82b75c769 Fix more C89_BUILD issues 2022-12-22 23:10:15 +01:00
LibretroAdmin
097a7d7fc5
- C89 buildfixes (#14758)
- Don't declare static function prototypes in headers
2022-12-22 22:14:50 +01:00