mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
Renderer floatification: Use floating point for geometry Zs
This commit is contained in:
parent
3ef5a678d5
commit
b2b3e50c5c
3 changed files with 24 additions and 26 deletions
|
@ -78,10 +78,10 @@ extern short wallbottom[MAXWIDTH];
|
||||||
extern short wallupper[MAXWIDTH];
|
extern short wallupper[MAXWIDTH];
|
||||||
extern short walllower[MAXWIDTH];
|
extern short walllower[MAXWIDTH];
|
||||||
|
|
||||||
fixed_t rw_backcz1, rw_backcz2;
|
double rw_backcz1, rw_backcz2;
|
||||||
fixed_t rw_backfz1, rw_backfz2;
|
double rw_backfz1, rw_backfz2;
|
||||||
fixed_t rw_frontcz1, rw_frontcz2;
|
double rw_frontcz1, rw_frontcz2;
|
||||||
fixed_t rw_frontfz1, rw_frontfz2;
|
double rw_frontfz1, rw_frontfz2;
|
||||||
|
|
||||||
|
|
||||||
size_t MaxDrawSegs;
|
size_t MaxDrawSegs;
|
||||||
|
@ -596,10 +596,10 @@ void R_AddLine (seg_t *line)
|
||||||
{
|
{
|
||||||
backsector = line->backsector;
|
backsector = line->backsector;
|
||||||
}
|
}
|
||||||
rw_frontcz1 = frontsector->ceilingplane.ZatPointFixed(line->v1);
|
rw_frontcz1 = frontsector->ceilingplane.ZatPoint(line->v1);
|
||||||
rw_frontfz1 = frontsector->floorplane.ZatPointFixed(line->v1);
|
rw_frontfz1 = frontsector->floorplane.ZatPoint(line->v1);
|
||||||
rw_frontcz2 = frontsector->ceilingplane.ZatPointFixed(line->v2);
|
rw_frontcz2 = frontsector->ceilingplane.ZatPoint(line->v2);
|
||||||
rw_frontfz2 = frontsector->floorplane.ZatPointFixed(line->v2);
|
rw_frontfz2 = frontsector->floorplane.ZatPoint(line->v2);
|
||||||
|
|
||||||
rw_mustmarkfloor = rw_mustmarkceiling = false;
|
rw_mustmarkfloor = rw_mustmarkceiling = false;
|
||||||
rw_havehigh = rw_havelow = false;
|
rw_havehigh = rw_havelow = false;
|
||||||
|
@ -618,10 +618,10 @@ void R_AddLine (seg_t *line)
|
||||||
}
|
}
|
||||||
doorclosed = 0; // killough 4/16/98
|
doorclosed = 0; // killough 4/16/98
|
||||||
|
|
||||||
rw_backcz1 = backsector->ceilingplane.ZatPointFixed (line->v1);
|
rw_backcz1 = backsector->ceilingplane.ZatPoint(line->v1);
|
||||||
rw_backfz1 = backsector->floorplane.ZatPointFixed(line->v1);
|
rw_backfz1 = backsector->floorplane.ZatPoint(line->v1);
|
||||||
rw_backcz2 = backsector->ceilingplane.ZatPointFixed(line->v2);
|
rw_backcz2 = backsector->ceilingplane.ZatPoint(line->v2);
|
||||||
rw_backfz2 = backsector->floorplane.ZatPointFixed(line->v2);
|
rw_backfz2 = backsector->floorplane.ZatPoint(line->v2);
|
||||||
|
|
||||||
// Cannot make these walls solid, because it can result in
|
// Cannot make these walls solid, because it can result in
|
||||||
// sprite clipping problems for sprites near the wall
|
// sprite clipping problems for sprites near the wall
|
||||||
|
|
|
@ -98,10 +98,10 @@ double lwallscale;
|
||||||
//
|
//
|
||||||
// regular wall
|
// regular wall
|
||||||
//
|
//
|
||||||
extern fixed_t rw_backcz1, rw_backcz2;
|
extern double rw_backcz1, rw_backcz2;
|
||||||
extern fixed_t rw_backfz1, rw_backfz2;
|
extern double rw_backfz1, rw_backfz2;
|
||||||
extern fixed_t rw_frontcz1, rw_frontcz2;
|
extern double rw_frontcz1, rw_frontcz2;
|
||||||
extern fixed_t rw_frontfz1, rw_frontfz2;
|
extern double rw_frontfz1, rw_frontfz2;
|
||||||
|
|
||||||
int rw_ceilstat, rw_floorstat;
|
int rw_ceilstat, rw_floorstat;
|
||||||
bool rw_mustmarkfloor, rw_mustmarkceiling;
|
bool rw_mustmarkfloor, rw_mustmarkceiling;
|
||||||
|
@ -136,7 +136,7 @@ static fixed_t *maskedtexturecol;
|
||||||
|
|
||||||
static void R_RenderDecal (side_t *wall, DBaseDecal *first, drawseg_t *clipper, int pass);
|
static void R_RenderDecal (side_t *wall, DBaseDecal *first, drawseg_t *clipper, int pass);
|
||||||
static void WallSpriteColumn (void (*drawfunc)(const BYTE *column, const FTexture::Span *spans));
|
static void WallSpriteColumn (void (*drawfunc)(const BYTE *column, const FTexture::Span *spans));
|
||||||
void wallscan_np2(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, fixed_t top, fixed_t bot, bool mask);
|
void wallscan_np2(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, double top, double bot, bool mask);
|
||||||
static void wallscan_np2_ds(drawseg_t *ds, int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat);
|
static void wallscan_np2_ds(drawseg_t *ds, int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat);
|
||||||
static void call_wallscan(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, bool mask);
|
static void call_wallscan(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrepeat, bool mask);
|
||||||
|
|
||||||
|
@ -1317,7 +1317,7 @@ static void call_wallscan(int x1, int x2, short *uwal, short *dwal, fixed_t *swa
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
void wallscan_np2(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrep, fixed_t itop, fixed_t ibot, bool mask)
|
void wallscan_np2(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, fixed_t yrep, double top, double bot, bool mask)
|
||||||
{
|
{
|
||||||
if (!r_np2)
|
if (!r_np2)
|
||||||
{
|
{
|
||||||
|
@ -1329,8 +1329,6 @@ void wallscan_np2(int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed
|
||||||
short *up, *down;
|
short *up, *down;
|
||||||
double texheight = rw_pic->GetHeight();
|
double texheight = rw_pic->GetHeight();
|
||||||
double partition;
|
double partition;
|
||||||
double top = FIXED2FLOAT(itop);
|
|
||||||
double bot = FIXED2FLOAT(ibot);
|
|
||||||
double yrepeat = FIXED2FLOAT(yrep);
|
double yrepeat = FIXED2FLOAT(yrep);
|
||||||
double scaledtexheight = texheight / yrepeat;
|
double scaledtexheight = texheight / yrepeat;
|
||||||
|
|
||||||
|
@ -1407,7 +1405,7 @@ static void wallscan_np2_ds(drawseg_t *ds, int x1, int x2, short *uwal, short *d
|
||||||
{
|
{
|
||||||
bot = MAX(bot, sclipBottom);
|
bot = MAX(bot, sclipBottom);
|
||||||
}
|
}
|
||||||
wallscan_np2(x1, x2, uwal, dwal, swal, lwal, yrepeat, FLOAT2FIXED(top), FLOAT2FIXED(bot), true);
|
wallscan_np2(x1, x2, uwal, dwal, swal, lwal, yrepeat, top, bot, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -932,19 +932,19 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
||||||
{
|
{
|
||||||
if (fakeside == FAKED_AboveCeiling)
|
if (fakeside == FAKED_AboveCeiling)
|
||||||
{
|
{
|
||||||
if (gzt < heightsec->ceilingplane.ZatPointFixed(pos))
|
if (gzt < heightsec->ceilingplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (fakeside == FAKED_BelowFloor)
|
else if (fakeside == FAKED_BelowFloor)
|
||||||
{
|
{
|
||||||
if (gzb >= heightsec->floorplane.ZatPointFixed(pos))
|
if (gzb >= heightsec->floorplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gzt < heightsec->floorplane.ZatPointFixed(pos))
|
if (gzt < heightsec->floorplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
if (!(heightsec->MoreFlags & SECF_FAKEFLOORONLY) && gzb >= heightsec->ceilingplane.ZatPointFixed(pos))
|
if (!(heightsec->MoreFlags & SECF_FAKEFLOORONLY) && gzb >= heightsec->ceilingplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1929,7 +1929,7 @@ void R_DrawSprite (vissprite_t *spr)
|
||||||
{
|
{
|
||||||
if (!(fake3D & FAKE3D_CLIPTOP))
|
if (!(fake3D & FAKE3D_CLIPTOP))
|
||||||
{
|
{
|
||||||
sclipTop = spr->sector->ceilingplane.ZatPointFixed(ViewPos);
|
sclipTop = spr->sector->ceilingplane.ZatPoint(ViewPos);
|
||||||
}
|
}
|
||||||
sector_t *sec = NULL;
|
sector_t *sec = NULL;
|
||||||
for (i = spr->sector->e->XFloor.lightlist.Size() - 1; i >= 0; i--)
|
for (i = spr->sector->e->XFloor.lightlist.Size() - 1; i >= 0; i--)
|
||||||
|
|
Loading…
Reference in a new issue