mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Fixes a texturing bug with a combination of relative texturing and concave sectors.
git-svn-id: https://svn.eduke32.com/eduke32@1333 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ed7157f1e5
commit
711db577ab
1 changed files with 16 additions and 2 deletions
|
@ -1648,9 +1648,23 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
secangsin = (float)(sintable[ang&2047]) / 16383.0f;
|
secangsin = (float)(sintable[ang&2047]) / 16383.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// relative texturing
|
||||||
|
if (curstat & 64)
|
||||||
|
{
|
||||||
|
// absolute distance for walls "behind" the first wall (concave sectors)
|
||||||
|
xpancoef = wal->x - wall[sec->wallptr].x;
|
||||||
|
if (xpancoef < 0)
|
||||||
|
xpancoef = -xpancoef;
|
||||||
|
ypancoef = wall[sec->wallptr].y - wal->y;
|
||||||
|
if (ypancoef < 0)
|
||||||
|
ypancoef = -ypancoef;
|
||||||
|
|
||||||
tex = (curstat & 64) ? ((wal->x - wall[sec->wallptr].x) * secangsin) + ((-wal->y - -wall[sec->wallptr].y) * secangcos) : wal->x;
|
tex = xpancoef * secangsin + ypancoef * secangcos;
|
||||||
tey = (curstat & 64) ? ((wal->x - wall[sec->wallptr].x) * secangcos) - ((wall[sec->wallptr].y - wal->y) * secangsin) : -wal->y;
|
tey = xpancoef * secangcos - ypancoef * secangsin;
|
||||||
|
} else {
|
||||||
|
tex = wal->x;
|
||||||
|
tey = -wal->y;
|
||||||
|
}
|
||||||
|
|
||||||
if ((curstat & (2+64)) == (2+64))
|
if ((curstat & (2+64)) == (2+64))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue