From 7ea1e4a6df1be6ac7f435a9cf96598bec91a87a4 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 10 Mar 2009 23:22:56 +0000 Subject: [PATCH] dx plugin : somewhat better but still wrong Clear code git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2645 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp index b7a70aa706..0301869bd5 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp @@ -457,24 +457,25 @@ void BPWritten(int addr, int changes, int newval) // Since clear operations use the source rectangle, we have to do // regular renders + DWORD clearflags = 0; + D3DCOLOR col = 0; + float clearZ = 0; if (bpmem.blendmode.colorupdate || bpmem.blendmode.alphaupdate) { - D3DCOLOR col = 0; if (bpmem.blendmode.colorupdate || bpmem.blendmode.alphaupdate) col = (bpmem.clearcolorAR << 16) | bpmem.clearcolorGB; - - D3D::dev->Clear(0, NULL, NULL, col, 0, 0); + // clearflags |= D3DCLEAR_TARGET; set to break animal crossing :p } // clear z-buffer if (bpmem.zmode.updateenable) { - float clearZ = (float)(bpmem.clearZValue & 0xFFFFFF) / float(0xFFFFFF); + clearZ = (float)(bpmem.clearZValue & 0xFFFFFF) / float(0xFFFFFF); if (clearZ > 1.0f) clearZ = 1.0f; if (clearZ < 0.0f) clearZ = 0.0f; - - D3D::dev->Clear(0, 0, D3DCLEAR_ZBUFFER|D3DCLEAR_STENCIL, 0, clearZ, 0); + clearflags |= D3DCLEAR_ZBUFFER | D3DCLEAR_STENCIL; } + D3D::dev->Clear(0, NULL, clearflags, col, clearZ, 0); } } break;