mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-18 01:21:32 +00:00
Fix wall scroller direction
This commit is contained in:
parent
2a71ec89de
commit
5ef8ecce2a
1 changed files with 11 additions and 42 deletions
|
@ -163,31 +163,15 @@ namespace swrenderer
|
||||||
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);
|
||||||
|
|
||||||
if (xrepeat < 0.0f)
|
for (int x = x1; x < x2; x++)
|
||||||
{
|
{
|
||||||
for (int x = x1; x < x2; x++)
|
float u = uOverZ / invZ;
|
||||||
{
|
|
||||||
float u = uOverZ / invZ;
|
|
||||||
|
|
||||||
UPos[x] = (fixed_t)((xrepeat - u * xrepeat) * FRACUNIT);
|
UPos[x] = (fixed_t)(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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,29 +185,14 @@ namespace swrenderer
|
||||||
float zGradient = WallT.InvZstep;
|
float zGradient = WallT.InvZstep;
|
||||||
float xrepeat = (float)walxrepeat;
|
float xrepeat = (float)walxrepeat;
|
||||||
|
|
||||||
if (xrepeat < 0.0f)
|
for (int x = x1; x < x2; x++)
|
||||||
{
|
{
|
||||||
for (int x = x1; x < x2; x++)
|
float u = uOverZ / invZ * xrepeat;
|
||||||
{
|
|
||||||
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