- Fixed: Wall drawing handled fixed light levels improperly (but did not
completely ignore them, either). - Separated light level fixing out of player_t's fixedcolormap parameter. Using a fixed light level (e.g. PowerTorch) will no longer wipe out colored lighting. - Moved the blending rectangle drawing into a separate discrete stage, since doing it while copying the 3D view window to the display now blends underneath the weapon instead of on top of it. - Consolidated the special colormaps into a single 2D table. - Tweaked the special colormaps slightly to make the true color results more closely match the paletted approximations. - fb_d3d9_shaders.h was getting unwieldy, so I moved the shaders out of the executable and into zdoom.pk3. Shaders are still precompiled so I don't need to pull in a dependancy on D3DX. - Added a few more shaders to accomodate drawing weapons with all the in-game lighting models. These are accessed with the new DrawTexture tags DTA_SpecialColormap and DTA_ColormapStyle. - Player weapon sprites are now drawn using Direct3D and receive all the benefits thereof. SVN r1858 (trunk)
This commit is contained in:
parent
857002e12f
commit
b8eb530a0d
93 changed files with 1188 additions and 1288 deletions
|
|
@ -154,7 +154,7 @@ CVAR(Bool, r_fogboundary, true, 0)
|
|||
|
||||
inline bool IsFogBoundary (sector_t *front, sector_t *back)
|
||||
{
|
||||
return r_fogboundary && !fixedcolormap && front->ColorMap->Fade &&
|
||||
return r_fogboundary && fixedcolormap == NULL && front->ColorMap->Fade &&
|
||||
front->ColorMap->Fade != back->ColorMap->Fade &&
|
||||
(front->GetTexture(sector_t::ceiling) != skyflatnum || back->GetTexture(sector_t::ceiling) != skyflatnum);
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ static void BlastMaskedColumn (void (*blastfunc)(const BYTE *pixels, const FText
|
|||
if (maskedtexturecol[dc_x] != FIXED_MAX)
|
||||
{
|
||||
// calculate lighting
|
||||
if (!fixedcolormap)
|
||||
if (fixedcolormap == NULL && fixedlightlev < 0)
|
||||
{
|
||||
dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -298,9 +298,9 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
}
|
||||
}
|
||||
|
||||
if (fixedlightlev)
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = basecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap)
|
||||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
|
||||
if (!(curline->linedef->flags & ML_WRAP_MIDTEX) &&
|
||||
|
|
@ -453,7 +453,8 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t
|
|||
x = x1;
|
||||
//while ((umost[x] > dmost[x]) && (x <= x2)) x++;
|
||||
|
||||
if (fixedcolormap)
|
||||
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
|
||||
if (fixed)
|
||||
{
|
||||
palookupoffse[0] = dc_colormap;
|
||||
palookupoffse[1] = dc_colormap;
|
||||
|
|
@ -470,7 +471,7 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t
|
|||
assert (y1ve[0] < viewheight);
|
||||
assert (y2ve[0] <= viewheight);
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -505,7 +506,7 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{
|
||||
for (z = 0; z < 4; ++z)
|
||||
{
|
||||
|
|
@ -563,7 +564,7 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t
|
|||
assert (y1ve[0] < viewheight);
|
||||
assert (y2ve[0] <= viewheight);
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -700,7 +701,8 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe
|
|||
x = startx = x1;
|
||||
p = x + dc_destorg;
|
||||
|
||||
if (fixedcolormap)
|
||||
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
|
||||
if (fixed)
|
||||
{
|
||||
palookupoffse[0] = dc_colormap;
|
||||
palookupoffse[1] = dc_colormap;
|
||||
|
|
@ -715,7 +717,7 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe
|
|||
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]);
|
||||
if (y2ve[0] <= y1ve[0]) continue;
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -748,7 +750,7 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{
|
||||
for (z = 0; z < 4; ++z)
|
||||
{
|
||||
|
|
@ -804,7 +806,7 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixe
|
|||
y2ve[0] = dwal[x];
|
||||
if (y2ve[0] <= y1ve[0]) continue;
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -872,7 +874,8 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
|
|||
x = startx = x1;
|
||||
p = x + dc_destorg;
|
||||
|
||||
if (fixedcolormap)
|
||||
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
|
||||
if (fixed)
|
||||
{
|
||||
palookupoffse[0] = dc_colormap;
|
||||
palookupoffse[1] = dc_colormap;
|
||||
|
|
@ -887,7 +890,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
|
|||
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]);
|
||||
if (y2ve[0] <= y1ve[0]) continue;
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -920,7 +923,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{
|
||||
for (z = 0; z < 4; ++z)
|
||||
{
|
||||
|
|
@ -979,7 +982,7 @@ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
|
|||
y2ve[0] = dwal[x];
|
||||
if (y2ve[0] <= y1ve[0]) continue;
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (!fixed)
|
||||
{ // calculate lighting
|
||||
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
|
||||
}
|
||||
|
|
@ -1016,9 +1019,9 @@ void R_RenderSegLoop ()
|
|||
fixed_t xscale, yscale;
|
||||
fixed_t xoffset = rw_offset;
|
||||
|
||||
if (fixedlightlev)
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = basecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap)
|
||||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
|
||||
// clip wall to the floor and ceiling
|
||||
|
|
@ -1087,7 +1090,7 @@ void R_RenderSegLoop ()
|
|||
{
|
||||
rw_offset = rw_offset_mid;
|
||||
}
|
||||
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
|
||||
if (fixedcolormap != NULL || !frontsector->ExtraLights)
|
||||
{
|
||||
wallscan (x1, x2-1, walltop, wallbottom, swall, lwall, yscale);
|
||||
}
|
||||
|
|
@ -1126,7 +1129,7 @@ void R_RenderSegLoop ()
|
|||
{
|
||||
rw_offset = rw_offset_top;
|
||||
}
|
||||
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
|
||||
if (fixedcolormap != NULL || !frontsector->ExtraLights)
|
||||
{
|
||||
wallscan (x1, x2-1, walltop, wallupper, swall, lwall, yscale);
|
||||
}
|
||||
|
|
@ -1168,7 +1171,7 @@ void R_RenderSegLoop ()
|
|||
{
|
||||
rw_offset = rw_offset_bottom;
|
||||
}
|
||||
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
|
||||
if (fixedcolormap != NULL || !frontsector->ExtraLights)
|
||||
{
|
||||
wallscan (x1, x2-1, walllower, wallbottom, swall, lwall, yscale);
|
||||
}
|
||||
|
|
@ -1434,7 +1437,7 @@ void R_NewWall (bool needlights)
|
|||
|
||||
PrepWall (swall, lwall, sidedef->TexelLength * lwallscale);
|
||||
|
||||
if (!fixedcolormap)
|
||||
if (fixedcolormap == NULL && fixedlightlev < 0)
|
||||
{
|
||||
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, frontsector->lightlevel)
|
||||
+ r_actualextralight);
|
||||
|
|
@ -2421,9 +2424,9 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper,
|
|||
bool calclighting = false;
|
||||
|
||||
rw_light = rw_lightleft + (x1 - WallSX1) * rw_lightstep;
|
||||
if (fixedlightlev)
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = basecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap)
|
||||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
else if (!foggy && (decal->RenderFlags & RF_FULLBRIGHT))
|
||||
dc_colormap = basecolormap->Maps;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue