Correct clamped depth offset.

Oops, forgot to fix this when I fixed the scale.  It's already for a
[-1, 1] range, and needs to be corrected for accordingly.

Fixes #8425, other depth issues in Phantasy Star Portable 2.
This commit is contained in:
Unknown W. Brackets 2016-01-16 00:17:27 -08:00
parent 4a337f7fdf
commit 00b57f6a16
2 changed files with 2 additions and 2 deletions

View file

@ -260,7 +260,7 @@ static void ConvertProjMatrixToD3D(Matrix4x4 &in, bool invertedX, bool invertedY
if (invertedY)
yoff = -yoff;
const Vec3 trans(xoff, yoff, gstate_c.vpZOffset + 0.5f);
const Vec3 trans(xoff, yoff, gstate_c.vpZOffset * 0.5f + 0.5f);
const Vec3 scale(gstate_c.vpWidthScale, gstate_c.vpHeightScale, gstate_c.vpDepthScale * 0.5f);
in.translateAndScale(trans, scale);
}

View file

@ -378,7 +378,7 @@ static inline void ScaleProjMatrix(Matrix4x4 &in) {
// GL upside down is a pain as usual.
yOffset = -yOffset;
}
const Vec3 trans(gstate_c.vpXOffset, yOffset, gstate_c.vpZOffset * 2.0f);
const Vec3 trans(gstate_c.vpXOffset, yOffset, gstate_c.vpZOffset);
const Vec3 scale(gstate_c.vpWidthScale, gstate_c.vpHeightScale, gstate_c.vpDepthScale);
in.translateAndScale(trans, scale);
}