mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- fixed PointOnSide checks.
- optimized some ZatPoint calls for floating point planes.
This commit is contained in:
parent
7a6039b44c
commit
fede16ce68
2 changed files with 11 additions and 12 deletions
|
@ -38,12 +38,12 @@ struct intercept_t
|
|||
|
||||
inline int P_PointOnLineSidePrecise(double x, double y, const line_t *line)
|
||||
{
|
||||
return (y - line->v1->fY()) * line->Delta().X + (line->v1->fX() - x) * line->Delta().Y > EQUAL_EPSILON;
|
||||
return (y - line->v1->fY()) * line->Delta().X + (line->v1->fX() - x) * line->Delta().Y > -EQUAL_EPSILON;
|
||||
}
|
||||
|
||||
inline int P_PointOnLineSidePrecise(const DVector2 &pt, const line_t *line)
|
||||
{
|
||||
return (pt.Y - line->v1->fY()) * line->Delta().X + (line->v1->fX() - pt.X) * line->Delta().Y > EQUAL_EPSILON;
|
||||
return (pt.Y - line->v1->fY()) * line->Delta().X + (line->v1->fX() - pt.X) * line->Delta().Y > -EQUAL_EPSILON;
|
||||
}
|
||||
|
||||
inline int P_PointOnLineSide (double x, double y, const line_t *line)
|
||||
|
@ -73,12 +73,12 @@ inline int P_PointOnLineSide(const DVector2 & p, const line_t *line)
|
|||
|
||||
inline int P_PointOnDivlineSide(double x, double y, const divline_t *line)
|
||||
{
|
||||
return (y - line->y) * line->dx + (line->x - x) * line->dy > EQUAL_EPSILON;
|
||||
return (y - line->y) * line->dx + (line->x - x) * line->dy > -EQUAL_EPSILON;
|
||||
}
|
||||
|
||||
inline int P_PointOnDivlineSide(const DVector2 &pos, const divline_t *line)
|
||||
{
|
||||
return (pos.Y - line->y) * line->dx + (line->x - pos.X) * line->dy > EQUAL_EPSILON;
|
||||
return (pos.Y - line->y) * line->dx + (line->x - pos.X) * line->dy > -EQUAL_EPSILON;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -728,7 +728,6 @@ void R_DrawVisVoxel(vissprite_t *spr, int minslabz, int maxslabz, short *cliptop
|
|||
//
|
||||
void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling)
|
||||
{
|
||||
fixed_t fx, fy, fz;
|
||||
fixed_t tr_x;
|
||||
fixed_t tr_y;
|
||||
|
||||
|
@ -768,9 +767,9 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
|||
|
||||
// [RH] Interpolate the sprite's position to make it look smooth
|
||||
DVector3 pos = thing->InterpolatedPosition(r_TicFracF);
|
||||
fx = FLOAT2FIXED(pos.X);
|
||||
fy = FLOAT2FIXED(pos.Y);
|
||||
fz = FLOAT2FIXED(pos.Z + thing->GetBobOffset(r_TicFracF));
|
||||
const fixed_t fx = FLOAT2FIXED(pos.X);
|
||||
const fixed_t fy = FLOAT2FIXED(pos.Y);
|
||||
fixed_t fz = FLOAT2FIXED(pos.Z + thing->GetBobOffset(r_TicFracF));
|
||||
|
||||
tex = NULL;
|
||||
voxel = NULL;
|
||||
|
@ -937,19 +936,19 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
|||
{
|
||||
if (fakeside == FAKED_AboveCeiling)
|
||||
{
|
||||
if (gzt < heightsec->ceilingplane.ZatPointFixed(fx, fy))
|
||||
if (gzt < heightsec->ceilingplane.ZatPointFixed(pos))
|
||||
return;
|
||||
}
|
||||
else if (fakeside == FAKED_BelowFloor)
|
||||
{
|
||||
if (gzb >= heightsec->floorplane.ZatPointFixed(fx, fy))
|
||||
if (gzb >= heightsec->floorplane.ZatPointFixed(pos))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gzt < heightsec->floorplane.ZatPointFixed(fx, fy))
|
||||
if (gzt < heightsec->floorplane.ZatPointFixed(pos))
|
||||
return;
|
||||
if (!(heightsec->MoreFlags & SECF_FAKEFLOORONLY) && gzb >= heightsec->ceilingplane.ZatPointFixed(fx, fy))
|
||||
if (!(heightsec->MoreFlags & SECF_FAKEFLOORONLY) && gzb >= heightsec->ceilingplane.ZatPointFixed(pos))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue