2022-07-03 01:05:33 +02:00
|
|
|
#include "hooking.hpp"
|
|
|
|
#include "renderer.hpp"
|
|
|
|
#include "script.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
HRESULT hooks::swapchain_resizebuffers(IDXGISwapChain* this_, UINT buffer_count, UINT width, UINT height, DXGI_FORMAT new_format, UINT swapchain_flags)
|
|
|
|
{
|
|
|
|
TRY_CLAUSE
|
|
|
|
{
|
|
|
|
if (g_running)
|
|
|
|
{
|
|
|
|
g_renderer->pre_reset();
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
const auto result = g_hooking->m_swapchain_hook.get_original<decltype(&swapchain_resizebuffers)>(swapchain_resizebuffers_index)(this_, buffer_count, width, height, new_format, swapchain_flags);
|
2022-07-03 01:05:33 +02:00
|
|
|
|
|
|
|
if (SUCCEEDED(result))
|
|
|
|
{
|
|
|
|
g_renderer->post_reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
return g_hooking->m_swapchain_hook.get_original<decltype(&swapchain_resizebuffers)>(swapchain_resizebuffers_index)(this_, buffer_count, width, height, new_format, swapchain_flags);
|
|
|
|
}
|
|
|
|
EXCEPT_CLAUSE
|
2022-07-03 01:05:33 +02:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|