From 3bd803757382fd2c801e1645ea042f958b8e280f Mon Sep 17 00:00:00 2001 From: gabest11 Date: Fri, 7 Aug 2009 21:11:27 +0000 Subject: [PATCH] GSdx: fix for transparent walls in kingdom hearts (or anything else that sets AA1 with ABE off) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1611 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSRendererDX.h | 24 ++++++++++--------- plugins/GSdx/GSRendererSW.cpp | 4 ++-- plugins/GSdx/GSUtil.cpp | 45 ++++++++++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/plugins/GSdx/GSRendererDX.h b/plugins/GSdx/GSRendererDX.h index 2d0bd04b23..0b8f9dc69f 100644 --- a/plugins/GSdx/GSRendererDX.h +++ b/plugins/GSdx/GSRendererDX.h @@ -90,22 +90,24 @@ public: else { om_dssel.ztst = ZTST_ALWAYS; - om_dssel.zwe = 0; } -/* - om_dssel.zte = context->TEST.ZTE; - om_dssel.ztst = context->TEST.ZTST; - om_dssel.zwe = !context->ZBUF.ZMSK; -*/ - om_dssel.date = context->FRAME.PSM != PSM_PSMCT24 ? context->TEST.DATE : 0; - om_dssel.fba = m_fba ? context->FBA.FBA : 0; + + if(context->FRAME.PSM != PSM_PSMCT24) + { + om_dssel.date = context->TEST.DATE; + } + + if(m_fba) + { + om_dssel.fba = context->FBA.FBA; + } GSTextureFX::OMBlendSelector om_bsel; - om_bsel.abe = !IsOpaque(); - - if(om_bsel.abe) + if(!IsOpaque()) { + om_bsel.abe = PRIM->ABE || PRIM->AA1 && m_vt.m_primclass == GS_LINE_CLASS; + om_bsel.a = context->ALPHA.A; om_bsel.b = context->ALPHA.B; om_bsel.c = context->ALPHA.C; diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index fc6a4f7c0c..9c1d6ceb27 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -392,9 +392,9 @@ void GSRendererSW::GetScanlineParam(GSScanlineParam& p, GS_PRIM_CLASS primclass) p.sel.pabe = 1; } - if(PRIM->AA1 && (primclass == GS_LINE_CLASS || primclass == GS_TRIANGLE_CLASS)) + if(m_aa1 && PRIM->AA1 && (primclass == GS_LINE_CLASS || primclass == GS_TRIANGLE_CLASS)) { - p.sel.aa1 = m_aa1 ? 1 : 0; + p.sel.aa1 = 1; } } diff --git a/plugins/GSdx/GSUtil.cpp b/plugins/GSdx/GSUtil.cpp index b5b91643a5..1abf9e25db 100644 --- a/plugins/GSdx/GSUtil.cpp +++ b/plugins/GSdx/GSUtil.cpp @@ -100,12 +100,55 @@ bool GSUtil::HasCompatibleBits(uint32 spsm, uint32 dpsm) bool GSUtil::CheckDirectX() { - if(HINSTANCE hDll = LoadLibrary(format("d3dx9_%d.dll", D3DX_SDK_VERSION).c_str())) + OSVERSIONINFOEX version; + memset(&version, 0, sizeof(version)); + version.dwOSVersionInfoSize = sizeof(version); + + if(GetVersionEx((OSVERSIONINFO*)&version)) + { + printf("Windows %d.%d.%d", + version.dwMajorVersion, + version.dwMinorVersion, + version.dwBuildNumber); + + if(version.wServicePackMajor > 0) + { + printf(" (%s %d.%d)", + version.szCSDVersion, + version.wServicePackMajor, + version.wServicePackMinor); + } + + printf("\n"); + } + + if(IDirect3D9* d3d = Direct3DCreate9(D3D_SDK_VERSION)) + { + D3DADAPTER_IDENTIFIER9 id; + + if(S_OK == d3d->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &id)) + { + printf("%s (%d.%d.%d.%d)\n", + id.Description, + id.DriverVersion.HighPart >> 16, + id.DriverVersion.HighPart & 0xffff, + id.DriverVersion.LowPart >> 16, + id.DriverVersion.LowPart & 0xffff); + } + + d3d->Release(); + } + + string d3dx9_dll = format("d3dx9_%d.dll", D3DX_SDK_VERSION); + + if(HINSTANCE hDll = LoadLibrary(d3dx9_dll.c_str())) { FreeLibrary(hDll); } else { + printf("Cannot find %s\n", d3dx9_dll.c_str()); + if(MessageBox(NULL, "You need to update directx, would you like to do it now?", "GSdx", MB_YESNO) == IDYES) { const char* url = "http://www.microsoft.com/downloads/details.aspx?FamilyId=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3";