diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-23 14:08:08 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-23 14:08:08 +0000 |
| commit | 55dc7efaa427f442bec4fa5cdbb7ad0ecba19082 (patch) | |
| tree | a91c84ba52cfdd127b7cbb69e1c6617ef4475146 /Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp | |
| parent | 37f1e1ca73596b2f12efba53ef107263bd0eee8c (diff) | |
corrected viewport and scissor test behavior in both plugins.
some code cleanup in d3d.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4605 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp b/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp index 86354b5f1c..33ddb44aec 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/BPFunctions.cpp @@ -33,26 +33,6 @@ const bool renderFog = false; using namespace D3D; -static const D3DCULL d3dCullModes[4] = -{ - D3DCULL_NONE, - D3DCULL_CCW, - D3DCULL_CW, - D3DCULL_CCW -}; - -static const D3DCMPFUNC d3dCmpFuncs[8] = -{ - D3DCMP_NEVER, - D3DCMP_LESS, - D3DCMP_EQUAL, - D3DCMP_LESSEQUAL, - D3DCMP_GREATER, - D3DCMP_NOTEQUAL, - D3DCMP_GREATEREQUAL, - D3DCMP_ALWAYS -}; - static const D3DTEXTUREFILTERTYPE d3dMipFilters[4] = { D3DTEXF_NONE, @@ -79,22 +59,7 @@ void FlushPipeline() void SetGenerationMode(const BPCmd &bp) { - D3D::SetRenderState(D3DRS_CULLMODE, d3dCullModes[bpmem.genMode.cullmode]); - - if (bpmem.genMode.cullmode == 3) - { - D3D::SetRenderState(D3DRS_COLORWRITEENABLE, 0); - } - else - { - DWORD write = 0; - if (bpmem.blendmode.alphaupdate) - write = D3DCOLORWRITEENABLE_ALPHA; - if (bpmem.blendmode.colorupdate) - write |= D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE; - - D3D::SetRenderState(D3DRS_COLORWRITEENABLE, write); - } + Renderer::SetGenerationMode(); } void SetScissor(const BPCmd &bp) @@ -111,17 +76,7 @@ void SetLineWidth(const BPCmd &bp) void SetDepthMode(const BPCmd &bp) { - if (bpmem.zmode.testenable) - { - D3D::SetRenderState(D3DRS_ZENABLE, TRUE); - D3D::SetRenderState(D3DRS_ZWRITEENABLE, bpmem.zmode.updateenable); - D3D::SetRenderState(D3DRS_ZFUNC, d3dCmpFuncs[bpmem.zmode.func]); - } - else - { - D3D::SetRenderState(D3DRS_ZENABLE, FALSE); - D3D::SetRenderState(D3DRS_ZWRITEENABLE, FALSE); // ?? - } + Renderer::SetDepthMode(); } void SetBlendMode(const BPCmd &bp) |
