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
|
|
@ -139,7 +139,10 @@ HRESULT STDMETHODCALLTYPE DX10_Hook::MyResizeBuffers(IDXGISwapChain* _this, UINT
|
|||
DX10_Hook::DX10_Hook():
|
||||
initialized(false),
|
||||
pDevice(nullptr),
|
||||
mainRenderTargetView(nullptr)
|
||||
mainRenderTargetView(nullptr),
|
||||
Present(nullptr),
|
||||
ResizeBuffers(nullptr),
|
||||
ResizeTarget(nullptr)
|
||||
{
|
||||
_library = LoadLibrary(DLL_NAME);
|
||||
|
||||
|
|
@ -190,13 +193,9 @@ const char* DX10_Hook::get_lib_name() const
|
|||
return DLL_NAME;
|
||||
}
|
||||
|
||||
void DX10_Hook::loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain)
|
||||
void DX10_Hook::loadFunctions(IDXGISwapChain *pSwapChain)
|
||||
{
|
||||
void** vTable = *reinterpret_cast<void***>(pDevice);
|
||||
|
||||
#define LOAD_FUNC(X) (void*&)X = vTable[(int)ID3D10DeviceVTable::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