GSBlendStateOGL* GSDeviceOGL::CreateBlend(OMBlendSelector bsel, uint8 afix) { GSBlendStateOGL* bs = new GSBlendStateOGL(); if(bsel.abe) { int i = ((bsel.a * 3 + bsel.b) * 3 + bsel.c) * 3 + bsel.d; bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, m_blendMapD3D9[i].dst); if (m_blendMapD3D9[i].bogus & A_MAX) { if (!theApp.GetConfig("accurate_blend", 1)) { bs->EnableBlend(); if (bsel.a == 0) bs->SetRGB(m_blendMapD3D9[i].op, GL_ONE, m_blendMapD3D9[i].dst); else bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, GL_ONE); } const string afixstr = format("%d >> 7", afix); const char *col[3] = {"Cs", "Cd", "0"}; const char *alpha[3] = {"As", "Ad", afixstr.c_str()}; fprintf(stderr, "Impossible blend for D3D: (%s - %s) * %s + %s\n", col[bsel.a], col[bsel.b], alpha[bsel.c], col[bsel.d]); } else { bs->EnableBlend(); } // Not very good but I don't wanna write another 81 row table if(bsel.negative) bs->RevertOp(); } return bs; }
GSBlendStateOGL* GSDeviceOGL::CreateBlend(OMBlendSelector bsel, uint8 afix) { GSBlendStateOGL* bs = new GSBlendStateOGL(); if(bsel.abe) { int i = ((bsel.a * 3 + bsel.b) * 3 + bsel.c) * 3 + bsel.d; bs->EnableBlend(); bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, m_blendMapD3D9[i].dst); if(m_blendMapD3D9[i].bogus == 1) { if (bsel.a == 0) bs->SetRGB(m_blendMapD3D9[i].op, GL_ONE, m_blendMapD3D9[i].dst); else bs->SetRGB(m_blendMapD3D9[i].op, m_blendMapD3D9[i].src, GL_ONE); const string afixstr = format("%d >> 7", afix); const char *col[3] = {"Cs", "Cd", "0"}; const char *alpha[3] = {"As", "Ad", afixstr.c_str()}; // FIXME, need to investigate OGL capabilities. Maybe for OGL5 ;) fprintf(stderr, "Impossible blend for D3D: (%s - %s) * %s + %s\n", col[bsel.a], col[bsel.b], alpha[bsel.c], col[bsel.d]); } // Not very good but I don't wanna write another 81 row table if(bsel.negative) bs->RevertOp(); } bs->SetMask(bsel.wr, bsel.wg, bsel.wb, bsel.wa); return bs; }