forked from PeterTh/dsfix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from niligulmohar/fix-sun-and-lens-flares
Fix sun and lens flares
- Loading branch information
Showing
7 changed files
with
97 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "d3d9.h" | ||
#include "main.h" | ||
#include "RenderstateManager.h" | ||
#include "Settings.h" | ||
|
||
hkIDirect3DQuery9::hkIDirect3DQuery9(IDirect3DQuery9 **ppReturnedQueryInterface) { | ||
m_pD3Dquery = *ppReturnedQueryInterface; | ||
*ppReturnedQueryInterface = this; | ||
} | ||
|
||
HRESULT APIENTRY hkIDirect3DQuery9::QueryInterface(REFIID riid, void** ppvObj) { | ||
return m_pD3Dquery->QueryInterface(riid, ppvObj); | ||
} | ||
|
||
ULONG APIENTRY hkIDirect3DQuery9::AddRef() { | ||
return m_pD3Dquery->AddRef(); | ||
} | ||
|
||
ULONG APIENTRY hkIDirect3DQuery9::Release() { | ||
return m_pD3Dquery->Release(); | ||
} | ||
|
||
HRESULT APIENTRY hkIDirect3DQuery9::GetDevice(IDirect3DDevice9** ppDevice) { | ||
return m_pD3Dquery->GetDevice(ppDevice); | ||
} | ||
|
||
D3DQUERYTYPE APIENTRY hkIDirect3DQuery9::GetType() { | ||
return m_pD3Dquery->GetType(); | ||
} | ||
|
||
DWORD APIENTRY hkIDirect3DQuery9::GetDataSize() { | ||
return m_pD3Dquery->GetDataSize(); | ||
} | ||
|
||
HRESULT APIENTRY hkIDirect3DQuery9::Issue(DWORD dwIssueFlags) { | ||
return m_pD3Dquery->Issue(dwIssueFlags); | ||
} | ||
|
||
HRESULT APIENTRY hkIDirect3DQuery9::GetData(void* pData, DWORD dwSize, DWORD dwGetDataFlags) { | ||
auto result = m_pD3Dquery->GetData(pData, dwSize, dwGetDataFlags); | ||
if (result == D3D_OK) { | ||
auto pixelsDrawn = reinterpret_cast<DWORD*>(pData); | ||
pixelsDrawn[0] = static_cast<DWORD>(pixelsDrawn[0] / RSManager::get().getAreaScale()); | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "d3d9.h" | ||
|
||
interface hkIDirect3DQuery9 : public IDirect3DQuery9 | ||
{ | ||
hkIDirect3DQuery9(IDirect3DQuery9 **ppReturnedQueryInterface); | ||
|
||
IDirect3DQuery9* m_pD3Dquery; | ||
|
||
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj); | ||
STDMETHOD_(ULONG, AddRef)(THIS); | ||
STDMETHOD_(ULONG, Release)(THIS); | ||
STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice); | ||
STDMETHOD_(D3DQUERYTYPE, GetType)(THIS); | ||
STDMETHOD_(DWORD, GetDataSize)(THIS); | ||
STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags); | ||
STDMETHOD(GetData)(THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags); | ||
}; |