forked from Hal47/dsfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d3d9query.cpp
33 lines (24 loc) · 1.4 KB
/
d3d9query.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "d3d9query.h"
hkIDirect3DQuery9::hkIDirect3DQuery9(IDirect3DQuery9* pIDirect3DQuery9, hkIDirect3DDevice9* pDevice)
: m_pD3Dquery(pIDirect3DQuery9), m_device(pDevice) {}
HRESULT COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::QueryInterface(REFIID riid, void** ppvObj) {
return m_pD3Dquery->QueryInterface(riid, ppvObj);
}
ULONG COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::AddRef() { return m_pD3Dquery->AddRef(); }
ULONG COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::Release() { return m_pD3Dquery->Release(); }
HRESULT COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::GetDevice(IDirect3DDevice9** ppDevice) {
return m_pD3Dquery->GetDevice(ppDevice);
}
D3DQUERYTYPE COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::GetType() { return m_pD3Dquery->GetType(); }
DWORD COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::GetDataSize() { return m_pD3Dquery->GetDataSize(); }
HRESULT COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::Issue(DWORD dwIssueFlags) {
return m_pD3Dquery->Issue(dwIssueFlags);
}
HRESULT COM_DECLSPEC_NOTHROW APIENTRY hkIDirect3DQuery9::GetData(void* pData, DWORD dwSize, DWORD dwGetDataFlags) {
auto result = m_pD3Dquery->GetData(pData, dwSize, dwGetDataFlags);
if (SUCCEEDED(result)) {
auto pixelsDrawn = static_cast<DWORD*>(pData);
*pixelsDrawn = static_cast<DWORD>(*pixelsDrawn / m_device->getOcclusionScale());
}
return result;
}