mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
Something in R_RenderSegLoop I thought looked off...
This commit is contained in:
parent
6f5a259983
commit
69e9784085
1 changed files with 14 additions and 14 deletions
28
src/r_segs.c
28
src/r_segs.c
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue