mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-03 07:41:32 +00:00
Render per-texture offsets in Software
This commit is contained in:
parent
fe25c3e9c8
commit
0e24b42c8d
1 changed files with 15 additions and 12 deletions
27
src/r_segs.c
27
src/r_segs.c
|
@ -49,6 +49,7 @@ fixed_t rw_distance;
|
||||||
static INT32 rw_x, rw_stopx;
|
static INT32 rw_x, rw_stopx;
|
||||||
static angle_t rw_centerangle;
|
static angle_t rw_centerangle;
|
||||||
static fixed_t rw_offset;
|
static fixed_t rw_offset;
|
||||||
|
static fixed_t rw_offset_top, rw_offset_mid, rw_offset_bot;
|
||||||
static fixed_t rw_offset2; // for splats
|
static fixed_t rw_offset2; // for splats
|
||||||
static fixed_t rw_scale, rw_scalestep;
|
static fixed_t rw_scale, rw_scalestep;
|
||||||
static fixed_t rw_midtexturemid, rw_toptexturemid, rw_bottomtexturemid;
|
static fixed_t rw_midtexturemid, rw_toptexturemid, rw_bottomtexturemid;
|
||||||
|
@ -778,7 +779,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
|
|
||||||
if (newline)
|
if (newline)
|
||||||
{
|
{
|
||||||
offsetvalue = sides[newline->sidenum[0]].rowoffset;
|
offsetvalue = sides[newline->sidenum[0]].rowoffset + sides[newline->sidenum[0]].offsety_mid;
|
||||||
if (newline->flags & ML_DONTPEGBOTTOM)
|
if (newline->flags & ML_DONTPEGBOTTOM)
|
||||||
{
|
{
|
||||||
skewslope = *pfloor->b_slope; // skew using bottom slope
|
skewslope = *pfloor->b_slope; // skew using bottom slope
|
||||||
|
@ -790,7 +791,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset;
|
offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset + sides[pfloor->master->sidenum[0]].offsety_mid;
|
||||||
if (curline->linedef->flags & ML_DONTPEGBOTTOM)
|
if (curline->linedef->flags & ML_DONTPEGBOTTOM)
|
||||||
{
|
{
|
||||||
skewslope = *pfloor->b_slope; // skew using bottom slope
|
skewslope = *pfloor->b_slope; // skew using bottom slope
|
||||||
|
@ -1335,7 +1336,7 @@ static void R_RenderSegLoop (void)
|
||||||
dc_yl = yl;
|
dc_yl = yl;
|
||||||
dc_yh = yh;
|
dc_yh = yh;
|
||||||
dc_texturemid = rw_midtexturemid;
|
dc_texturemid = rw_midtexturemid;
|
||||||
dc_source = R_GetColumn(midtexture,texturecolumn);
|
dc_source = R_GetColumn(midtexture,texturecolumn + (rw_offset_mid>>FRACBITS));
|
||||||
dc_texheight = textureheight[midtexture]>>FRACBITS;
|
dc_texheight = textureheight[midtexture]>>FRACBITS;
|
||||||
|
|
||||||
//profile stuff ---------------------------------------------------------
|
//profile stuff ---------------------------------------------------------
|
||||||
|
@ -1396,7 +1397,7 @@ static void R_RenderSegLoop (void)
|
||||||
dc_yl = yl;
|
dc_yl = yl;
|
||||||
dc_yh = mid;
|
dc_yh = mid;
|
||||||
dc_texturemid = rw_toptexturemid;
|
dc_texturemid = rw_toptexturemid;
|
||||||
dc_source = R_GetColumn(toptexture,texturecolumn);
|
dc_source = R_GetColumn(toptexture,texturecolumn + (rw_offset_top>>FRACBITS));
|
||||||
dc_texheight = textureheight[toptexture]>>FRACBITS;
|
dc_texheight = textureheight[toptexture]>>FRACBITS;
|
||||||
colfunc();
|
colfunc();
|
||||||
ceilingclip[rw_x] = (INT16)mid;
|
ceilingclip[rw_x] = (INT16)mid;
|
||||||
|
@ -1432,8 +1433,7 @@ static void R_RenderSegLoop (void)
|
||||||
dc_yl = mid;
|
dc_yl = mid;
|
||||||
dc_yh = yh;
|
dc_yh = yh;
|
||||||
dc_texturemid = rw_bottomtexturemid;
|
dc_texturemid = rw_bottomtexturemid;
|
||||||
dc_source = R_GetColumn(bottomtexture,
|
dc_source = R_GetColumn(bottomtexture, texturecolumn + (rw_offset_bot>>FRACBITS));
|
||||||
texturecolumn);
|
|
||||||
dc_texheight = textureheight[bottomtexture]>>FRACBITS;
|
dc_texheight = textureheight[bottomtexture]>>FRACBITS;
|
||||||
colfunc();
|
colfunc();
|
||||||
floorclip[rw_x] = (INT16)mid;
|
floorclip[rw_x] = (INT16)mid;
|
||||||
|
@ -1452,7 +1452,7 @@ static void R_RenderSegLoop (void)
|
||||||
{
|
{
|
||||||
// save texturecol
|
// save texturecol
|
||||||
// for backdrawing of masked mid texture
|
// for backdrawing of masked mid texture
|
||||||
maskedtexturecol[rw_x] = (INT16)texturecolumn;
|
maskedtexturecol[rw_x] = (INT16)(texturecolumn + (rw_offset_mid>>FRACBITS));
|
||||||
|
|
||||||
if (maskedtextureheight != NULL) {
|
if (maskedtextureheight != NULL) {
|
||||||
maskedtextureheight[rw_x] = (curline->linedef->flags & ML_MIDPEG) ?
|
maskedtextureheight[rw_x] = (curline->linedef->flags & ML_MIDPEG) ?
|
||||||
|
@ -1783,7 +1783,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
rw_midtexturemid = worldtop;
|
rw_midtexturemid = worldtop;
|
||||||
rw_midtextureslide = ceilingfrontslide;
|
rw_midtextureslide = ceilingfrontslide;
|
||||||
}
|
}
|
||||||
rw_midtexturemid += sidedef->rowoffset;
|
rw_midtexturemid += sidedef->rowoffset + sidedef->offsety_mid;
|
||||||
|
|
||||||
ds_p->silhouette = SIL_BOTH;
|
ds_p->silhouette = SIL_BOTH;
|
||||||
ds_p->sprtopclip = screenheightarray;
|
ds_p->sprtopclip = screenheightarray;
|
||||||
|
@ -2022,8 +2022,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rw_toptexturemid += sidedef->rowoffset;
|
rw_toptexturemid += sidedef->rowoffset + sidedef->offsety_top;
|
||||||
rw_bottomtexturemid += sidedef->rowoffset;
|
rw_bottomtexturemid += sidedef->rowoffset + sidedef->offsety_bot;
|
||||||
|
|
||||||
// allocate space for masked texture tables
|
// allocate space for masked texture tables
|
||||||
if (frontsector && backsector && !Tag_Compare(&frontsector->tags, &backsector->tags) && (backsector->ffloors || frontsector->ffloors))
|
if (frontsector && backsector && !Tag_Compare(&frontsector->tags, &backsector->tags) && (backsector->ffloors || frontsector->ffloors))
|
||||||
|
@ -2266,8 +2266,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
rw_midtexturebackslide = ceilingbackslide;
|
rw_midtexturebackslide = ceilingbackslide;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rw_midtexturemid += sidedef->rowoffset;
|
rw_midtexturemid += sidedef->rowoffset + sidedef->offsety_mid;
|
||||||
rw_midtextureback += sidedef->rowoffset;
|
rw_midtextureback += sidedef->rowoffset + sidedef->offsety_mid;
|
||||||
|
|
||||||
maskedtexture = true;
|
maskedtexture = true;
|
||||||
}
|
}
|
||||||
|
@ -2305,6 +2305,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
/// don't use texture offset for splats
|
/// don't use texture offset for splats
|
||||||
rw_offset2 = rw_offset + curline->offset;
|
rw_offset2 = rw_offset + curline->offset;
|
||||||
rw_offset += sidedef->textureoffset + curline->offset;
|
rw_offset += sidedef->textureoffset + curline->offset;
|
||||||
|
rw_offset_top = sidedef->offsetx_top;
|
||||||
|
rw_offset_mid = sidedef->offsetx_mid;
|
||||||
|
rw_offset_bot = sidedef->offsetx_bot;
|
||||||
rw_centerangle = ANGLE_90 + viewangle - rw_normalangle;
|
rw_centerangle = ANGLE_90 + viewangle - rw_normalangle;
|
||||||
|
|
||||||
// calculate light table
|
// calculate light table
|
||||||
|
|
Loading…
Reference in a new issue