mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Make FWallCoords' members lowercase
because they're kind of a pain to type when all uppercase. - Also, make its sx1 and sx2 members shorts, so it takes less space, since it's getting crammed into a vissprite now.
This commit is contained in:
parent
1d02ad3aa2
commit
e1ee80661e
4 changed files with 147 additions and 147 deletions
|
@ -408,7 +408,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
|
|||
rw_frontcz2 <= s->floorplane.ZatPoint (curline->v2->x, curline->v2->y))
|
||||
{
|
||||
// Check that the window is actually visible
|
||||
for (int z = WallC.SX1; z < WallC.SX2; ++z)
|
||||
for (int z = WallC.sx1; z < WallC.sx2; ++z)
|
||||
{
|
||||
if (floorclip[z] > ceilingclip[z])
|
||||
{
|
||||
|
@ -541,12 +541,12 @@ void R_AddLine (seg_t *line)
|
|||
if (WallC.Init(tx1, ty1, tx2, ty2, 32))
|
||||
return;
|
||||
|
||||
if (WallC.SX1 > WindowRight || WallC.SX2 < WindowLeft)
|
||||
if (WallC.sx1 > WindowRight || WallC.sx2 < WindowLeft)
|
||||
return;
|
||||
|
||||
if (line->linedef == NULL)
|
||||
{
|
||||
if (R_CheckClipWallSegment (WallC.SX1, WallC.SX2))
|
||||
if (R_CheckClipWallSegment (WallC.sx1, WallC.sx2))
|
||||
{
|
||||
InSubsector->flags |= SSECF_DRAWN;
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ void R_AddLine (seg_t *line)
|
|||
// mark their subsectors as visible for automap texturing.
|
||||
if (hasglnodes && !(InSubsector->flags & SSECF_DRAWN))
|
||||
{
|
||||
if (R_CheckClipWallSegment(WallC.SX1, WallC.SX2))
|
||||
if (R_CheckClipWallSegment(WallC.sx1, WallC.sx2))
|
||||
{
|
||||
InSubsector->flags |= SSECF_DRAWN;
|
||||
}
|
||||
|
@ -709,8 +709,8 @@ void R_AddLine (seg_t *line)
|
|||
if (line->linedef->special == Line_Horizon)
|
||||
{
|
||||
// Be aware: Line_Horizon does not work properly with sloped planes
|
||||
clearbufshort (walltop+WallC.SX1, WallC.SX2 - WallC.SX1, centery);
|
||||
clearbufshort (wallbottom+WallC.SX1, WallC.SX2 - WallC.SX1, centery);
|
||||
clearbufshort (walltop+WallC.sx1, WallC.sx2 - WallC.sx1, centery);
|
||||
clearbufshort (wallbottom+WallC.sx1, WallC.sx2 - WallC.sx1, centery);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -735,7 +735,7 @@ void R_AddLine (seg_t *line)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (R_ClipWallSegment (WallC.SX1, WallC.SX2, solid))
|
||||
if (R_ClipWallSegment (WallC.sx1, WallC.sx2, solid))
|
||||
{
|
||||
InSubsector->flags |= SSECF_DRAWN;
|
||||
}
|
||||
|
@ -748,58 +748,58 @@ void R_AddLine (seg_t *line)
|
|||
//
|
||||
bool FWallCoords::Init(int x1, int y1, int x2, int y2, int too_close)
|
||||
{
|
||||
TX1 = DMulScale20(x1, viewsin, -y1, viewcos);
|
||||
TX2 = DMulScale20(x2, viewsin, -y2, viewcos);
|
||||
tx1 = DMulScale20(x1, viewsin, -y1, viewcos);
|
||||
tx2 = DMulScale20(x2, viewsin, -y2, viewcos);
|
||||
|
||||
TY1 = DMulScale20(x1, viewtancos, y1, viewtansin);
|
||||
TY2 = DMulScale20(x2, viewtancos, y2, viewtansin);
|
||||
ty1 = DMulScale20(x1, viewtancos, y1, viewtansin);
|
||||
ty2 = DMulScale20(x2, viewtancos, y2, viewtansin);
|
||||
|
||||
if (MirrorFlags & RF_XFLIP)
|
||||
{
|
||||
int t = 256 - TX1;
|
||||
TX1 = 256 - TX2;
|
||||
TX2 = t;
|
||||
swapvalues(TY1, TY2);
|
||||
int t = 256 - tx1;
|
||||
tx1 = 256 - tx2;
|
||||
tx2 = t;
|
||||
swapvalues(ty1, ty2);
|
||||
}
|
||||
|
||||
if (TX1 >= -TY1)
|
||||
if (tx1 >= -ty1)
|
||||
{
|
||||
if (TX1 > TY1) return true; // left edge is off the right side
|
||||
if (TY1 == 0) return true;
|
||||
SX1 = (centerxfrac + Scale(TX1, centerxfrac, TY1)) >> FRACBITS;
|
||||
if (TX1 >= 0) SX1 = MIN(viewwidth, SX1+1); // fix for signed divide
|
||||
SZ1 = TY1;
|
||||
if (tx1 > ty1) return true; // left edge is off the right side
|
||||
if (ty1 == 0) return true;
|
||||
sx1 = (centerxfrac + Scale(tx1, centerxfrac, ty1)) >> FRACBITS;
|
||||
if (tx1 >= 0) sx1 = MIN(viewwidth, sx1+1); // fix for signed divide
|
||||
sz1 = ty1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TX2 < -TY2) return true; // wall is off the left side
|
||||
fixed_t den = TX1 - TX2 - TY2 + TY1;
|
||||
if (tx2 < -ty2) return true; // wall is off the left side
|
||||
fixed_t den = tx1 - tx2 - ty2 + ty1;
|
||||
if (den == 0) return true;
|
||||
SX1 = 0;
|
||||
SZ1 = TY1 + Scale(TY2 - TY1, TX1 + TY1, den);
|
||||
sx1 = 0;
|
||||
sz1 = ty1 + Scale(ty2 - ty1, tx1 + ty1, den);
|
||||
}
|
||||
|
||||
if (SZ1 < too_close)
|
||||
if (sz1 < too_close)
|
||||
return true;
|
||||
|
||||
if (TX2 <= TY2)
|
||||
if (tx2 <= ty2)
|
||||
{
|
||||
if (TX2 < -TY2) return true; // right edge is off the left side
|
||||
if (TY2 == 0) return true;
|
||||
SX2 = (centerxfrac + Scale(TX2, centerxfrac, TY2)) >> FRACBITS;
|
||||
if (TX2 >= 0) SX2 = MIN(viewwidth, SX2+1); // fix for signed divide
|
||||
SZ2 = TY2;
|
||||
if (tx2 < -ty2) return true; // right edge is off the left side
|
||||
if (ty2 == 0) return true;
|
||||
sx2 = (centerxfrac + Scale(tx2, centerxfrac, ty2)) >> FRACBITS;
|
||||
if (tx2 >= 0) sx2 = MIN(viewwidth, sx2+1); // fix for signed divide
|
||||
sz2 = ty2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TX1 > TY1) return true; // wall is off the right side
|
||||
fixed_t den = TY2 - TY1 - TX2 + TX1;
|
||||
if (tx1 > ty1) return true; // wall is off the right side
|
||||
fixed_t den = ty2 - ty1 - tx2 + tx1;
|
||||
if (den == 0) return true;
|
||||
SX2 = viewwidth;
|
||||
SZ2 = TY1 + Scale(TY2 - TY1, TX1 - TY1, den);
|
||||
sx2 = viewwidth;
|
||||
sz2 = ty1 + Scale(ty2 - ty1, tx1 - ty1, den);
|
||||
}
|
||||
|
||||
if (SZ2 < too_close || SX2 <= SX1)
|
||||
if (sz2 < too_close || sx2 <= sx1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -809,17 +809,17 @@ void FWallTmapVals::InitFromWallCoords(const FWallCoords *wallc)
|
|||
{
|
||||
if (MirrorFlags & RF_XFLIP)
|
||||
{
|
||||
UoverZorg = (float)wallc->TX2 * WallTMapScale;
|
||||
UoverZstep = (float)(-wallc->TY2) * 32.f;
|
||||
InvZorg = (float)(wallc->TX2 - wallc->TX1) * WallTMapScale;
|
||||
InvZstep = (float)(wallc->TY1 - wallc->TY2) * 32.f;
|
||||
UoverZorg = (float)wallc->tx2 * WallTMapScale;
|
||||
UoverZstep = (float)(-wallc->ty2) * 32.f;
|
||||
InvZorg = (float)(wallc->tx2 - wallc->tx1) * WallTMapScale;
|
||||
InvZstep = (float)(wallc->ty1 - wallc->ty2) * 32.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
UoverZorg = (float)wallc->TX1 * WallTMapScale;
|
||||
UoverZstep = (float)(-wallc->TY1) * 32.f;
|
||||
InvZorg = (float)(wallc->TX1 - wallc->TX2) * WallTMapScale;
|
||||
InvZstep = (float)(wallc->TY2 - wallc->TY1) * 32.f;
|
||||
UoverZorg = (float)wallc->tx1 * WallTMapScale;
|
||||
UoverZstep = (float)(-wallc->ty1) * 32.f;
|
||||
InvZorg = (float)(wallc->tx1 - wallc->tx2) * WallTMapScale;
|
||||
InvZstep = (float)(wallc->ty2 - wallc->ty1) * 32.f;
|
||||
}
|
||||
InitDepth();
|
||||
}
|
||||
|
|
12
src/r_bsp.h
12
src/r_bsp.h
|
@ -33,14 +33,14 @@
|
|||
|
||||
struct FWallCoords
|
||||
{
|
||||
fixed_t TX1, TX2; // x coords at left, right of wall in view space
|
||||
fixed_t TY1, TY2; // y coords at left, right of wall in view space
|
||||
fixed_t tx1, tx2; // x coords at left, right of wall in view space
|
||||
fixed_t ty1, ty2; // y coords at left, right of wall in view space
|
||||
|
||||
fixed_t CX1, CX2; // x coords at left, right of wall in camera space
|
||||
fixed_t CY1, CY2; // y coords at left, right of wall in camera space
|
||||
fixed_t cx1, cx2; // x coords at left, right of wall in camera space
|
||||
fixed_t cy1, cy2; // y coords at left, right of wall in camera space
|
||||
|
||||
int SX1, SX2; // x coords at left, right of wall in screen space
|
||||
fixed_t SZ1, SZ2; // depth at left, right of wall in screen space
|
||||
short sx1, sx2; // x coords at left, right of wall in screen space
|
||||
fixed_t sz1, sz2; // depth at left, right of wall in screen space
|
||||
|
||||
bool Init(int x1, int y1, int x2, int y2, int too_close);
|
||||
};
|
||||
|
|
180
src/r_segs.cpp
180
src/r_segs.cpp
|
@ -376,10 +376,10 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
goto clearfog;
|
||||
}
|
||||
|
||||
WallC.SZ1 = ds->sz1;
|
||||
WallC.SZ2 = ds->sz2;
|
||||
WallC.SX1 = ds->sx1;
|
||||
WallC.SX2 = ds->sx2;
|
||||
WallC.sz1 = ds->sz1;
|
||||
WallC.sz2 = ds->sz2;
|
||||
WallC.sx1 = ds->sx1;
|
||||
WallC.sx2 = ds->sx2;
|
||||
|
||||
if (fake3D & FAKE3D_CLIPTOP)
|
||||
{
|
||||
|
@ -467,10 +467,10 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
}
|
||||
else
|
||||
{ // Texture does wrap vertically.
|
||||
WallC.SZ1 = ds->sz1;
|
||||
WallC.SZ2 = ds->sz2;
|
||||
WallC.SX1 = ds->sx1;
|
||||
WallC.SX2 = ds->sx2;
|
||||
WallC.sz1 = ds->sz1;
|
||||
WallC.sz2 = ds->sz2;
|
||||
WallC.sx1 = ds->sx1;
|
||||
WallC.sx2 = ds->sx2;
|
||||
|
||||
if (CurrentSkybox)
|
||||
{ // Midtex clipping doesn't work properly with skyboxes, since you're normally below the floor
|
||||
|
@ -587,14 +587,14 @@ void R_RenderFakeWall(drawseg_t *ds, int x1, int x2, F3DFloor *rover)
|
|||
else if (fixedcolormap != NULL)
|
||||
dc_colormap = fixedcolormap;
|
||||
|
||||
WallC.SZ1 = ds->sz1;
|
||||
WallC.SZ2 = ds->sz2;
|
||||
WallC.SX1 = ds->sx1;
|
||||
WallC.SX2 = ds->sx2;
|
||||
WallC.TX1 = ds->cx;
|
||||
WallC.TY1 = ds->cy;
|
||||
WallC.TX2 = ds->cx + ds->cdx;
|
||||
WallC.TY2 = ds->cy + ds->cdy;
|
||||
WallC.sz1 = ds->sz1;
|
||||
WallC.sz2 = ds->sz2;
|
||||
WallC.sx1 = ds->sx1;
|
||||
WallC.sx2 = ds->sx2;
|
||||
WallC.tx1 = ds->cx;
|
||||
WallC.ty1 = ds->cy;
|
||||
WallC.tx2 = ds->cx + ds->cdx;
|
||||
WallC.ty2 = ds->cy + ds->cdy;
|
||||
WallT = ds->tmapvals;
|
||||
|
||||
OWallMost(wallupper, sclipTop - viewz, &WallC);
|
||||
|
@ -1209,8 +1209,8 @@ void wallscan_striped (int x1, int x2, short *uwal, short *dwal, fixed_t *swal,
|
|||
up = uwal;
|
||||
down = most1;
|
||||
|
||||
assert(WallC.SX1 <= x1);
|
||||
assert(WallC.SX2 > x2);
|
||||
assert(WallC.sx1 <= x1);
|
||||
assert(WallC.sx2 > x2);
|
||||
|
||||
// kg3D - fake floors instead of zdoom light list
|
||||
for (unsigned int i = 0; i < frontsector->e->XFloor.lightlist.Size(); i++)
|
||||
|
@ -1821,7 +1821,7 @@ void R_RenderSegLoop ()
|
|||
yscale = FixedMul(rw_pic->yScale, rw_midtexturescaley);
|
||||
if (xscale != lwallscale)
|
||||
{
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.SX1, WallC.SX2);
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.sx1, WallC.sx2);
|
||||
lwallscale = xscale;
|
||||
}
|
||||
if (midtexture->bWorldPanning)
|
||||
|
@ -1864,7 +1864,7 @@ void R_RenderSegLoop ()
|
|||
yscale = FixedMul(rw_pic->yScale, rw_toptexturescaley);
|
||||
if (xscale != lwallscale)
|
||||
{
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.SX1, WallC.SX2);
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.sx1, WallC.sx2);
|
||||
lwallscale = xscale;
|
||||
}
|
||||
if (toptexture->bWorldPanning)
|
||||
|
@ -1910,7 +1910,7 @@ void R_RenderSegLoop ()
|
|||
yscale = FixedMul(rw_pic->yScale, rw_bottomtexturescaley);
|
||||
if (xscale != lwallscale)
|
||||
{
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.SX1, WallC.SX2);
|
||||
PrepLWall (lwall, curline->sidedef->TexelLength*xscale, WallC.sx1, WallC.sx2);
|
||||
lwallscale = xscale;
|
||||
}
|
||||
if (bottomtexture->bWorldPanning)
|
||||
|
@ -2030,7 +2030,7 @@ void R_NewWall (bool needlights)
|
|||
{
|
||||
if (rw_havehigh)
|
||||
{ // front ceiling is above back ceiling
|
||||
memcpy (&walltop[WallC.SX1], &wallupper[WallC.SX1], (WallC.SX2 - WallC.SX1)*sizeof(walltop[0]));
|
||||
memcpy (&walltop[WallC.sx1], &wallupper[WallC.sx1], (WallC.sx2 - WallC.sx1)*sizeof(walltop[0]));
|
||||
rw_havehigh = false;
|
||||
}
|
||||
else if (rw_havelow && frontsector->ceilingplane != backsector->ceilingplane)
|
||||
|
@ -2255,15 +2255,15 @@ void R_NewWall (bool needlights)
|
|||
bottomtexture ? FixedMul(bottomtexture->xScale, sidedef->GetTextureXScale(side_t::bottom)) :
|
||||
FRACUNIT;
|
||||
|
||||
PrepWall (swall, lwall, sidedef->TexelLength * lwallscale, WallC.SX1, WallC.SX2);
|
||||
PrepWall (swall, lwall, sidedef->TexelLength * lwallscale, WallC.sx1, WallC.sx2);
|
||||
|
||||
if (fixedcolormap == NULL && fixedlightlev < 0)
|
||||
{
|
||||
wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, frontsector->lightlevel)
|
||||
+ r_actualextralight);
|
||||
GlobVis = r_WallVisibility;
|
||||
rw_lightleft = SafeDivScale12 (GlobVis, WallC.SZ1);
|
||||
rw_lightstep = (SafeDivScale12 (GlobVis, WallC.SZ2) - rw_lightleft) / (WallC.SX2 - WallC.SX1);
|
||||
rw_lightleft = SafeDivScale12 (GlobVis, WallC.sz1);
|
||||
rw_lightstep = (SafeDivScale12 (GlobVis, WallC.sz2) - rw_lightleft) / (WallC.sx2 - WallC.sx1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2337,19 +2337,19 @@ void R_StoreWallRange (int start, int stop)
|
|||
}
|
||||
|
||||
rw_offset = sidedef->GetTextureXOffset(side_t::mid);
|
||||
rw_light = rw_lightleft + rw_lightstep * (start - WallC.SX1);
|
||||
rw_light = rw_lightleft + rw_lightstep * (start - WallC.sx1);
|
||||
|
||||
ds_p->sx1 = WallC.SX1;
|
||||
ds_p->sx2 = WallC.SX2;
|
||||
ds_p->sz1 = WallC.SZ1;
|
||||
ds_p->sz2 = WallC.SZ2;
|
||||
ds_p->cx = WallC.TX1;
|
||||
ds_p->cy = WallC.TY1;
|
||||
ds_p->cdx = WallC.TX2 - WallC.TX1;
|
||||
ds_p->cdy = WallC.TY2 - WallC.TY1;
|
||||
ds_p->sx1 = WallC.sx1;
|
||||
ds_p->sx2 = WallC.sx2;
|
||||
ds_p->sz1 = WallC.sz1;
|
||||
ds_p->sz2 = WallC.sz2;
|
||||
ds_p->cx = WallC.tx1;
|
||||
ds_p->cy = WallC.ty1;
|
||||
ds_p->cdx = WallC.tx2 - WallC.tx1;
|
||||
ds_p->cdy = WallC.ty2 - WallC.ty1;
|
||||
ds_p->tmapvals = WallT;
|
||||
ds_p->siz1 = (DWORD)DivScale32 (1, WallC.SZ1) >> 1;
|
||||
ds_p->siz2 = (DWORD)DivScale32 (1, WallC.SZ2) >> 1;
|
||||
ds_p->siz1 = (DWORD)DivScale32 (1, WallC.sz1) >> 1;
|
||||
ds_p->siz2 = (DWORD)DivScale32 (1, WallC.sz2) >> 1;
|
||||
ds_p->x1 = rw_x = start;
|
||||
ds_p->x2 = stop-1;
|
||||
ds_p->curline = curline;
|
||||
|
@ -2442,7 +2442,7 @@ void R_StoreWallRange (int start, int stop)
|
|||
if ((TexMan(sidedef->GetTexture(side_t::mid), true)->UseType != FTexture::TEX_Null || ds_p->bFakeBoundary || IsFogBoundary (frontsector, backsector)) &&
|
||||
(rw_ceilstat != 12 || !sidedef->GetTexture(side_t::top).isValid()) &&
|
||||
(rw_floorstat != 3 || !sidedef->GetTexture(side_t::bottom).isValid()) &&
|
||||
(WallC.SZ1 >= TOO_CLOSE_Z && WallC.SZ2 >= TOO_CLOSE_Z))
|
||||
(WallC.sz1 >= TOO_CLOSE_Z && WallC.sz2 >= TOO_CLOSE_Z))
|
||||
{
|
||||
fixed_t *swal;
|
||||
fixed_t *lwal;
|
||||
|
@ -2590,59 +2590,59 @@ int OWallMost (short *mostbuf, fixed_t z, const FWallCoords *wallc)
|
|||
fixed_t s1, s2, s3, s4;
|
||||
|
||||
z = -(z >> 4);
|
||||
s1 = MulScale16 (globaluclip, wallc->SZ1); s2 = MulScale16 (globaluclip, wallc->SZ2);
|
||||
s3 = MulScale16 (globaldclip, wallc->SZ1); s4 = MulScale16 (globaldclip, wallc->SZ2);
|
||||
s1 = MulScale16 (globaluclip, wallc->sz1); s2 = MulScale16 (globaluclip, wallc->sz2);
|
||||
s3 = MulScale16 (globaldclip, wallc->sz1); s4 = MulScale16 (globaldclip, wallc->sz2);
|
||||
bad = (z<s1)+((z<s2)<<1)+((z>s3)<<2)+((z>s4)<<3);
|
||||
|
||||
#if 1
|
||||
if ((bad&3) == 3)
|
||||
{
|
||||
memset (&mostbuf[wallc->SX1], 0, (wallc->SX2 - wallc->SX1)*sizeof(mostbuf[0]));
|
||||
memset (&mostbuf[wallc->sx1], 0, (wallc->sx2 - wallc->sx1)*sizeof(mostbuf[0]));
|
||||
return bad;
|
||||
}
|
||||
|
||||
if ((bad&12) == 12)
|
||||
{
|
||||
clearbufshort (&mostbuf[wallc->SX1], wallc->SX2 - wallc->SX1, viewheight);
|
||||
clearbufshort (&mostbuf[wallc->sx1], wallc->sx2 - wallc->sx1, viewheight);
|
||||
return bad;
|
||||
}
|
||||
#endif
|
||||
ix1 = wallc->SX1; iy1 = wallc->SZ1;
|
||||
ix2 = wallc->SX2; iy2 = wallc->SZ2;
|
||||
ix1 = wallc->sx1; iy1 = wallc->sz1;
|
||||
ix2 = wallc->sx2; iy2 = wallc->sz2;
|
||||
#if 1
|
||||
if (bad & 3)
|
||||
{
|
||||
int t = DivScale30 (z-s1, s2-s1);
|
||||
int inty = wallc->SZ1 + MulScale30 (wallc->SZ2 - wallc->SZ1, t);
|
||||
int xcross = wallc->SX1 + Scale (MulScale30 (wallc->SZ2, t), wallc->SX2 - wallc->SX1, inty);
|
||||
int inty = wallc->sz1 + MulScale30 (wallc->sz2 - wallc->sz1, t);
|
||||
int xcross = wallc->sx1 + Scale (MulScale30 (wallc->sz2, t), wallc->sx2 - wallc->sx1, inty);
|
||||
|
||||
if ((bad & 3) == 2)
|
||||
{
|
||||
if (wallc->SX1 <= xcross) { iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->SX2 > xcross) memset (&mostbuf[xcross], 0, (wallc->SX2-xcross)*sizeof(mostbuf[0]));
|
||||
if (wallc->sx1 <= xcross) { iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->sx2 > xcross) memset (&mostbuf[xcross], 0, (wallc->sx2-xcross)*sizeof(mostbuf[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xcross <= wallc->SX2) { iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->SX1) memset (&mostbuf[wallc->SX1], 0, (xcross-wallc->SX1)*sizeof(mostbuf[0]));
|
||||
if (xcross <= wallc->sx2) { iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->sx1) memset (&mostbuf[wallc->sx1], 0, (xcross-wallc->sx1)*sizeof(mostbuf[0]));
|
||||
}
|
||||
}
|
||||
|
||||
if (bad & 12)
|
||||
{
|
||||
int t = DivScale30 (z-s3, s4-s3);
|
||||
int inty = wallc->SZ1 + MulScale30 (wallc->SZ2 - wallc->SZ1, t);
|
||||
int xcross = wallc->SX1 + Scale (MulScale30 (wallc->SZ2, t), wallc->SX2 - wallc->SX1, inty);
|
||||
int inty = wallc->sz1 + MulScale30 (wallc->sz2 - wallc->sz1, t);
|
||||
int xcross = wallc->sx1 + Scale (MulScale30 (wallc->sz2, t), wallc->sx2 - wallc->sx1, inty);
|
||||
|
||||
if ((bad & 12) == 8)
|
||||
{
|
||||
if (wallc->SX1 <= xcross) { iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->SX2 > xcross) clearbufshort (&mostbuf[xcross], wallc->SX2 - xcross, viewheight);
|
||||
if (wallc->sx1 <= xcross) { iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->sx2 > xcross) clearbufshort (&mostbuf[xcross], wallc->sx2 - xcross, viewheight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xcross <= wallc->SX2) { iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->SX1) clearbufshort (&mostbuf[wallc->SX1], xcross - wallc->SX1, viewheight);
|
||||
if (xcross <= wallc->sx2) { iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->sx1) clearbufshort (&mostbuf[wallc->sx1], xcross - wallc->sx1, viewheight);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2660,12 +2660,12 @@ int OWallMost (short *mostbuf, fixed_t z, const FWallCoords *wallc)
|
|||
double max = viewheight;
|
||||
double zz = z / 65536.0;
|
||||
#if 0
|
||||
double z1 = zz * InvZtoScale / wallc->SZ1;
|
||||
double z2 = zz * InvZtoScale / wallc->SZ2 - z1;
|
||||
z2 /= (wallc->SX2 - wallc->SX1);
|
||||
double z1 = zz * InvZtoScale / wallc->sz1;
|
||||
double z2 = zz * InvZtoScale / wallc->sz2 - z1;
|
||||
z2 /= (wallc->sx2 - wallc->sx1);
|
||||
z1 += centeryfrac / 65536.0;
|
||||
|
||||
for (int x = wallc->SX1; x < wallc->SX2; ++x)
|
||||
for (int x = wallc->sx1; x < wallc->sx2; ++x)
|
||||
{
|
||||
mostbuf[x] = xs_RoundToInt(clamp(z1, 0.0, max));
|
||||
z1 += z2;
|
||||
|
@ -2673,12 +2673,12 @@ int OWallMost (short *mostbuf, fixed_t z, const FWallCoords *wallc)
|
|||
#else
|
||||
double top, bot, i;
|
||||
|
||||
i = wallc->SX1 - centerx;
|
||||
i = wallc->sx1 - centerx;
|
||||
top = WallT.UoverZorg + WallT.UoverZstep * i;
|
||||
bot = WallT.InvZorg + WallT.InvZstep * i;
|
||||
double cy = centeryfrac / 65536.0;
|
||||
|
||||
for (int x = wallc->SX1; x < wallc->SX2; x++)
|
||||
for (int x = wallc->sx1; x < wallc->sx2; x++)
|
||||
{
|
||||
double frac = top / bot;
|
||||
double scale = frac * WallT.DepthScale + WallT.DepthOrg;
|
||||
|
@ -2711,21 +2711,21 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
{
|
||||
x = curline->v2->x;
|
||||
y = curline->v2->y;
|
||||
if (wallc->SX1 == 0 && 0 != (den = wallc->TX1 - wallc->TX2 + wallc->TY1 - wallc->TY2))
|
||||
if (wallc->sx1 == 0 && 0 != (den = wallc->tx1 - wallc->tx2 + wallc->ty1 - wallc->ty2))
|
||||
{
|
||||
int frac = SafeDivScale30 (wallc->TY1 + wallc->TX1, den);
|
||||
int frac = SafeDivScale30 (wallc->ty1 + wallc->tx1, den);
|
||||
x -= MulScale30 (frac, x - curline->v1->x);
|
||||
y -= MulScale30 (frac, y - curline->v1->y);
|
||||
}
|
||||
z1 = viewz - plane.ZatPoint (x, y);
|
||||
|
||||
if (wallc->SX2 > wallc->SX1 + 1)
|
||||
if (wallc->sx2 > wallc->sx1 + 1)
|
||||
{
|
||||
x = curline->v1->x;
|
||||
y = curline->v1->y;
|
||||
if (wallc->SX2 == viewwidth && 0 != (den = wallc->TX1 - wallc->TX2 - wallc->TY1 + wallc->TY2))
|
||||
if (wallc->sx2 == viewwidth && 0 != (den = wallc->tx1 - wallc->tx2 - wallc->ty1 + wallc->ty2))
|
||||
{
|
||||
int frac = SafeDivScale30 (wallc->TY2 - wallc->TX2, den);
|
||||
int frac = SafeDivScale30 (wallc->ty2 - wallc->tx2, den);
|
||||
x += MulScale30 (frac, curline->v2->x - x);
|
||||
y += MulScale30 (frac, curline->v2->y - y);
|
||||
}
|
||||
|
@ -2740,21 +2740,21 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
{
|
||||
x = curline->v1->x;
|
||||
y = curline->v1->y;
|
||||
if (wallc->SX1 == 0 && 0 != (den = wallc->TX1 - wallc->TX2 + wallc->TY1 - wallc->TY2))
|
||||
if (wallc->sx1 == 0 && 0 != (den = wallc->tx1 - wallc->tx2 + wallc->ty1 - wallc->ty2))
|
||||
{
|
||||
int frac = SafeDivScale30 (wallc->TY1 + wallc->TX1, den);
|
||||
int frac = SafeDivScale30 (wallc->ty1 + wallc->tx1, den);
|
||||
x += MulScale30 (frac, curline->v2->x - x);
|
||||
y += MulScale30 (frac, curline->v2->y - y);
|
||||
}
|
||||
z1 = viewz - plane.ZatPoint (x, y);
|
||||
|
||||
if (wallc->SX2 > wallc->SX1 + 1)
|
||||
if (wallc->sx2 > wallc->sx1 + 1)
|
||||
{
|
||||
x = curline->v2->x;
|
||||
y = curline->v2->y;
|
||||
if (wallc->SX2 == viewwidth && 0 != (den = wallc->TX1 - wallc->TX2 - wallc->TY1 + wallc->TY2))
|
||||
if (wallc->sx2 == viewwidth && 0 != (den = wallc->tx1 - wallc->tx2 - wallc->ty1 + wallc->ty2))
|
||||
{
|
||||
int frac = SafeDivScale30 (wallc->TY2 - wallc->TX2, den);
|
||||
int frac = SafeDivScale30 (wallc->ty2 - wallc->tx2, den);
|
||||
x -= MulScale30 (frac, x - curline->v1->x);
|
||||
y -= MulScale30 (frac, y - curline->v1->y);
|
||||
}
|
||||
|
@ -2766,12 +2766,12 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
}
|
||||
}
|
||||
|
||||
s1 = MulScale12 (globaluclip, wallc->SZ1); s2 = MulScale12 (globaluclip, wallc->SZ2);
|
||||
s3 = MulScale12 (globaldclip, wallc->SZ1); s4 = MulScale12 (globaldclip, wallc->SZ2);
|
||||
s1 = MulScale12 (globaluclip, wallc->sz1); s2 = MulScale12 (globaluclip, wallc->sz2);
|
||||
s3 = MulScale12 (globaldclip, wallc->sz1); s4 = MulScale12 (globaldclip, wallc->sz2);
|
||||
bad = (z1<s1)+((z2<s2)<<1)+((z1>s3)<<2)+((z2>s4)<<3);
|
||||
|
||||
ix1 = wallc->SX1; ix2 = wallc->SX2;
|
||||
iy1 = wallc->SZ1; iy2 = wallc->SZ2;
|
||||
ix1 = wallc->sx1; ix2 = wallc->sx2;
|
||||
iy1 = wallc->sz1; iy2 = wallc->sz2;
|
||||
oz1 = z1; oz2 = z2;
|
||||
|
||||
if ((bad&3) == 3)
|
||||
|
@ -2791,9 +2791,9 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
{
|
||||
//inty = intz / (globaluclip>>16)
|
||||
int t = SafeDivScale30 (oz1-s1, s2-s1+oz1-oz2);
|
||||
int inty = wallc->SZ1 + MulScale30 (wallc->SZ2-wallc->SZ1,t);
|
||||
int inty = wallc->sz1 + MulScale30 (wallc->sz2-wallc->sz1,t);
|
||||
int intz = oz1 + MulScale30 (oz2-oz1,t);
|
||||
int xcross = wallc->SX1 + Scale (MulScale30 (wallc->SZ2, t), wallc->SX2-wallc->SX1, inty);
|
||||
int xcross = wallc->sx1 + Scale (MulScale30 (wallc->sz2, t), wallc->sx2-wallc->sx1, inty);
|
||||
|
||||
//t = divscale30((x1<<4)-xcross*yb1[w],xcross*(yb2[w]-yb1[w])-((x2-x1)<<4));
|
||||
//inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
|
||||
|
@ -2801,13 +2801,13 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
|
||||
if ((bad&3) == 2)
|
||||
{
|
||||
if (wallc->SX1 <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
|
||||
memset (&mostbuf[xcross], 0, (wallc->SX2-xcross)*sizeof(mostbuf[0]));
|
||||
if (wallc->sx1 <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
|
||||
memset (&mostbuf[xcross], 0, (wallc->sx2-xcross)*sizeof(mostbuf[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xcross <= wallc->SX2) { z1 = intz; iy1 = inty; ix1 = xcross; }
|
||||
memset (&mostbuf[wallc->SX1], 0, (xcross-wallc->SX1)*sizeof(mostbuf[0]));
|
||||
if (xcross <= wallc->sx2) { z1 = intz; iy1 = inty; ix1 = xcross; }
|
||||
memset (&mostbuf[wallc->sx1], 0, (xcross-wallc->sx1)*sizeof(mostbuf[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2815,9 +2815,9 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
{
|
||||
//inty = intz / (globaldclip>>16)
|
||||
int t = SafeDivScale30 (oz1-s3, s4-s3+oz1-oz2);
|
||||
int inty = wallc->SZ1 + MulScale30 (wallc->SZ2-wallc->SZ1,t);
|
||||
int inty = wallc->sz1 + MulScale30 (wallc->sz2-wallc->sz1,t);
|
||||
int intz = oz1 + MulScale30 (oz2-oz1,t);
|
||||
int xcross = wallc->SX1 + Scale (MulScale30 (wallc->SZ2, t), wallc->SX2-wallc->SX1,inty);
|
||||
int xcross = wallc->sx1 + Scale (MulScale30 (wallc->sz2, t), wallc->sx2-wallc->sx1,inty);
|
||||
|
||||
//t = divscale30((x1<<4)-xcross*yb1[w],xcross*(yb2[w]-yb1[w])-((x2-x1)<<4));
|
||||
//inty = yb1[w] + mulscale30(yb2[w]-yb1[w],t);
|
||||
|
@ -2825,13 +2825,13 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
|
|||
|
||||
if ((bad&12) == 8)
|
||||
{
|
||||
if (wallc->SX1 <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->SX2 > xcross) clearbufshort (&mostbuf[xcross], wallc->SX2-xcross, viewheight);
|
||||
if (wallc->sx1 <= xcross) { z2 = intz; iy2 = inty; ix2 = xcross; }
|
||||
if (wallc->sx2 > xcross) clearbufshort (&mostbuf[xcross], wallc->sx2-xcross, viewheight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xcross <= wallc->SX2) { z1 = intz; iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->SX1) clearbufshort (&mostbuf[wallc->SX1], xcross-wallc->SX1, viewheight);
|
||||
if (xcross <= wallc->sx2) { z1 = intz; iy1 = inty; ix1 = xcross; }
|
||||
if (xcross > wallc->sx1) clearbufshort (&mostbuf[wallc->sx1], xcross-wallc->sx1, viewheight);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3041,8 +3041,8 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper,
|
|||
if (WallC.Init(lx, ly, lx2, ly2, TOO_CLOSE_Z))
|
||||
goto done;
|
||||
|
||||
x1 = WallC.SX1;
|
||||
x2 = WallC.SX2;
|
||||
x1 = WallC.sx1;
|
||||
x2 = WallC.sx2;
|
||||
|
||||
if (x1 > clipper->x2 || x2 <= clipper->x1)
|
||||
goto done;
|
||||
|
@ -3145,7 +3145,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper,
|
|||
rereadcolormap = false;
|
||||
}
|
||||
|
||||
rw_light = rw_lightleft + (x1 - WallC.SX1) * rw_lightstep;
|
||||
rw_light = rw_lightleft + (x1 - WallC.sx1) * rw_lightstep;
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = usecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap != NULL)
|
||||
|
|
|
@ -411,8 +411,8 @@ void R_DrawWallSprite(vissprite_t *spr)
|
|||
fixed_t yscale;
|
||||
int shade = LIGHT2SHADE(140);
|
||||
|
||||
x1 = MAX<int>(spr->x1, spr->wallc.SX1);
|
||||
x2 = MIN<int>(spr->x2, spr->wallc.SX2 + 1);
|
||||
x1 = MAX<int>(spr->x1, spr->wallc.sx1);
|
||||
x2 = MIN<int>(spr->x2, spr->wallc.sx2 + 1);
|
||||
if (x1 >= x2)
|
||||
return;
|
||||
WallT.InitFromWallCoords(&spr->wallc);
|
||||
|
@ -440,7 +440,7 @@ void R_DrawWallSprite(vissprite_t *spr)
|
|||
rereadcolormap = false;
|
||||
}
|
||||
|
||||
rw_light = rw_lightleft + (x1 - spr->wallc.SX1) * rw_lightstep;
|
||||
rw_light = rw_lightleft + (x1 - spr->wallc.sx1) * rw_lightstep;
|
||||
if (fixedlightlev >= 0)
|
||||
dc_colormap = usecolormap->Maps + fixedlightlev;
|
||||
else if (fixedcolormap != NULL)
|
||||
|
@ -1057,7 +1057,7 @@ static void R_ProjectWallSprite(AActor *thing, fixed_t fx, fixed_t fy, fixed_t f
|
|||
if (wallc.Init(lx1, ly1, lx2, ly2, TOO_CLOSE_Z))
|
||||
return;
|
||||
|
||||
if (wallc.SX1 > WindowRight || wallc.SX2 <= WindowLeft)
|
||||
if (wallc.sx1 > WindowRight || wallc.sx2 <= WindowLeft)
|
||||
return;
|
||||
|
||||
// Sprite sorting should probably treat these as walls, not sprites,
|
||||
|
@ -1070,8 +1070,8 @@ static void R_ProjectWallSprite(AActor *thing, fixed_t fx, fixed_t fy, fixed_t f
|
|||
gzb = fz + yscale * scaled_bo;
|
||||
|
||||
vis = R_NewVisSprite();
|
||||
vis->x1 = wallc.SX1 < WindowLeft ? WindowLeft : wallc.SX1;
|
||||
vis->x2 = wallc.SX2 >= WindowRight ? WindowRight-1 : wallc.SX2-1;
|
||||
vis->x1 = wallc.sx1 < WindowLeft ? WindowLeft : wallc.sx1;
|
||||
vis->x2 = wallc.sx2 >= WindowRight ? WindowRight-1 : wallc.sx2-1;
|
||||
vis->idepth = (unsigned)DivScale32(1, tz) >> 1;
|
||||
vis->depth = tz;
|
||||
vis->sector = thing->Sector;
|
||||
|
|
Loading…
Reference in a new issue