mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-18 16:09:53 +00:00
Improve blending with two fixed colors.
It's not right, but it's less bad. Maybe there's a better way? Improves Popolocrois and Lunar (battle) blending issues.
This commit is contained in:
parent
29651c026b
commit
4009a37692
@ -178,8 +178,19 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
didReportBlend = true;
|
||||
|
||||
DEBUG_LOG(HLE, "ERROR INVALID blendcolorstate: FixA=%06x FixB=%06x FuncA=%i FuncB=%i", gstate.getFixA(), gstate.getFixB(), gstate.getBlendFuncA(), gstate.getBlendFuncB());
|
||||
glBlendFuncA = GL_ONE;
|
||||
glBlendFuncB = GL_ONE;
|
||||
// Let's approximate, at least.
|
||||
int blendSumA = (fixA & 0xFF) + ((fixA >> 8) & 0xFF) + ((fixA >> 16) & 0xFF);
|
||||
int blendSumB = (fixB & 0xFF) + ((fixB >> 8) & 0xFF) + ((fixB >> 16) & 0xFF);
|
||||
if (blendSumA < 64 * 3 && blendSumB > 192 * 3) {
|
||||
glBlendFuncA = GL_ZERO;
|
||||
glBlendFuncB = GL_ONE;
|
||||
} else if (blendSumA > 192 * 3 && blendSumB < 64 * 3) {
|
||||
glBlendFuncA = GL_ONE;
|
||||
glBlendFuncB = GL_ZERO;
|
||||
} else {
|
||||
glBlendFuncA = GL_ONE;
|
||||
glBlendFuncB = GL_ONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// At this point, through all paths above, glBlendFuncA and glBlendFuncB will be set somehow.
|
||||
|
Loading…
x
Reference in New Issue
Block a user