mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-27 06:11:46 +00:00
Change wall project to use the fixed version from GZDoom as it was most likely more tested
This commit is contained in:
parent
fc97ef0913
commit
01cbb14f14
1 changed files with 44 additions and 13 deletions
|
@ -159,19 +159,35 @@ namespace swrenderer
|
||||||
float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - viewport->CenterX);
|
float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - viewport->CenterX);
|
||||||
float uGradient = WallT.UoverZstep;
|
float uGradient = WallT.UoverZstep;
|
||||||
float zGradient = WallT.InvZstep;
|
float zGradient = WallT.InvZstep;
|
||||||
float xrepeat = (float)walxrepeat;
|
float xrepeat = (float)fabs(walxrepeat);
|
||||||
float depthScale = (float)(WallT.InvZstep * viewport->WallTMapScale2);
|
float depthScale = (float)(WallT.InvZstep * viewport->WallTMapScale2);
|
||||||
float depthOrg = (float)(-WallT.UoverZstep * 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);
|
UPos[x] = (fixed_t)((xrepeat - u * xrepeat) * FRACUNIT);
|
||||||
VStep[x] = depthOrg + u * depthScale;
|
VStep[x] = depthOrg + u * depthScale;
|
||||||
|
|
||||||
uOverZ += uGradient;
|
uOverZ += uGradient;
|
||||||
invZ += zGradient;
|
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 invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - viewport->CenterX);
|
||||||
float uGradient = WallT.UoverZstep;
|
float uGradient = WallT.UoverZstep;
|
||||||
float zGradient = WallT.InvZstep;
|
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;
|
uOverZ += uGradient;
|
||||||
invZ += zGradient;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue