This commit is contained in:
raven02 committed 2014-01-02 20:17:58 +08:00
1 parent 968be3f54a
commit 5f5220b608
1 file changed
+11 -15
+11 -15
View File
@@ -407,22 +407,18 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
bool rmask = (gstate.pmskc & 0xFF) < 128;
bool gmask = ((gstate.pmskc >> 8) & 0xFF) < 128;
bool bmask = ((gstate.pmskc >> 16) & 0xFF) < 128;
bool amask = (gstate.pmska & 0xFF) < 128;
bool amask;
ReplaceAlphaType stencilToAlpha = ReplaceAlphaWithStencil();
switch (stencilToAlpha) {
case REPLACE_ALPHA_DUALSOURCE:
case REPLACE_ALPHA_NO:
amask = (gstate.pmska & 0xFF) < 128;
break;
case REPLACE_ALPHA_YES:
amask = true;
break;
}
glstate.colorMask.set(rmask, gmask, bmask, amask);
// Let's not write to alpha if stencil isn't enabled.
if (!gstate.isStencilTestEnabled()) {
amask = false;
} else {
// If the stencil type is set to KEEP, we shouldn't write to the stencil/alpha channel.
if (ReplaceAlphaWithStencilType() == STENCIL_VALUE_KEEP) {
amask = false;
}
}
glstate.colorMask.set(rmask, gmask, bmask, amask);
// Stencil Test
if (gstate.isStencilTestEnabled() && enableStencilTest) {