diff --git a/src/client/component/gui.cpp b/src/client/component/gui.cpp index 3f19ce2a..60cbbd51 100644 --- a/src/client/component/gui.cpp +++ b/src/client/component/gui.cpp @@ -5,6 +5,7 @@ #include "game/dvars.hpp" #include "scheduler.hpp" +#include "gui.hpp" #include #include @@ -83,13 +84,6 @@ namespace gui return result; } - utils::hook::detour dxgi_swap_chain_present_hook; - void* dxgi_swap_chain_present_stub() - { - on_frame(); - return dxgi_swap_chain_present_hook.invoke(); - } - utils::hook::detour wnd_proc_hook; LRESULT wnd_proc_stub(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -138,7 +132,7 @@ namespace gui void post_unpack() override { - dxgi_swap_chain_present_hook.create(0x7A13A0_b, dxgi_swap_chain_present_stub); + scheduler::loop(on_frame, scheduler::pipeline::renderer); wnd_proc_hook.create(0x650F10_b, wnd_proc_stub); } diff --git a/src/client/component/scheduler.cpp b/src/client/component/scheduler.cpp index 5c33bfa1..6281f6d6 100644 --- a/src/client/component/scheduler.cpp +++ b/src/client/component/scheduler.cpp @@ -94,10 +94,10 @@ namespace scheduler pipelines[type].execute(); } - void r_end_frame_stub() + void* r_end_frame_stub() { execute(pipeline::renderer); - r_end_frame_hook.invoke(); + return r_end_frame_hook.invoke(); } void server_frame_stub() @@ -178,7 +178,7 @@ namespace scheduler void post_unpack() override { - r_end_frame_hook.create(0x76D7B0_b, scheduler::r_end_frame_stub); + r_end_frame_hook.create(0x7A13A0_b, scheduler::r_end_frame_stub); g_run_frame_hook.create(0x4CB030_b, scheduler::server_frame_stub); main_frame_hook.create(0x417FA0_b, scheduler::main_frame_stub); }