Add support for color masking. Improves the look of Wipeout greatly.

This commit is contained in:
Henrik Rydgard 2013-01-12 12:51:09 +01:00
parent 6c9d28205d
commit 60f9da3926
2 changed files with 10 additions and 2 deletions

View file

@ -155,6 +155,14 @@ void ApplyDrawState()
glstate.depthFunc.set(ztests[depthTestFunc]);
}
// PSP color/alpha mask is per bit but we can only support per byte.
// But let's do that, at least. And let's try a threshold.
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;
glstate.colorMask.set(rmask, gmask, bmask, amask);
bool wantDepthWrite = gstate.isModeClear() || gstate.isDepthWriteEnabled();
glstate.depthWrite.set(wantDepthWrite ? GL_TRUE : GL_FALSE);

View file

@ -177,8 +177,8 @@ struct GPUgstate
dith4,
lop,
zmsk,
pmsk1,
pmsk2,
pmskc,
pmska,
transferstart,
transfersrcpos,
transferdstpos,