Make OpenGL software-like shear effect consistent with software.

This commit is contained in:
Nev3r 2022-01-11 23:16:11 +01:00
parent f8532d4ad1
commit 699bc2d582

View file

@ -3029,10 +3029,14 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
// https://zdoom.org/wiki/Y-shearing
if (shearing)
{
float fdy = stransform->viewaiming * 2;
float shear = stransform->viewaiming * 2;
float ang = 2*M_PI*(stransform->rollangle/360);
float fdx = stransform->roll ? shear * sin(ang) : 0.0f;
float fdy = stransform->roll ? shear * cos(ang) : shear;
if (stransform->flip)
fdy *= -1.0f;
pglTranslatef(0.0f, -fdy/BASEVIDHEIGHT, 0.0f);
pglTranslatef(fdx/BASEVIDWIDTH, -fdy/BASEVIDHEIGHT, 0.0f);
}
if (special_splitscreen)