Attempt to make Polymost look closer to the classic renderer in terms of shading and fix a couple of minor things I noticed in the game and editor

git-svn-id: https://svn.eduke32.com/eduke32@200 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-07-02 04:01:28 +00:00
parent a60d159ca2
commit 50474b8e5a
3 changed files with 11 additions and 17 deletions

View File

@ -82,7 +82,7 @@ static double dxb1[MAXWALLSB], dxb2[MAXWALLSB];
#define USEZBUFFER 1 //1:use zbuffer (slow, nice sprite rendering), 0:no zbuffer (fast, bad sprite rendering)
#define LINTERPSIZ 4 //log2 of interpolation size. 4:pretty fast&acceptable quality, 0:best quality/slow!
#define DEPTHDEBUG 0 //1:render distance instead of texture, for debugging only!, 0:default
#define FOGSCALE 0.0000384
#define FOGSCALE 0.0000700
#define PI 3.14159265358979323
static double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdown10x, ghoriz;
@ -3020,7 +3020,7 @@ static void polymost_drawalls (long bunch)
if (((cy0 < ocy0) || (cy1 < ocy1)) && (!((sec->ceilingstat&sector[nextsectnum].ceilingstat)&1)))
{
globalpicnum = wal->picnum; globalshade = wal->shade; globalpal = (long)((unsigned char)wal->pal);
globalpicnum = wal->picnum; globalshade = (wal->shade+2); globalpal = (long)((unsigned char)wal->pal);
if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,wallnum+16384);
if (!(wal->cstat&4)) i = sector[nextsectnum].ceilingz; else i = sec->ceilingz;
@ -3056,7 +3056,7 @@ static void polymost_drawalls (long bunch)
gux += (float)(nwal->xpanning-wal->xpanning)*gdx;
guy += (float)(nwal->xpanning-wal->xpanning)*gdy;
}
globalpicnum = nwal->picnum; globalshade = nwal->shade; globalpal = (long)((unsigned char)nwal->pal);
globalpicnum = nwal->picnum; globalshade = (nwal->shade+2); globalpal = (long)((unsigned char)nwal->pal);
if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,wallnum+16384);
if (!(nwal->cstat&4)) i = sector[nextsectnum].floorz; else i = sec->ceilingz;
@ -3087,7 +3087,7 @@ static void polymost_drawalls (long bunch)
if ((nextsectnum < 0) || (wal->cstat&32)) //White/1-way wall
{
if (nextsectnum < 0) globalpicnum = wal->picnum; else globalpicnum = wal->overpicnum;
globalshade = wal->shade; globalpal = (long)((unsigned char)wal->pal);
globalshade = (wal->shade+2); globalpal = (long)((unsigned char)wal->pal);
if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,wallnum+16384);
if (nextsectnum >= 0) { if (!(wal->cstat&4)) i = nextsec->ceilingz; else i = sec->ceilingz; }
@ -3483,7 +3483,7 @@ void polymost_drawmaskwall (long damaskwallcnt)
globalpicnum = wal->overpicnum; if ((unsigned long)globalpicnum >= MAXTILES) globalpicnum = 0;
if (picanm[globalpicnum]&192) globalpicnum += animateoffs(globalpicnum,(short)thewall[z]+16384);
globalshade = (long)wal->shade;
globalshade = (long)(wal->shade+2);
globalpal = (long)((unsigned char)wal->pal);
globalorientation = (long)wal->cstat;
@ -3667,7 +3667,7 @@ if (tspr->cstat&2) { if (!(tspr->cstat&512)) method = 2+4; else method = 3+4; }
col[2] = (float)palookupfog[sector[tspr->sectnum].floorpal].b / 63.f;
col[3] = 0;
bglFogfv(GL_FOG_COLOR,col); //default is 0,0,0,0
bglFogf(GL_FOG_DENSITY,gvisibility*((float)((unsigned char)(sector[tspr->sectnum].visibility+16))));
bglFogf(GL_FOG_DENSITY,(gvisibility/2)/(globalshade<0?klabs(globalshade):1)*((float)((unsigned char)(sector[tspr->sectnum].visibility+16))));
}
while (rendmode == 3 && !(spriteext[tspr->owner].flags&SPREXT_NOTMD)) {

View File

@ -4439,13 +4439,6 @@ void ExtAnalyzeSprites(void)
tspr->picnum += 8-k;
tspr->cstat |= 4; //set x-flipping bit
}
#if defined(POLYMOST) && defined(USE_OPENGL)
if (bpp > 8 && usemodels && md_tilehasmodel(tspr->picnum)) {
tspr->cstat &= ~4;
break;
}
#endif
}
if(frames==2) tspr->picnum+=((((4-(totalclock>>5)))&1)*5);

View File

@ -2110,7 +2110,6 @@ cheat_for_port_credits:
"Compress disk cache",
"-",
"Models",
"-",
"HUD model perspective",
"-",
"-",
@ -2119,6 +2118,7 @@ cheat_for_port_credits:
"-",
"-",
"-",
"-",
NULL
};
@ -2170,9 +2170,10 @@ cheat_for_port_credits:
case 6: if (x==io) usemodels = 1-usemodels;
modval(0,1,(int *)&usemodels,1,probey==io);
gametextpal(d,yy, usemodels ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 7: if (x==io) glhudcorrect = 1-glhudcorrect;
modval(0,1,(int *)&glhudcorrect,1,probey==io);
gametextpal(d,yy, glhudcorrect ? "Correct" : "Old", MENUHIGHLIGHT(io), 0); break;
case 7: enabled = usemodels;
if (enabled && x==io) glhudcorrect = 1-glhudcorrect;
if (enabled) modval(0,1,(int *)&glhudcorrect,1,probey==io);
gametextpal(d,yy, glhudcorrect ? "Correct" : "Old", enabled?MENUHIGHLIGHT(io):15, 0); break;
default: break;
}
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);