Skip to content
Snippets Groups Projects
Commit 69e97840 authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Something in R_RenderSegLoop I thought looked off...

parent 6f5a2599
No related branches found
No related tags found
2 merge requests!734Rebase Keycodes only branch.,!578Software clownery
......@@ -1349,7 +1349,7 @@ UINT32 nombre = 100000;
static void R_RenderSegLoop (void)
{
angle_t angle;
size_t pindex;
size_t pindex = 0;
INT32 yl;
INT32 yh;
......@@ -1362,6 +1362,10 @@ static void R_RenderSegLoop (void)
INT32 bottom;
INT32 i;
// Set the shadowed column drawer for light lists.
if (dc_numlights)
colfunc = colfuncs[COLDRAWFUNC_SHADOWED];
for (; rw_x < rw_stopx; rw_x++)
{
// mark floor / ceiling areas
......@@ -1472,6 +1476,15 @@ static void R_RenderSegLoop (void)
}
}
// Calculate lighting.
// Done for light lists anyway to avoid doing it for every light.
if (segtextured || dc_numlights)
{
pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE-1;
}
//SoM: Calculate offsets for Thick fake floors.
// calculate texture offset
angle = (rw_centerangle + xtoviewangle[rw_x])>>ANGLETOFINESHIFT;
......@@ -1492,12 +1505,6 @@ static void R_RenderSegLoop (void)
// texturecolumn and lighting are independent of wall tiers
if (segtextured)
{
// calculate lighting
pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE-1;
dc_colormap = walllights[pindex];
dc_x = rw_x;
dc_iscale = 0xffffffffu / (unsigned)rw_scale;
......@@ -1528,17 +1535,10 @@ static void R_RenderSegLoop (void)
else
xwalllights = scalelight[lightnum];
pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE-1;
if (dc_lightlist[i].extra_colormap)
dc_lightlist[i].rcolormap = dc_lightlist[i].extra_colormap->colormap + (xwalllights[pindex] - colormaps);
else
dc_lightlist[i].rcolormap = xwalllights[pindex];
colfunc = colfuncs[COLDRAWFUNC_SHADOWED];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment