- renamed PlanesAtPointf to PlanesAtPoint

The old PlanesAtPoint is not needed anymore.
This commit is contained in:
Christoph Oelckers 2022-01-27 19:27:27 +01:00
parent 08500ca757
commit a781517780
7 changed files with 17 additions and 21 deletions

View file

@ -185,7 +185,7 @@ void calcSlope(const sectortype* sec, float xpos, float ypos, float* pceilz, flo
void PlanesAtPoint(const sectortype* sec, float dax, float day, float* pceilz, float* pflorz)
{
calcSlope(sec, dax, day, pceilz, pflorz);
calcSlope(sec, dax * worldtomap, day * worldtomap, pceilz, pflorz);
if (pceilz) *pceilz *= -(1 / 256.f);
if (pflorz) *pflorz *= -(1 / 256.f);
}

View file

@ -157,10 +157,6 @@ void loaddefinitionsfile(const char* fn, bool cumulative = false, bool maingrp =
bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* pspr, sectortype** psectnum, binangle ang, fixedhoriz horiz, double const smoothratio);
void PlanesAtPoint(const sectortype* sec, float dax, float day, float* ceilz, float* florz);
inline void PlanesAtPointf(const sectortype* sec, float dax, float day, float* ceilz, float* florz)
{
PlanesAtPoint(sec, dax * worldtomap, day * worldtomap, ceilz, florz);
}
int getslopeval(sectortype* sect, int x, int y, int z, int planez);

View file

@ -163,7 +163,7 @@ void vertex_t::RecalcVertexHeights()
float heights[2];
auto point = wall[masterwall].pos;
PlanesAtPointf(&sector[sect], point.X, point.Y, &heights[0], &heights[1]);
PlanesAtPoint(&sector[sect], point.X, point.Y, &heights[0], &heights[1]);
for(auto height : heights)
{
int k;

View file

@ -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;
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(frontsector, wal->pos.X, wal->pos.Y, &fs_ceilingheight1, &fs_floorheight1);
PlanesAtPoint(frontsector, pt2->pos.X, pt2->pos.Y, &fs_ceilingheight2, &fs_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);
PlanesAtPoint(backsector, wal->pos.X, wal->pos.Y, &bs_ceilingheight1, &bs_floorheight1);
PlanesAtPoint(backsector, pt2->pos.X, pt2->pos.Y, &bs_ceilingheight2, &bs_floorheight2);
*bottomclip = max(min(bs_floorheight1, bs_floorheight2), min(fs_floorheight1, fs_floorheight2));

View file

@ -316,7 +316,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int section
const auto &vp = di->Viewpoint;
float florz, ceilz;
PlanesAtPointf(frontsector, vp.Pos.X, -vp.Pos.Y, &ceilz, &florz);
PlanesAtPoint(frontsector, vp.Pos.X, -vp.Pos.Y, &ceilz, &florz);
visibility = sectorVisibility(frontsector);
sec = frontsector;

View file

@ -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));
PlanesAtPointf(frontsector, wal->pos.X, wal->pos.Y, &fch1, &ffh1);
PlanesAtPointf(frontsector, p2wall->pos.X, p2wall->pos.Y, &fch2, &ffh2);
PlanesAtPoint(frontsector, wal->pos.X, wal->pos.Y, &fch1, &ffh1);
PlanesAtPoint(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;
PlanesAtPointf(backsector, wal->pos.X, wal->pos.Y, &bch1, &bfh1);
PlanesAtPointf(backsector, p2wall->pos.X, p2wall->pos.Y, &bch2, &bfh2);
PlanesAtPoint(backsector, wal->pos.X, wal->pos.Y, &bch1, &bfh1);
PlanesAtPoint(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);

View file

@ -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)};
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);
PlanesAtPoint(sector, wal->pos.X, wal->pos.Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Y);
PlanesAtPoint(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;
}
PlanesAtPointf(sector, pt[2].X, -pt[2].Z, plane ? &pt[2].Y : nullptr, plane ? nullptr : &pt[2].Y);
PlanesAtPoint(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;
@ -128,14 +128,14 @@ public:
stat = sec->floorstat;
xpan = sec->floorxpan_;
ypan = sec->floorypan_;
PlanesAtPointf(sec, ix1, iy1, nullptr, &z1);
PlanesAtPoint(sec, ix1, iy1, nullptr, &z1);
}
else
{
stat = sec->ceilingstat;
xpan = sec->ceilingxpan_;
ypan = sec->ceilingypan_;
PlanesAtPointf(sec, ix1, iy1, &z1, nullptr);
PlanesAtPoint(sec, ix1, iy1, &z1, nullptr);
}
DVector2 dv = { (ix2 - ix1), -(iy2 - iy1) };
@ -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;
PlanesAtPointf(sectorp, pt.X, -pt.Y, plane ? &pt.Z : nullptr, !plane ? &pt.Z : nullptr);
PlanesAtPoint(sectorp, pt.X, -pt.Y, plane ? &pt.Z : nullptr, !plane ? &pt.Z : nullptr);
tc = uvcalc.GetUV(pt.X, -pt.Y, pt.Z);
}
sectorp->setfloorz(fz, true);