mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Cleaned a bit hooks and added sanity checks.
This commit is contained in:
parent
2365b50c38
commit
9b178146c4
12 changed files with 595 additions and 142 deletions
|
|
@ -156,7 +156,10 @@ HRESULT STDMETHODCALLTYPE DX11_Hook::MyResizeBuffers(IDXGISwapChain* _this, UINT
|
|||
DX11_Hook::DX11_Hook():
|
||||
initialized(false),
|
||||
pContext(nullptr),
|
||||
mainRenderTargetView(nullptr)
|
||||
mainRenderTargetView(nullptr),
|
||||
Present(nullptr),
|
||||
ResizeBuffers(nullptr),
|
||||
ResizeTarget(nullptr)
|
||||
{
|
||||
_library = LoadLibrary(DLL_NAME);
|
||||
|
||||
|
|
@ -208,13 +211,9 @@ const char* DX11_Hook::get_lib_name() const
|
|||
return DLL_NAME;
|
||||
}
|
||||
|
||||
void DX11_Hook::loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain)
|
||||
void DX11_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
||||
{
|
||||
void** vTable = *reinterpret_cast<void***>(pDevice);
|
||||
|
||||
#define LOAD_FUNC(X) (void*&)X = vTable[(int)ID3D11DeviceVTable::X]
|
||||
|
||||
#undef LOAD_FUNC
|
||||
void** vTable;
|
||||
|
||||
vTable = *reinterpret_cast<void***>(pSwapChain);
|
||||
#define LOAD_FUNC(X) (void*&)X = vTable[(int)IDXGISwapChainVTable::X]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue