Merge branch 'horizon-line-update' into 'master'

Horizon line apply to FOFs backport

See merge request KartKrew/Kart!225
This commit is contained in:
Sal 2020-03-28 00:28:37 -04:00
commit 5dad8d125a
3 changed files with 20 additions and 7 deletions

View file

@ -2023,7 +2023,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
// Single sided line... Deal only with the middletexture (if one exists)
gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture);
if (gr_midtexture
&& gr_linedef->special != 41) // Ignore horizon line for OGL
&& gr_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL
{
{
fixed_t texturevpeg;

View file

@ -406,6 +406,8 @@ typedef enum
ST_NEGATIVE
} slopetype_t;
#define HORIZONSPECIAL 41
typedef struct line_s
{
// Vertices, from v1 to v2.

View file

@ -2687,7 +2687,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
worldbottomslope >>= 4;
#endif
if (linedef->special == 41) { // HORIZON LINES
if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES
topstep = bottomstep = 0;
topfrac = bottomfrac = (centeryfrac>>4);
topfrac++; // Prevent 1px HOM
@ -2817,12 +2817,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ffloor[i].f_pos >>= 4;
#ifdef ESLOPE
ffloor[i].f_pos_slope >>= 4;
ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
ffloor[i].f_step = ((centeryfrac>>4) - FixedMul(ffloor[i].f_pos_slope, ds_p->scale2) - ffloor[i].f_frac)/(range);
#else
ffloor[i].f_step = FixedMul(-rw_scalestep, ffloor[i].f_pos);
ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
#endif
if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too.
{
ffloor[i].f_step = 0;
ffloor[i].f_frac = (centeryfrac>>4);
topfrac++; // Prevent 1px HOM
}
else
{
#ifdef ESLOPE
ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
ffloor[i].f_step = ((centeryfrac>>4) - FixedMul(ffloor[i].f_pos_slope, ds_p->scale2) - ffloor[i].f_frac)/(range);
#else
ffloor[i].f_step = FixedMul(-rw_scalestep, ffloor[i].f_pos);
ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
#endif
}
}
}