- removed several unused setter functions for level data structures and fixed some incorrect uses.

This commit is contained in:
Christoph Oelckers 2016-04-02 22:05:23 +02:00
parent 9a07f81269
commit 9b5a4b6d43
8 changed files with 25 additions and 100 deletions

View File

@ -1931,7 +1931,7 @@ void AM_drawSubsectors()
sector_t *sec = Renderer->FakeFlat(subsectors[i].render_sector, &tempsec, &floorlight, &ceilinglight, false);
// Find texture origin.
originpt.x = -sec->GetXOffsetF(sector_t::floor);
originpt.y = sec->GetYOffset(sector_t::floor);
originpt.y = sec->GetYOffsetF(sector_t::floor);
rotation = -sec->GetAngleF(sector_t::floor);
// Coloring for the polygon
colormap = sec->ColorMap;

View File

@ -1782,7 +1782,7 @@ public:
m_Type = DCeiling::ceilLowerByValue; // doesn't really matter as long as it's no special value
m_Tag=tag;
m_TopHeight=m_BottomHeight=sec->ceilingplane.PointToDist(sec->centerspot,destheight);
m_Direction=destheight>sec->GetPlaneTexZ(sector_t::ceiling)? 1:-1;
m_Direction=destheight>sec->GetPlaneTexZF(sector_t::ceiling)? 1:-1;
// Do not interpolate instant movement ceilings.
double movedist = fabs(sec->ceilingplane.fD() - m_BottomHeight);

View File

@ -102,7 +102,7 @@ static bool MoveCeiling(sector_t *sector, int crush, double move)
// Don't let the ceiling go below the floor
if (!sector->ceilingplane.isSlope() && !sector->floorplane.isSlope() &&
sector->GetPlaneTexZ(sector_t::floor) > sector->GetPlaneTexZ(sector_t::ceiling)) return false;
sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false;
return true;
}
@ -116,7 +116,7 @@ static bool MoveFloor(sector_t *sector, int crush, double move)
// Don't let the floor go above the ceiling
if (!sector->ceilingplane.isSlope() && !sector->floorplane.isSlope() &&
sector->GetPlaneTexZ(sector_t::floor) > sector->GetPlaneTexZ(sector_t::ceiling)) return false;
sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false;
return true;
}

View File

@ -2182,7 +2182,7 @@ FUNC(LS_Sector_SetTranslucent)
FSectorTagIterator itr(arg0);
while ((secnum = itr.Next()) >= 0)
{
sectors[secnum].SetAlpha(arg1, Scale(arg2, OPAQUE, 255));
sectors[secnum].SetAlpha(arg1, clamp(arg2, 0, 255) / 255.);
sectors[secnum].ChangeFlags(arg1, ~PLANEF_ADDITIVE, arg3? PLANEF_ADDITIVE:0);
}
return true;
@ -2461,9 +2461,9 @@ FUNC(LS_Sector_SetFloorScale2)
while ((secnum = itr.Next()) >= 0)
{
if (arg1)
sectors[secnum].SetXScale(sector_t::floor, arg1);
sectors[secnum].SetXScale(sector_t::floor, xscale);
if (arg2)
sectors[secnum].SetYScale(sector_t::floor, arg2);
sectors[secnum].SetYScale(sector_t::floor, yscale);
}
return true;
}
@ -2483,9 +2483,9 @@ FUNC(LS_Sector_SetCeilingScale2)
while ((secnum = itr.Next()) >= 0)
{
if (arg1)
sectors[secnum].SetXScale(sector_t::ceiling, arg1);
sectors[secnum].SetXScale(sector_t::ceiling, xscale);
if (arg2)
sectors[secnum].SetYScale(sector_t::ceiling, arg2);
sectors[secnum].SetYScale(sector_t::ceiling, yscale);
}
return true;
}

View File

