Fixes palette/shade for swapped underwalls (toxic waterfall in The Abyss).

git-svn-id: https://svn.eduke32.com/eduke32@720 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2008-04-29 04:46:06 +00:00
parent 6c11addc08
commit 6b0f2d5956
2 changed files with 25 additions and 12 deletions

View file

@ -2,7 +2,6 @@
// TODO :
// - CORE STUFF
// o put all the sector/wall geometry in VBOs
// o wall palette problem (toxic waterfall in the abyss is blue)
// o there's also the texture alignment problem Hunter reported (san andreas fault)
// o also sliding doors are still fucked up sometimes (like under the bar in E1L2)
// o port glowmaps and detail maps from hacked polymost (:(

View file

@ -1311,7 +1311,8 @@ static int polymer_initwall(short wallnum)
static void polymer_updatewall(short wallnum)
{
short nwallnum, nnwallnum, curpicnum, wallpicnum, walloverpicnum, nwallpicnum;
char curxpanning, curypanning, underwall, overwall;
char curxpanning, curypanning, underwall, overwall, curpal;
signed char curshade;
walltype *wal;
sectortype *sec, *nsec;
_prwall *w;
@ -1400,9 +1401,6 @@ static void polymer_updatewall(short wallnum)
w->underover = underwall = overwall = 0;
w->wallcolor[0] = w->wallcolor[1] = w->wallcolor[2] = ((float)(numpalookups-min(max(wal->shade,0),numpalookups)))/((float)numpalookups);
w->wallcolor[3] = 1.0f;
if (wal->cstat & 8)
xref = 1;
else
@ -1428,6 +1426,10 @@ static void polymer_updatewall(short wallnum)
else
w->wallfbglpic = 0;
w->wallcolor[0] = w->wallcolor[1] = w->wallcolor[2] =
((float)(numpalookups-min(max(wal->shade,0),numpalookups)))/((float)numpalookups);
w->wallcolor[3] = 1.0f;
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
{
w->wallcolor[0] *= (float)hictinting[wal->pal].r / 255.0;
@ -1496,12 +1498,16 @@ static void polymer_updatewall(short wallnum)
if (wal->cstat & 2)
{
curpicnum = nwallpicnum;
curpal = wall[nwallnum].pal;
curshade = wall[nwallnum].shade;
curxpanning = wall[nwallnum].xpanning;
curypanning = wall[nwallnum].ypanning;
}
else
{
curpicnum = wallpicnum;
curpal = wal->pal;
curshade = wal->shade;
curxpanning = wal->xpanning;
curypanning = wal->ypanning;
}
@ -1509,7 +1515,7 @@ static void polymer_updatewall(short wallnum)
if (!waloff[curpicnum])
loadtile(curpicnum);
pth = gltexcache(curpicnum, wal->pal, 0);
pth = gltexcache(curpicnum, curpal, 0);
w->wallglpic = pth ? pth->glpic : 0;
if (pth && (pth->flags & 16))
@ -1517,11 +1523,15 @@ static void polymer_updatewall(short wallnum)
else
w->wallfbglpic = 0;
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
w->wallcolor[0] = w->wallcolor[1] = w->wallcolor[2] =
((float)(numpalookups-min(max(curshade,0),numpalookups)))/((float)numpalookups);
w->wallcolor[3] = 1.0f;
if (pth && (pth->flags & 2) && (pth->palnum != curpal))
{
w->wallcolor[0] *= (float)hictinting[wal->pal].r / 255.0;
w->wallcolor[1] *= (float)hictinting[wal->pal].g / 255.0;
w->wallcolor[2] *= (float)hictinting[wal->pal].b / 255.0;
w->wallcolor[0] *= (float)hictinting[curpal].r / 255.0;
w->wallcolor[1] *= (float)hictinting[curpal].g / 255.0;
w->wallcolor[2] *= (float)hictinting[curpal].b / 255.0;
}
if ((!(wal->cstat & 2) && (wal->cstat & 4)) || ((wal->cstat & 2) && (wall[nwallnum].cstat & 4)))
@ -1603,7 +1613,9 @@ static void polymer_updatewall(short wallnum)
pth = gltexcache(wal->overpicnum, wal->pal, 0);
w->maskglpic = pth ? pth->glpic : 0;
memcpy(w->maskcolor, w->wallcolor, sizeof(GLfloat) * 3);
w->maskcolor[0] = w->maskcolor[1] = w->maskcolor[2] =
((float)(numpalookups-min(max(wal->shade,0),numpalookups)))/((float)numpalookups);
w->maskcolor[3] = 1.0f;
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
{
@ -1630,7 +1642,9 @@ static void polymer_updatewall(short wallnum)
else
w->overfbglpic = 0;
memcpy(w->overcolor, w->wallcolor, sizeof(GLfloat) * 4);
w->overcolor[0] = w->overcolor[1] = w->overcolor[2] =
((float)(numpalookups-min(max(wal->shade,0),numpalookups)))/((float)numpalookups);
w->overcolor[3] = 1.0f;
if (pth && (pth->flags & 2) && (pth->palnum != wal->pal))
{