mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-19 15:31:57 +00:00
- use PlanesAtPointf in most places where PlanesAtPoint was used.
This commit is contained in:
parent
02d508baef
commit
bd95da423a
5 changed files with 15 additions and 15 deletions
|
@ -162,8 +162,8 @@ void vertex_t::RecalcVertexHeights()
|
|||
{
|
||||
float heights[2];
|
||||
|
||||
auto point = wall[masterwall].wall_int_pos();
|
||||
PlanesAtPoint(§or[sect], point.X, point.Y, &heights[0], &heights[1]);
|
||||
auto point = wall[masterwall].pos;
|
||||
PlanesAtPointf(§or[sect], point.X, point.Y, &heights[0], &heights[1]);
|
||||
for(auto height : heights)
|
||||
{
|
||||
int k;
|
||||
|
|
|
@ -168,11 +168,11 @@ bool BunchDrawer::CheckClip(walltype* wal, float* topclip, float* bottomclip)
|
|||
// Mirrors and horizons always block the view
|
||||
//if (linedef->special==Line_Mirror || linedef->special==Line_Horizon) return true;
|
||||
|
||||
PlanesAtPoint(frontsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &fs_ceilingheight1, &fs_floorheight1);
|
||||
PlanesAtPoint(frontsector, pt2->wall_int_pos().X, pt2->wall_int_pos().Y, &fs_ceilingheight2, &fs_floorheight2);
|
||||
PlanesAtPointf(frontsector, wal->pos.X, wal->pos.Y, &fs_ceilingheight1, &fs_floorheight1);
|
||||
PlanesAtPointf(frontsector, pt2->pos.X, pt2->pos.Y, &fs_ceilingheight2, &fs_floorheight2);
|
||||
|
||||
PlanesAtPoint(backsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &bs_ceilingheight1, &bs_floorheight1);
|
||||
PlanesAtPoint(backsector, pt2->wall_int_pos().X, pt2->wall_int_pos().Y, &bs_ceilingheight2, &bs_floorheight2);
|
||||
PlanesAtPointf(backsector, wal->pos.X, wal->pos.Y, &bs_ceilingheight1, &bs_floorheight1);
|
||||
PlanesAtPointf(backsector, pt2->pos.X, pt2->pos.Y, &bs_ceilingheight2, &bs_floorheight2);
|
||||
|
||||
*bottomclip = max(min(bs_floorheight1, bs_floorheight2), min(fs_floorheight1, fs_floorheight2));
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int section
|
|||
const auto &vp = di->Viewpoint;
|
||||
|
||||
float florz, ceilz;
|
||||
PlanesAtPoint(frontsector, float(vp.Pos.X) * 16.f, float(vp.Pos.Y) * -16.f, &ceilz, &florz);
|
||||
PlanesAtPointf(frontsector, vp.Pos.X, -vp.Pos.Y, &ceilz, &florz);
|
||||
|
||||
visibility = sectorVisibility(frontsector);
|
||||
sec = frontsector;
|
||||
|
|
|
@ -914,8 +914,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
|
|||
FVector2 v1(WallStartX(wal), WallStartY(wal));
|
||||
FVector2 v2(WallEndX(wal), WallEndY(wal));
|
||||
|
||||
PlanesAtPoint(frontsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &fch1, &ffh1);
|
||||
PlanesAtPoint(frontsector, p2wall->wall_int_pos().X, p2wall->wall_int_pos().Y, &fch2, &ffh2);
|
||||
PlanesAtPointf(frontsector, wal->pos.X, wal->pos.Y, &fch1, &ffh1);
|
||||
PlanesAtPointf(frontsector, p2wall->pos.X, p2wall->pos.Y, &fch2, &ffh2);
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -1008,8 +1008,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
|
|||
float bfh2;
|
||||
float bch1;
|
||||
float bch2;
|
||||
PlanesAtPoint(backsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &bch1, &bfh1);
|
||||
PlanesAtPoint(backsector, p2wall->wall_int_pos().X, p2wall->wall_int_pos().Y, &bch2, &bfh2);
|
||||
PlanesAtPointf(backsector, wal->pos.X, wal->pos.Y, &bch1, &bfh1);
|
||||
PlanesAtPointf(backsector, p2wall->pos.X, p2wall->pos.Y, &bch2, &bfh2);
|
||||
|
||||
SkyTop(di, wal, frontsector, backsector, v1, v2, fch1, fch2);
|
||||
SkyBottom(di, wal, frontsector, backsector, v1, v2, ffh1, ffh2);
|
||||
|
|
|
@ -63,8 +63,8 @@ static FVector3 CalcNormal(sectortype* sector, int plane)
|
|||
|
||||
pt[0] = { (float)WallStartX(wal), 0.f, (float)WallStartY(wal)};
|
||||
pt[1] = { (float)WallStartX(wal2), 0.f, (float)WallStartY(wal2)};
|
||||
PlanesAtPoint(sector, wal->wall_int_pos().X, wal->wall_int_pos().Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Y);
|
||||
PlanesAtPoint(sector, wal2->wall_int_pos().X, wal2->wall_int_pos().Y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Y);
|
||||
PlanesAtPointf(sector, wal->pos.X, wal->pos.Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Y);
|
||||
PlanesAtPointf(sector, wal2->pos.X, wal2->pos.Y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Y);
|
||||
|
||||
if (pt[0].X == pt[1].X)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ static FVector3 CalcNormal(sectortype* sector, int plane)
|
|||
pt[2].X = pt[0].X;
|
||||
pt[2].Z = pt[0].Z + 4;
|
||||
}
|
||||
PlanesAtPoint(sector, pt[2].X * 16, pt[2].Z * -16, plane ? &pt[2].Z : nullptr, plane ? nullptr : &pt[2].Y);
|
||||
PlanesAtPointf(sector, pt[2].X, -pt[2].Z, plane ? &pt[2].Y : nullptr, plane ? nullptr : &pt[2].Y);
|
||||
|
||||
auto normal = ((pt[2] - pt[0]) ^ (pt[1] - pt[0])).Unit();
|
||||
if ((normal.Y < 0 && !plane) || (normal.Y > 0 && plane)) return -normal;
|
||||
|
@ -453,7 +453,7 @@ void SectionGeometry::CreatePlaneMesh(Section* section, int plane, const FVector
|
|||
auto& tc = entry.texcoords[i];
|
||||
|
||||
pt.X = org.X; pt.Y = org.Y;
|
||||
PlanesAtPoint(sectorp, (pt.X * 16), (pt.Y * -16), plane ? &pt.Z : nullptr, !plane ? &pt.Z : nullptr);
|
||||
PlanesAtPointf(sectorp, pt.X, -pt.Y, plane ? &pt.Z : nullptr, !plane ? &pt.Z : nullptr);
|
||||
tc = uvcalc.GetUV(int(pt.X * 16.), int(pt.Y * -16.), pt.Z);
|
||||
}
|
||||
sectorp->setfloorz(fz, true);
|
||||
|
|
Loading…
Reference in a new issue