@ -1500,10 +1500,10 @@ void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
{
ss->e = &sectors[0].e[i];
if (!map->HasBehavior) ss->Flags |= SECF_FLOORDROP;
ss->SetPlaneTexZ(sector_t::floor, LittleShort(ms->floorheight)<<FRACBITS);
ss->floorplane.set(0, 0, FRACUNIT, -ss->GetPlaneTexZ(sector_t::floor));
ss->SetPlaneTexZ(sector_t::ceiling, LittleShort(ms->ceilingheight)<<FRACBITS);
ss->ceilingplane.set(0, 0, -FRACUNIT, ss->GetPlaneTexZ(sector_t::ceiling));
ss->SetPlaneTexZ(sector_t::floor, (double)LittleShort(ms->floorheight));
ss->floorplane.set(0, 0, 1., -ss->GetPlaneTexZF(sector_t::floor));
ss->SetPlaneTexZ(sector_t::ceiling, (double)LittleShort(ms->ceilingheight));
ss->ceilingplane.set(0, 0, -1., ss->GetPlaneTexZF(sector_t::ceiling));
SetTexture(ss, i, sector_t::floor, ms->floorpic, missingtex, true);
SetTexture(ss, i, sector_t::ceiling, ms->ceilingpic, missingtex, true);
ss->lightlevel = LittleShort(ms->lightlevel);
@ -1519,12 +1519,12 @@ void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
ss->prevsec = -1; // stair retriggering until build completes
ss->SetAlpha(sector_t::floor, OPAQUE);
ss->SetAlpha(sector_t::ceiling, OPAQUE);
ss->SetXScale(sector_t::floor, FRACUNIT); // [RH] floor and ceiling scaling
ss->SetYScale(sector_t::floor, FRACUNIT);
ss->SetXScale(sector_t::ceiling, FRACUNIT);
ss->SetYScale(sector_t::ceiling, FRACUNIT);
ss->SetAlpha(sector_t::floor, 1.);
ss->SetAlpha(sector_t::ceiling, 1.);
ss->SetXScale(sector_t::floor, 1.); // [RH] floor and ceiling scaling
ss->SetYScale(sector_t::floor, 1.);
ss->SetXScale(sector_t::ceiling, 1.);
ss->SetYScale(sector_t::ceiling, 1.);
ss->heightsec = NULL; // sector used to get floor and ceiling height
// killough 3/7/98: end changes

View File

@ -860,8 +860,8 @@ static void SetupFloorPortal (AStackPoint *point)
if (skyv != NULL && skyv->bAlways)
{
skyv->Mate = point;
if (Sector->GetAlpha(sector_t::floor) == OPAQUE)
Sector->SetAlpha(sector_t::floor, Scale (point->args[0], OPAQUE, 255));
if (Sector->GetAlphaF(sector_t::floor) == 1.)
Sector->SetAlpha(sector_t::floor, clamp(point->args[0], 0, 255) / 255.);
}
}
@ -874,8 +874,8 @@ static void SetupCeilingPortal (AStackPoint *point)
if (skyv != NULL && skyv->bAlways)
{
skyv->Mate = point;
if (Sector->GetAlpha(sector_t::ceiling) == OPAQUE)
Sector->SetAlpha(sector_t::ceiling, Scale(point->args[0], OPAQUE, 255));
if (Sector->GetAlphaF(sector_t::ceiling) == 1.)
Sector->SetAlpha(sector_t::ceiling, clamp(point->args[0], 0, 255) / 255.);
}
}

View File

