From 7b8324144198416f9e28273d3501c5597baaf9b3 Mon Sep 17 00:00:00 2001 From: praydog Date: Mon, 16 Sep 2024 00:14:36 -0700 Subject: [PATCH] Plugins: Fix last commit --- src/mods/PluginLoader.cpp | 19 ++++++++++++++++++- src/mods/PluginLoader.hpp | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mods/PluginLoader.cpp b/src/mods/PluginLoader.cpp index cfee6fda..18c8fd53 100644 --- a/src/mods/PluginLoader.cpp +++ b/src/mods/PluginLoader.cpp @@ -321,6 +321,14 @@ bool on_post_slate_draw_window_render_thread(UEVR_Slate_DrawWindow_RenderThreadC return PluginLoader::get()->add_on_post_slate_draw_window_render_thread(cb); } +bool on_early_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb) { + if (cb == nullptr) { + return false; + } + + return PluginLoader::get()->add_on_early_calculate_stereo_view_offset(cb); +} + bool on_pre_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb) { if (cb == nullptr) { return false; @@ -362,7 +370,8 @@ UEVR_SDKCallbacks g_sdk_callbacks { uevr::on_pre_calculate_stereo_view_offset, uevr::on_post_calculate_stereo_view_offset, uevr::on_pre_viewport_client_draw, - uevr::on_post_viewport_client_draw + uevr::on_post_viewport_client_draw, + uevr::on_early_calculate_stereo_view_offset, }; #define UOBJECT(x) ((sdk::UObject*)x) @@ -2106,6 +2115,14 @@ bool PluginLoader::add_on_post_slate_draw_window_render_thread(UEVR_Slate_DrawWi return true; } +bool PluginLoader::add_on_early_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb) { + std::unique_lock _{m_api_cb_mtx}; + + m_on_early_calculate_stereo_view_offset_cbs.push_back(cb); + return true; +} + + bool PluginLoader::add_on_pre_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb) { std::unique_lock _{m_api_cb_mtx}; diff --git a/src/mods/PluginLoader.hpp b/src/mods/PluginLoader.hpp index 1e848ca6..4d09d74a 100644 --- a/src/mods/PluginLoader.hpp +++ b/src/mods/PluginLoader.hpp @@ -85,6 +85,7 @@ class PluginLoader : public Mod { bool add_on_post_engine_tick(UEVR_Engine_TickCb cb); bool add_on_pre_slate_draw_window_render_thread(UEVR_Slate_DrawWindow_RenderThreadCb cb); bool add_on_post_slate_draw_window_render_thread(UEVR_Slate_DrawWindow_RenderThreadCb cb); + bool add_on_early_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb); bool add_on_pre_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb); bool add_on_post_calculate_stereo_view_offset(UEVR_Stereo_CalculateStereoViewOffsetCb cb); bool add_on_pre_viewport_client_draw(UEVR_ViewportClient_DrawCb cb);