Skip to content

Commit 129546f

Browse files
committed
remove some flags
1 parent 108036e commit 129546f

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

RenderstateManager.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ void RSManager::setupAA() {
3535
new FXAA(m_pDevice.Get(), rw, rh, (FXAA::Quality)(Settings::get().getAAQuality() - 1)));
3636
smaa = nullptr;
3737
}
38-
doAA = true;
3938
} else {
40-
doAA = false;
4139
fxaa = nullptr;
4240
smaa = nullptr;
4341
}
@@ -55,21 +53,17 @@ void RSManager::setupSSAO() {
5553
unsigned int rw = Settings::get().getRenderWidth();
5654
unsigned int rh = Settings::get().getRenderHeight();
5755
ssao.reset(new SSAO(m_pDevice.Get(), rw, rh, Settings::get().getSsaoStrength() - 1, ssaoType));
58-
doSsao = true;
5956
} else {
6057
ssao = nullptr;
61-
doSsao = false;
6258
}
6359
}
6460

6561
void RSManager::setupDoF() {
6662
unsigned int dofRes = getDOFResolution();
6763
if (Settings::get().getDOFBlurAmount()) {
6864
gauss.reset(new GAUSS(m_pDevice.Get(), dofRes * 16 / 9, dofRes));
69-
doDofGauss = true;
7065
} else {
7166
gauss = nullptr;
72-
doDofGauss = false;
7367
}
7468
}
7569

@@ -131,7 +125,7 @@ HRESULT RSManager::redirectSetRenderTarget(DWORD RenderTargetIndex,
131125
++mainRTuses;
132126
}
133127
// we are switching away from the initial 3D-rendered image, do AA and SSAO
134-
if (mainRTuses == 2 && mainRT && zSurf && ((ssao && doSsao) || (doAA && (smaa || fxaa)))) {
128+
if (mainRTuses == 2 && mainRT && zSurf && (ssao || smaa || fxaa)) {
135129
WRL::ComPtr<IDirect3DSurface9> oldRenderTarget;
136130
ThrowIfFailed(m_pDevice->GetRenderTarget(0, &oldRenderTarget));
137131
if (oldRenderTarget == mainRT) {
@@ -153,7 +147,7 @@ HRESULT RSManager::redirectSetRenderTarget(DWORD RenderTargetIndex,
153147
D3DRS_COLORWRITEENABLE,
154148
D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE));
155149
// perform AA processing
156-
if (doAA && (smaa || fxaa)) {
150+
if (smaa || fxaa) {
157151
if (smaa)
158152
smaa->go(tex.Get(), tex.Get(), rgbaBuffer1Surf.Get(), SMAA::INPUT_COLOR);
159153
else
@@ -162,7 +156,7 @@ HRESULT RSManager::redirectSetRenderTarget(DWORD RenderTargetIndex,
162156
oldRenderTarget.Get(), nullptr, D3DTEXF_NONE));
163157
}
164158
// perform SSAO
165-
if (ssao && doSsao) {
159+
if (ssao) {
166160
ssao->go(tex.Get(), zTex.Get(), rgbaBuffer1Surf.Get());
167161
ThrowIfFailed(m_pDevice->StretchRect(rgbaBuffer1Surf.Get(), nullptr,
168162
oldRenderTarget.Get(), nullptr, D3DTEXF_NONE));
@@ -173,7 +167,7 @@ HRESULT RSManager::redirectSetRenderTarget(DWORD RenderTargetIndex,
173167
}
174168
}
175169
// DoF blur stuff
176-
if (gauss && doDofGauss) {
170+
if (gauss) {
177171
WRL::ComPtr<IDirect3DSurface9> oldRenderTarget;
178172
ThrowIfFailed(m_pDevice->GetRenderTarget(0, &oldRenderTarget));
179173
D3DSURFACE_DESC desc;

RenderstateManager.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ class RSManager {
1313
D3DVIEWPORT9 viewport = {};
1414
Microsoft::WRL::ComPtr<IDirect3DDevice9> m_pDevice;
1515
double lastPresentTime = 0;
16-
bool doAA = true;
1716
std::unique_ptr<SMAA> smaa;
1817
std::unique_ptr<FXAA> fxaa;
19-
bool doSsao = true;
2018
std::unique_ptr<SSAO> ssao;
21-
bool doDofGauss = true;
2219
std::unique_ptr<GAUSS> gauss;
2320
Microsoft::WRL::ComPtr<IDirect3DTexture9> rgbaBuffer1Tex;
2421
Microsoft::WRL::ComPtr<IDirect3DSurface9> rgbaBuffer1Surf;
@@ -60,12 +57,6 @@ class RSManager {
6057
(r.right == static_cast<LONG>(viewport.Width));
6158
}
6259

63-
void toggleSsao() { doSsao = !doSsao; }
64-
65-
void toggleAA() { doAA = !doAA; }
66-
67-
void toggleDofGauss() { doDofGauss = !doDofGauss; }
68-
6960
HRESULT redirectSetRenderTarget(DWORD RenderTargetIndex,
7061
IDirect3DSurface9* pRenderTarget) noexcept;
7162
HRESULT redirectPresent(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,

0 commit comments

Comments
 (0)