diff --git a/src/mods/PluginLoader.hpp b/src/mods/PluginLoader.hpp index 802d99da..7133092c 100644 --- a/src/mods/PluginLoader.hpp +++ b/src/mods/PluginLoader.hpp @@ -54,21 +54,21 @@ class PluginLoader : public Mod { void attempt_unload_plugins(); void reload_plugins(); - using UEVR_OnPresentCb = std::function::type>; + /*using UEVR_OnPresentCb = std::function::type>; using UEVR_OnDeviceResetCb = std::function::type>; using UEVR_OnMessageCb = std::function::type>; using UEVR_OnXInputGetStateCb = std::function::type>; - using UEVR_OnXInputSetStateCb = std::function::type>; + using UEVR_OnXInputSetStateCb = std::function::type>;*/ /* VR Renderer */ - using UEVR_OnPostRenderVRFrameworkDX11Cb = std::function::type>; - using UEVR_OnPostRenderVRFrameworkDX12Cb = std::function::type>; + //using UEVR_OnPostRenderVRFrameworkDX11Cb = std::function::type>; + //using UEVR_OnPostRenderVRFrameworkDX12Cb = std::function::type>; /* Engine specific callbacks */ - using UEVR_Engine_TickCb = std::function::type>; - using UEVR_Slate_DrawWindow_RenderThreadCb = std::function::type>; - using UEVR_Stereo_CalculateStereoViewOffsetCb = std::function::type>; - using UEVR_ViewportClient_DrawCb = std::function::type>; + //using UEVR_Engine_TickCb = std::function::type>; + //using UEVR_Slate_DrawWindow_RenderThreadCb = std::function::type>; + //using UEVR_Stereo_CalculateStereoViewOffsetCb = std::function::type>; + //using UEVR_ViewportClient_DrawCb = std::function::type>; bool add_on_present(UEVR_OnPresentCb cb); bool add_on_device_reset(UEVR_OnDeviceResetCb cb); @@ -93,7 +93,7 @@ class PluginLoader : public Mod { for (auto& pcb_list : m_plugin_callback_lists) { auto& cb_list = *pcb_list; std::erase_if(cb_list, [cb](auto& cb_func) { - return cb_func.target() == cb; + return cb_func == cb; }); } @@ -126,24 +126,24 @@ class PluginLoader : public Mod { private: std::shared_mutex m_api_cb_mtx; - std::vector m_on_present_cbs{}; - std::vector m_on_device_reset_cbs{}; - std::vector m_on_post_render_vr_framework_dx11_cbs{}; - std::vector m_on_post_render_vr_framework_dx12_cbs{}; - std::vector m_on_message_cbs{}; - std::vector m_on_xinput_get_state_cbs{}; - std::vector m_on_xinput_set_state_cbs{}; - - std::vector m_on_pre_engine_tick_cbs{}; - std::vector m_on_post_engine_tick_cbs{}; - std::vector m_on_pre_slate_draw_window_render_thread_cbs{}; - std::vector m_on_post_slate_draw_window_render_thread_cbs{}; - std::vector m_on_pre_calculate_stereo_view_offset_cbs{}; - std::vector m_on_post_calculate_stereo_view_offset_cbs{}; - std::vector m_on_pre_viewport_client_draw_cbs{}; - std::vector m_on_post_viewport_client_draw_cbs{}; - - using generic_std_function = std::function; + std::vector m_on_present_cbs{}; + std::vector m_on_device_reset_cbs{}; + std::vector m_on_post_render_vr_framework_dx11_cbs{}; + std::vector m_on_post_render_vr_framework_dx12_cbs{}; + std::vector m_on_message_cbs{}; + std::vector m_on_xinput_get_state_cbs{}; + std::vector m_on_xinput_set_state_cbs{}; + + std::vector m_on_pre_engine_tick_cbs{}; + std::vector m_on_post_engine_tick_cbs{}; + std::vector m_on_pre_slate_draw_window_render_thread_cbs{}; + std::vector m_on_post_slate_draw_window_render_thread_cbs{}; + std::vector m_on_pre_calculate_stereo_view_offset_cbs{}; + std::vector m_on_post_calculate_stereo_view_offset_cbs{}; + std::vector m_on_pre_viewport_client_draw_cbs{}; + std::vector m_on_post_viewport_client_draw_cbs{}; + + using generic_std_function = void*; std::vector*> m_plugin_callback_lists{ // Plugin