From 03b35205233b74da568a9a86b8a90499dd5dad96 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Tue, 6 Jan 2026 10:02:40 +0100 Subject: [PATCH] Add all uniform variables. Add find all uniform variables --- includes/OSDManager.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/includes/OSDManager.h b/includes/OSDManager.h index 1ba1daf..b4ff8f2 100644 --- a/includes/OSDManager.h +++ b/includes/OSDManager.h @@ -8,6 +8,18 @@ constexpr auto OSD_SHADER_NAME = "OSD.fx"; using OSDUpdateFn = std::function; using OSDEndFn = std::function; +// Reshade shader uniform variables +extern reshade::api::effect_uniform_variable u_td_show; +extern reshade::api::effect_uniform_variable u_td_enabled; +extern reshade::api::effect_uniform_variable u_td_world; +extern reshade::api::effect_uniform_variable u_td_AI; +extern reshade::api::effect_uniform_variable u_GodMode_show; +extern reshade::api::effect_uniform_variable u_GodMode_enabled; +extern reshade::api::effect_uniform_variable u_Invulnerability_show; +extern reshade::api::effect_uniform_variable u_Invulnerability_enabled; +extern reshade::api::effect_uniform_variable u_Stealth_show; +extern reshade::api::effect_uniform_variable u_Stealth_enabled; + extern void SetFixesEnabled(GameFixes fix, bool value); extern void SaveSettings(); @@ -42,6 +54,15 @@ void ShowOSD(float duration, OSDUpdateFn onUpdate, OSDEndFn onEnd); */ void UpdateOSD(reshade::api::effect_runtime* runtime, float deltaTime); +/** + * @brief Find all uniform variables enumerated. + * + * This function must be called typically in `on_reshade_begin_effects`, + * @param runtime Pointer to the current `reshade::api::effect_runtime` object. + * @param effect_name File name of the effect file to enumerate uniform variables from (eg. myfile.fx) + */ +void FindAllUniformVariables(reshade::api::effect_runtime* runtime, const char* effect_name); + /** * @brief Reset all uniform variables enumerated. * @@ -53,7 +74,7 @@ void UpdateOSD(reshade::api::effect_runtime* runtime, float deltaTime); void ResetAllUniformVariables(reshade::api::effect_runtime* runtime, const char* effect_name); /** - * @brief Toggle cheats. + * @brief Toggle cheats & OSD display. * * This function must be called once, typically in `init_effect_runtime`, * using an atomic compare-and-exchange operation @@ -91,5 +112,4 @@ void ToggleOSD(T& cheatEnabled, GameFixes fix, [=](reshade::api::effect_runtime* rt) { rt->set_uniform_value_bool(showUniform, false); }); -} - +} \ No newline at end of file