Optimize d3d9ex.

This commit is contained in:
momo5502 2016-01-12 13:45:19 +01:00
parent 2101fc28f3
commit a016c17e8e
3 changed files with 819 additions and 895 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,19 @@
namespace Components namespace Components
{ {
class D3D9Ex : public Component
class myIDirect3DDevice9 : public IDirect3DDevice9
{ {
public: public:
myIDirect3DDevice9(IDirect3DDevice9* pOriginal); D3D9Ex();
virtual ~myIDirect3DDevice9(void); const char* GetName() { return "D3D9Ex"; };
private:
class D3D9Device : public IDirect3DDevice9
{
public:
D3D9Device(IDirect3DDevice9* pOriginal) : m_pIDirect3DDevice9(pOriginal) {};
virtual ~D3D9Device(void) {};
// START: The original DX9 function definitions
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
ULONG __stdcall AddRef(void); ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void); ULONG __stdcall Release(void);
@ -127,20 +133,17 @@ namespace Components
HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo); HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
HRESULT __stdcall DeletePatch(UINT Handle); HRESULT __stdcall DeletePatch(UINT Handle);
HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery); HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
// END: The original DX9 function definitions
private: private:
IDirect3DDevice9 *m_pIDirect3DDevice9; IDirect3DDevice9 *m_pIDirect3DDevice9;
}; };
class D3D9 : public IDirect3D9
class myIDirect3D9 : public IDirect3D9
{ {
public: public:
myIDirect3D9(IDirect3D9Ex *pOriginal); D3D9(IDirect3D9Ex *pOriginal) : m_pIDirect3D9(pOriginal) {};
virtual ~myIDirect3D9(void); virtual ~D3D9(void) {};
// The original DX9 function definitions
HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
ULONG __stdcall AddRef(void); ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void); ULONG __stdcall Release(void);
@ -158,20 +161,11 @@ namespace Components
HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps); HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
HMONITOR __stdcall GetAdapterMonitor(UINT Adapter); HMONITOR __stdcall GetAdapterMonitor(UINT Adapter);
HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface); HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
// The original DX9 function definitions
private: private:
IDirect3D9 *m_pIDirect3D9; IDirect3D9 *m_pIDirect3D9;
}; };
class D3D9Ex : public Component
{
public:
D3D9Ex();
~D3D9Ex();
const char* GetName() { return "D3D9Ex"; };
private:
static IDirect3D9* __stdcall Direct3DCreate9Stub(UINT sdk); static IDirect3D9* __stdcall Direct3DCreate9Stub(UINT sdk);
}; };
} }

View File

@ -76,7 +76,7 @@ namespace Components
Utils::Hook::Set<DWORD>(0x45ACE0, 0xC301B0); Utils::Hook::Set<DWORD>(0x45ACE0, 0xC301B0);
// fs_basegame // fs_basegame
Utils::Hook::Set<char*>(0x6431D1, "data"); Utils::Hook::Set<char*>(0x6431D1, "data2");
// UI version string // UI version string
Utils::Hook::Set<char*>(0x43F73B, "iw4x IW4x: r" REVISION_STR "-" MILESTONE); Utils::Hook::Set<char*>(0x43F73B, "iw4x IW4x: r" REVISION_STR "-" MILESTONE);