Commit Graph

298 Commits

Author SHA1 Message Date
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 0e3b478f8c.
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
LibretroAdmin f836328c56
Append Preset (#14737) (#14757)
WIP version of Append and Prepend preset, Includes UI for Standard Retroarch, but not the QT UI companion

Co-authored-by: HyperspaceMadness <remimcgill@hotmail.com>
2022-12-22 21:36:32 +01:00
sonninnos 3b921ffbfa
Fix shader toggle and add hotkey + sublabel (#14628) 2022-11-15 22:14:09 +01:00
LibretroAdmin d0b3c1742d (Video) use flags for FBO passes, GL2 renderchain, etc 2022-10-26 21:21:21 +02:00
LibretroAdmin fcbd72dbf3
Use flags pt4 (#14497)
* * Use flags for rarch_state
* Get rid of ^M linebreaks in retroarch_types.h

* Buildfixes for consoles

* (audio driver) use flags instead of bools

* (video) Use flags instead of bools

* Rewrite input driver state bools into flags
2022-10-08 10:39:15 +02:00
LibretroAdmin f34f4d060c (video_shader_get_type_from_ext) remove strlen call 2022-08-27 14:29:37 +02:00
LibretroAdmin 61e24132bf (task_save.c) Simplification in control flow
(snprintf) Try to reduce or simplify snprintf calls, only tend to
use it for processing integers/numbers and avoid it for regular
string concatenation (NOTE: we try to be a bit safer about it to
address earlier cited criticism, although we don't consider concatenating
3 or 4 characters at the end to be insecure)
(msg_hash_to_str) Try to avoid duplicate calls to the same localized
string when we can just cache the results once instead locally
2022-08-27 07:55:02 +02:00
LibretroAdmin a47ccd81ed (video_shader_parse.c) Don't keep recreating formatted_num unnecessarily
when we already have it
2022-08-26 16:37:24 +02:00
LibretroAdmin 1b181185c2 Simplify override_shader_values - entry variable never used 2022-08-25 08:51:55 +02:00
LibretroAdmin f5e5a1b201 strlcpy already does NULL termination 2022-08-22 12:22:54 +02:00
LibretroAdmin 23b06dca69 (video_shader_parse) reduce amount of snprintfs - create
formatted number once then keep appending it to strings
2022-08-20 17:56:19 +02:00
LibretroAdmin 59866ddac6 (video_shader_parse.c) Safer code 2022-08-12 22:09:33 +02:00
LibretroAdmin b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
LibretroAdmin e7f3432e48 Replace some trivial strlcat usage - use return value of preceding
strlcpy then simply append the extension to it at this location
2022-08-04 03:45:09 +02:00
LibretroAdmin 819337d5d4 video_shader_get_type_from_ext - get rid of unnecessary strlen 2022-08-03 23:35:16 +02:00
LibretroAdmin 592f9384b0 Silence code analysis warnings by Xcode - unused variables - nothing
done with value set - etc
2022-07-29 08:29:43 +02:00
libretroadmin cedbcb10c6 Take out some more unnecessary NULL string termination 2022-07-25 14:12:54 +02:00
libretroadmin 4b5c7856e6 Remove some more explicit NULL-termination when we're calling a
string function that calls strlcpy under the hood
2022-07-19 20:43:12 +02:00
LibretroAdmin 29774f5b7a
Small opts (#14186)
* (joypad_connection) Small optimizations -
* Turn functions static where possible
* Hose strlen call out of loop

* (input_driver.c) General cleanups:
* Some small code/style nits

task_screenshot.c:
* Move widget callback function for screenshots to task_screenshot.c

(file_path.c):
* Turn get_pathname_num_slashes into static function
* path_linked_list_free - always returns true, so get rid of return value
* path_linked_list_new - fix function signature
* path_get_archive_delim - do not NULL-terminate string, already done by strlcpy later on

General:
* Slight optimizations - use int/size_t for loop counter variable instead of unsigned
* Take advantage of fact that strlcpy already NULL-terminates, so don't do this explicitly
outside if we're just going to end up calling strlcpy/fill_pathname_join on it anyway
2022-07-19 10:01:33 +02:00
libretroadmin 8f37c2e3c2 Don't call config_set_bool, call config_set_string directly 2022-07-18 01:59:32 +02:00
libretroadmin 4b1766cf61 Silence more -Wdocumentation warnings 2022-07-15 01:12:04 +02:00
libretroadmin 99ac1af9d2 (video_shader_parse)
* Return value of function was never used, so remove it
* Move variables to proper scope
* Miscellaneous cleanups
2022-07-11 14:00:35 +02:00
libretroadmin f4803b1023 Silence warning - video_shader_is_shader_chain_config 2022-07-01 14:16:13 +02:00
libretroadmin fae8d7e38f (Debug) Fix build failure 2022-06-21 03:33:36 +02:00
libretroadmin 4f1ad9b665 video_shader_load_preset_into_shader - remove unused variable 2022-06-18 19:08:30 +02:00
HyperspaceMadness 8d177ed865 Shader Load Extra Parameter Reference Files
When a shader preset is loaded now when there are more than one #reference line the parameter values will be loaded from the references after the first one
2022-06-04 20:12:21 -04:00
LibretroAdmin 6ba8fe225d
Revert "Shader Preset Loading of Multiple additional #references lines for settings" 2022-05-30 02:39:25 +02:00
Remi McGill 684889507b Shader Loading of Multiple References for settings
Multi reference settings working

Config fixes

Multi-Reference Loading Working, Checking for shader chain not working

Checking References is working

Improved path_linked_list_add_path

Simplify path list stuff

Fixed Static Definition

Fixes

Fixes

Fix to Trigger PR Update

Removed Legacy Orbis which got left in a merge

Memory Leak Fix
2022-05-24 14:07:55 -04:00
libretroadmin 87b76dc7a4 (video_shader_parse.c) Cleanups 2022-05-17 14:12:02 +02:00
twinaphex 4d112da58d Silence some MSVC code analysis warnings 2022-03-07 19:02:46 +01:00
jdgleaver f6dc1c6d93
Disable per-game and per-content-directory shader presets when running contentless cores (#13690) 2022-03-01 09:44:55 +01:00
Tony 6d5d2e722d
Logging cleanups (#13579) 2022-01-31 18:05:23 +01:00
Tony 09880e92d2
Logging cleanups (#13320) 2021-12-04 14:21:12 +01:00
twinaphex bf8cae10a3 Move retroarch_get_shader_preset to video_shader_parse.c 2021-10-29 16:35:50 +02:00
twinaphex ec7b7821fa Move code out of retroarch.c 2021-10-29 14:13:16 +02:00
twinaphex 9b4636ff62 Fixes --disable-menu 2021-10-15 14:32:07 +02:00
twinaphex b3d724b7a3 Move code out of retroarch.c 2021-09-18 22:05:03 +02:00
twinaphex 2490f6e215 Move code from retroarch.c to video_shader_parse.c 2021-09-11 18:15:35 +02:00
twinaphex 544a17926b Use path_basename_nocompression where we are sure we are not
dealing with a filename with a compressed archive hash
2021-04-11 17:44:41 +02:00
twinaphex 78f7deffba Get rid of early return in video_shader_write_root_preset 2021-03-24 18:44:55 +01:00
twinaphex d911dd6efc (video_shader_parse.c) Tons of functions here should have been
made static, tons of log spam put behind DEBUG ifdefs
2021-03-24 18:31:20 +01:00
Autechre 33110603e5
Shader log spam reduction (#11977)
* (Shaders) Change label

* Create RARCH_DBG - if you have Logging Verbosity set to 0, the
shader parsing log spam will show, otherwise it won't
2021-02-03 13:49:07 +01:00
twinaphex f4a20870c7 video_shader_write_referenced_preset - logic flaw -
loaded_shader_preset_path is a character array - conditional boolean
check would always evaluate to true - check if string is empty
instead
2021-01-18 20:30:21 +01:00
twinaphex 552f973833 Cleanups/remove unused variables 2021-01-16 17:17:16 +01:00
Autechre 9797ba9f27
Merge pull request #11743 from HyperspaceMadness/Shaders_Fix_Simple_Preset_Relative_Texture_Paths
Shaders Load Refactor and Fix Referenced Texture Loading
2020-12-31 16:13:20 +01:00
Remi McGill 8d1b949c9c Shaders Fix Config Memory Leak 2020-12-30 11:02:59 -05:00
twinaphex 357b7d68f6 (libretro-common) Rename rhash to lrc_hash
(rcheevos) Rename rhash to rc_hash
2020-12-28 19:55:54 +01:00
HyperspaceMadness f86dbfc5a2 Shaders Fix Referencing issue in QT 2020-12-27 20:32:43 -05:00
Remi McGill 0c504906cb Shaders - Fixed a Reference Pathing Issue on QT 2020-12-27 12:47:47 -05:00
HyperspaceMadness 0c526b6498 Shaders Load Refactor and Fix Referenced Texture Loading
Partial update to work with shaders directly

More Edits

More changes

more shader fixes

More Fixes Compiling, reference load still wrong

Added Feedback & things are working

Logging Fixes

Log Fix

More Fixes

Added Feedback Logging

Fixes for file pathing in Linux

Fix GLCore and Crash in QT Saving

Code Cleanup

Removed Unused Function filepath.c

Code Cleanup
2020-12-26 21:09:27 -05:00
HyperspaceMadness e98a8ce591 Shaders Fix Crash change num shader passes in UI 2020-11-30 19:30:15 -05:00
HyperspaceMadness 06e32982db Shaders_SaveAs_Fix_And_Better_Reference_Handling 2020-11-29 19:16:38 -05:00
HyperspaceMadness f0c4343cb9 Removed extra printf left behind 2020-11-22 19:39:34 -05:00
HyperspaceMadness abb2d06ce9 Shader_Multi-Level_Referenced_Presets 2020-11-22 19:10:08 -05:00
HyperspaceMadness deb8e2b88c Shader_Preset_Remove_parameters_line 2020-11-14 21:23:18 -05:00
HyperspaceMadness fd240f9a32 Shader Save Load Cleanup and UI Rename 2020-11-04 10:05:46 -05:00
HyperspaceMadness 1185df5f39 Shader Save & Load Fixes params not being loaded 2020-11-03 23:12:59 -05:00
HyperspaceMadness f6e35420bc Simple Shader Save Cleanup 2020-11-02 21:07:20 -05:00
HyperspaceMadness 70bf90c5d8 Shader_Preset_Simple_Save_Cleaned_2020_11_01 2020-11-01 09:18:40 -05:00
twinaphex 5fdf0c818d Cleanups 2020-09-04 04:15:46 +02:00
twinaphex 91d78c1e9f video_shader_read_reference_path - simplify 2020-09-04 04:12:51 +02:00
twinaphex 09f72c1465 Turn function static 2020-09-04 04:07:29 +02:00
twinaphex 88c0024a52 Cleanup video_shader_read_reference_path 2020-09-04 03:49:41 +02:00
twinaphex 63b77fb542 Use config_get_entry where possible instead of config_get_array
to prevent string allocation on heap
2020-08-27 16:20:49 +02:00
twinaphex 4388303077 video_shader_write_conf_preset - use less mallocs 2020-08-26 19:19:26 +02:00
twinaphex 1118ba09ec video_shader_resolve_current_parameters - don't use malloc 2020-08-26 19:10:43 +02:00
twinaphex 3ff29abbc8 video_shader_parse_pass - don't use malloc 2020-08-26 19:07:36 +02:00
twinaphex 603b2bf166 Simplify video_shader_read_conf_preset 2020-08-26 18:54:14 +02:00
twinaphex 86424a0cd8 (video_shader_parse) Use string_split_noalloc 2020-08-26 04:22:18 +02:00
twinaphex 0c5611d10e Clean up more string variables on heap; move to stack 2020-08-18 13:17:28 +02:00
twinaphex b9e471d22a Revert "Video context driver cleanups - less functions to go through with"
This reverts commit cd1d760a38.
2020-07-26 23:12:05 +02:00
twinaphex cd1d760a38 Video context driver cleanups - less functions to go through with
public scope
2020-07-26 08:00:49 +02:00
twinaphex 73e63d369c Fix more array subscript has type char warnings 2020-07-23 05:20:23 +02:00
twinaphex 021625fd4a Revert "Move static functions to top of files"
This reverts commit 02b542e2a5.
2020-06-26 18:40:26 +02:00
twinaphex 02b542e2a5 Move static functions to top of files 2020-06-26 18:15:38 +02:00
twinaphex 6fce0435a1 Update more logs 2020-06-08 18:04:29 +02:00
twinaphex 9059b4962e Cleanups 2020-06-07 00:05:41 +02:00
twinaphex a5ca6c24de Add more TODO/FIXMEs for globals 2020-05-29 06:17:39 +02:00
jdgleaver 9eb8472805 Only write config files to disk when parameters change 2020-04-27 17:06:35 +01:00
twinaphex cec672a71d Buildfix 2020-02-17 12:27:08 +01:00
twinaphex a0f3010159 Cleanup 2020-02-17 03:59:12 +01:00
twinaphex 1105d1019d Reduce some configuration dependencies 2020-02-12 16:13:28 +01:00
twinaphex 35b8c4cb05 Cleanup 2020-02-01 02:02:50 +01:00