Really fix concave relative slopes.

git-svn-id: https://svn.eduke32.com/eduke32@1335 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-04-19 18:00:51 +00:00
parent 9241ab974a
commit e48c4c2c87

View file

@ -1651,13 +1651,8 @@ static int32_t polymer_updatesector(int16_t sectnum)
// relative texturing // relative texturing
if (curstat & 64) if (curstat & 64)
{ {
// absolute distance for walls "behind" the first wall (concave sectors)
xpancoef = wal->x - wall[sec->wallptr].x; xpancoef = wal->x - wall[sec->wallptr].x;
if (xpancoef < 0)
xpancoef = -xpancoef;
ypancoef = wall[sec->wallptr].y - wal->y; ypancoef = wall[sec->wallptr].y - wal->y;
if (ypancoef < 0)
ypancoef = -ypancoef;
tex = xpancoef * secangsin + ypancoef * secangcos; tex = xpancoef * secangsin + ypancoef * secangcos;
tey = xpancoef * secangcos - ypancoef * secangsin; tey = xpancoef * secangcos - ypancoef * secangsin;
@ -1669,7 +1664,11 @@ static int32_t polymer_updatesector(int16_t sectnum)
if ((curstat & (2+64)) == (2+64)) if ((curstat & (2+64)) == (2+64))
{ {
heidiff = curbuffer[(i*5)+1] - curbuffer[1]; heidiff = curbuffer[(i*5)+1] - curbuffer[1];
tey = sqrt((tey * tey) + (heidiff * heidiff)); // don't forget the sign, tey could be negative with concave sectors
if (tey >= 0)
tey = sqrt((tey * tey) + (heidiff * heidiff));
else
tey = -sqrt((tey * tey) + (heidiff * heidiff));
} }
if (curstat & 4) if (curstat & 4)