Revert "Small change"

This reverts commit f7034d4a89.
This commit is contained in:
Federico Cecchetto 2021-12-19 18:38:45 +01:00
parent f7034d4a89
commit 29c5af9cb6
2 changed files with 11 additions and 5 deletions

View File

@ -5,7 +5,6 @@
#include "game/dvars.hpp"
#include "scheduler.hpp"
#include "gui.hpp"
#include <utils/string.hpp>
#include <utils/hook.hpp>
@ -84,6 +83,13 @@ 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<void*>();
}
utils::hook::detour wnd_proc_hook;
LRESULT wnd_proc_stub(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@ -132,7 +138,7 @@ namespace gui
void post_unpack() override
{
scheduler::loop(on_frame, scheduler::pipeline::renderer);
dxgi_swap_chain_present_hook.create(0x7A13A0_b, dxgi_swap_chain_present_stub);
wnd_proc_hook.create(0x650F10_b, wnd_proc_stub);
}

View File

@ -94,10 +94,10 @@ namespace scheduler
pipelines[type].execute();
}
void* r_end_frame_stub()
void r_end_frame_stub()
{
execute(pipeline::renderer);
return r_end_frame_hook.invoke<void*>();
r_end_frame_hook.invoke<void>();
}
void server_frame_stub()
@ -178,7 +178,7 @@ namespace scheduler
void post_unpack() override
{
r_end_frame_hook.create(0x7A13A0_b, scheduler::r_end_frame_stub);
r_end_frame_hook.create(0x76D7B0_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);
}