Change wall project to use the fixed version from GZDoom as it was most likely more tested

This commit is contained in:
Magnus Norddahl 2017-02-15 13:26:43 +01:00
parent fc97ef0913
commit 01cbb14f14

View file

@ -159,19 +159,35 @@ namespace swrenderer
float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - viewport->CenterX);
float uGradient = WallT.UoverZstep;
float zGradient = WallT.InvZstep;
float xrepeat = (float)walxrepeat;
float xrepeat = (float)fabs(walxrepeat);
float depthScale = (float)(WallT.InvZstep * viewport->WallTMapScale2);
float depthOrg = (float)(-WallT.UoverZstep * viewport->WallTMapScale2);
for (int x = x1; x < x2; x++)
if (walxrepeat < 0.0)
{
float u = uOverZ / invZ;
for (int x = x1; x < x2; x++)
{
float u = uOverZ / invZ;
UPos[x] = (fixed_t)(u * xrepeat * FRACUNIT);
VStep[x] = depthOrg + u * depthScale;
UPos[x] = (fixed_t)((xrepeat - u * xrepeat) * FRACUNIT);
VStep[x] = depthOrg + u * depthScale;
uOverZ += uGradient;
invZ += zGradient;
uOverZ += uGradient;
invZ += zGradient;
}
}
else
{
for (int x = x1; x < x2; x++)
{
float u = uOverZ / invZ;
UPos[x] = (fixed_t)(u * xrepeat * FRACUNIT);
VStep[x] = depthOrg + u * depthScale;
uOverZ += uGradient;
invZ += zGradient;
}
}
}
@ -183,16 +199,31 @@ namespace swrenderer
float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - viewport->CenterX);
float uGradient = WallT.UoverZstep;
float zGradient = WallT.InvZstep;
float xrepeat = (float)walxrepeat;
float xrepeat = (float)fabs(walxrepeat);
for (int x = x1; x < x2; x++)
if (walxrepeat < 0.0f)
{
float u = uOverZ / invZ * xrepeat;
for (int x = x1; x < x2; x++)
{
float u = uOverZ / invZ * xrepeat - xrepeat;
UPos[x] = (fixed_t)(u * FRACUNIT);
UPos[x] = (fixed_t)(u * FRACUNIT);
uOverZ += uGradient;
invZ += zGradient;
uOverZ += uGradient;
invZ += zGradient;
}
}
else
{
for (int x = x1; x < x2; x++)
{
float u = uOverZ / invZ * xrepeat;
UPos[x] = (fixed_t)(u * FRACUNIT);
uOverZ += uGradient;
invZ += zGradient;
}
}
}
}