@ -196,8 +196,8 @@ static int WriteSECTORS (FILE *file)
for (int i = 0; i < numsectors; ++i)
{
ms.floorheight = LittleShort(short(sectors[i].GetPlaneTexZ(sector_t::floor) >> FRACBITS));
ms.ceilingheight = LittleShort(short(sectors[i].GetPlaneTexZ(sector_t::ceiling) >> FRACBITS));
ms.floorheight = LittleShort(short(sectors[i].GetPlaneTexZF(sector_t::floor)));
ms.ceilingheight = LittleShort(short(sectors[i].GetPlaneTexZF(sector_t::ceiling)));
uppercopy (ms.floorpic, GetTextureName (sectors[i].GetTexture(sector_t::floor)));
uppercopy (ms.ceilingpic, GetTextureName (sectors[i].GetTexture(sector_t::ceiling)));
ms.lightlevel = LittleShort((short)sectors[i].lightlevel);

View File

@ -282,15 +282,6 @@ private:
fixed_t a, b, c, d, ic;
public:
void set(fixed_t aa, fixed_t bb, fixed_t cc, fixed_t dd)
{
a = aa;
b = bb;
c = cc;
d = dd;
ic = FixedDiv(FRACUNIT, c);
}
void set(double aa, double bb, double cc, double dd)
{
a = FLOAT2FIXED(aa);
@ -446,12 +437,6 @@ public:
return fD() - hdiff * fC();
}
// Returns how much this plane's height would change if d were set to oldd
fixed_t HeightDiff (fixed_t oldd) const
{
return FixedMul (oldd - d, ic);
}
// Returns how much this plane's height would change if d were set to oldd
double HeightDiff(double oldd) const
{
@ -464,16 +449,6 @@ public:
return (oldd - newd) * fiC();
}
fixed_t PointToDist (fixed_t x, fixed_t y, fixed_t z) const
{
return -TMulScale16 (a, x, y, b, z, c);
}
fixed_t PointToDist (const vertex_t *v, fixed_t z) const
{
return -TMulScale16 (a, v->fixX(), b, v->fixY(), z, c);
}
double PointToDist(const DVector2 &xy, double z) const
{
return -(a * xy.X + b * xy.Y + c * z) / 65536.;
@ -711,21 +686,11 @@ struct sector_t
splane planes[2];
void SetXOffset(int pos, fixed_t o)
{
planes[pos].xform.xoffs = o;
}
void SetXOffset(int pos, double o)
{
planes[pos].xform.xoffs = FLOAT2FIXED(o);
}
void AddXOffset(int pos, fixed_t o)
{
planes[pos].xform.xoffs += o;
}
void AddXOffset(int pos, double o)
{
planes[pos].xform.xoffs += FLOAT2FIXED(o);
@ -741,21 +706,11 @@ struct sector_t
return FIXED2DBL(planes[pos].xform.xoffs);
}
void SetYOffset(int pos, fixed_t o)
{
planes[pos].xform.yoffs = o;
}
void SetYOffset(int pos, double o)
{
planes[pos].xform.yoffs = FLOAT2FIXED(o);
}
void AddYOffset(int pos, fixed_t o)
{
planes[pos].xform.yoffs += o;
}
void AddYOffset(int pos, double o)
{
planes[pos].xform.yoffs += FLOAT2FIXED(o);
@ -785,11 +740,6 @@ struct sector_t
}
}
void SetXScale(int pos, fixed_t o)
{
planes[pos].xform.xscale = o;
}
void SetXScale(int pos, double o)
{
planes[pos].xform.xscale = FLOAT2FIXED(o);
@ -805,11 +755,6 @@ struct sector_t
return FIXED2DBL(planes[pos].xform.xscale);
}
void SetYScale(int pos, fixed_t o)
{
planes[pos].xform.yscale = o;
}
void SetYScale(int pos, double o)
{
planes[pos].xform.yscale = FLOAT2FIXED(o);
@ -825,11 +770,6 @@ struct sector_t
return FIXED2DBL(planes[pos].xform.yscale);
}
void SetAngle(int pos, angle_t o)
{
planes[pos].xform.angle = o;
}
void SetAngle(int pos, DAngle o)
{
planes[pos].xform.angle = o.BAMs();
@ -865,11 +805,6 @@ struct sector_t
planes[pos].xform.base_angle = o.BAMs();
}
void SetAlpha(int pos, fixed_t o)
{
planes[pos].alpha = o;
}
void SetAlpha(int pos, double o)
{
planes[pos].alpha = FLOAT2FIXED(o);
@ -928,21 +863,11 @@ struct sector_t
return FIXED2DBL(planes[pos].TexZ);
}
void SetPlaneTexZ(int pos, fixed_t val)
{
planes[pos].TexZ = val;
}
void SetPlaneTexZ(int pos, double val)
{
planes[pos].TexZ = FLOAT2FIXED(val);
}
void ChangePlaneTexZ(int pos, fixed_t val)
{
planes[pos].TexZ += val;
}
void ChangePlaneTexZ(int pos, double val)
{
planes[pos].TexZ += FLOAT2FIXED(val);