mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- floatified the few remaining linedef and sector properties that still were fixed_t. The only fixed point things left in r_defs.h are the nodes and a fixed point setter function for vertex_t, which is still needed by the node builder.
This commit is contained in:
parent
31845cd16b
commit
0f99d7d73f
21 changed files with 101 additions and 110 deletions
|
@ -250,27 +250,27 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, double x, double y, F3DFloor *
|
|||
{
|
||||
RenderFlags |= RF_RELMID;
|
||||
if (line->flags & ML_DONTPEGBOTTOM)
|
||||
Z -= front->GetPlaneTexZF(sector_t::floor);
|
||||
Z -= front->GetPlaneTexZ(sector_t::floor);
|
||||
else
|
||||
Z -= front->GetPlaneTexZF(sector_t::ceiling);
|
||||
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
||||
tex = wall->GetTexture(side_t::mid);
|
||||
}
|
||||
else if (back->floorplane.ZatPoint (x, y) >= Z)
|
||||
{
|
||||
RenderFlags |= RF_RELLOWER|RF_CLIPLOWER;
|
||||
if (line->flags & ML_DONTPEGBOTTOM)
|
||||
Z -= front->GetPlaneTexZF(sector_t::ceiling);
|
||||
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
||||
else
|
||||
Z -= back->GetPlaneTexZF(sector_t::floor);
|
||||
Z -= back->GetPlaneTexZ(sector_t::floor);
|
||||
tex = wall->GetTexture(side_t::bottom);
|
||||
}
|
||||
else if (back->ceilingplane.ZatPoint (x, y) <= Z)
|
||||
{
|
||||
RenderFlags |= RF_RELUPPER|RF_CLIPUPPER;
|
||||
if (line->flags & ML_DONTPEGTOP)
|
||||
Z -= front->GetPlaneTexZF(sector_t::ceiling);
|
||||
Z -= front->GetPlaneTexZ(sector_t::ceiling);
|
||||
else
|
||||
Z -= back->GetPlaneTexZF(sector_t::ceiling);
|
||||
Z -= back->GetPlaneTexZ(sector_t::ceiling);
|
||||
tex = wall->GetTexture(side_t::top);
|
||||
}
|
||||
else if (ffloor) // this is a 3d-floor segment - do this only if we know which one!
|
||||
|
@ -278,9 +278,9 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, double x, double y, F3DFloor *
|
|||
Sector=ffloor->model;
|
||||
RenderFlags |= RF_RELMID|RF_CLIPMID;
|
||||
if (line->flags & ML_DONTPEGBOTTOM)
|
||||
Z -= Sector->GetPlaneTexZF(sector_t::floor);
|
||||
Z -= Sector->GetPlaneTexZ(sector_t::floor);
|
||||
else
|
||||
Z -= Sector->GetPlaneTexZF(sector_t::ceiling);
|
||||
Z -= Sector->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
if (ffloor->flags & FF_UPPERTEXTURE)
|
||||
{
|
||||
|
@ -335,29 +335,29 @@ double DBaseDecal::GetRealZ (const side_t *wall) const
|
|||
case RF_RELUPPER:
|
||||
if (line->flags & ML_DONTPEGTOP)
|
||||
{
|
||||
return Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Z + back->GetPlaneTexZF(sector_t::ceiling);
|
||||
return Z + back->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
case RF_RELLOWER:
|
||||
if (line->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
return Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Z + back->GetPlaneTexZF(sector_t::floor);
|
||||
return Z + back->GetPlaneTexZ(sector_t::floor);
|
||||
}
|
||||
case RF_RELMID:
|
||||
if (line->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
return Z + front->GetPlaneTexZF(sector_t::floor);
|
||||
return Z + front->GetPlaneTexZ(sector_t::floor);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
return Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,14 +242,14 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do
|
|||
if(line->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
*ptexbot = y_offset +
|
||||
MAX(line->frontsector->GetPlaneTexZF(sector_t::floor), line->backsector->GetPlaneTexZF(sector_t::floor));
|
||||
MAX(line->frontsector->GetPlaneTexZ(sector_t::floor), line->backsector->GetPlaneTexZ(sector_t::floor));
|
||||
|
||||
*ptextop = *ptexbot + textureheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptextop = y_offset +
|
||||
MIN(line->frontsector->GetPlaneTexZF(sector_t::ceiling), line->backsector->GetPlaneTexZF(sector_t::ceiling));
|
||||
MIN(line->frontsector->GetPlaneTexZ(sector_t::ceiling), line->backsector->GetPlaneTexZ(sector_t::ceiling));
|
||||
|
||||
*ptexbot = *ptextop - textureheight;
|
||||
}
|
||||
|
|
|
@ -593,11 +593,11 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec)
|
|||
{
|
||||
if (walls[i].cstat & 512)
|
||||
{
|
||||
lines[j].Alpha = TRANSLUC33;
|
||||
lines[j].alpha = 1/3.;
|
||||
}
|
||||
else
|
||||
{
|
||||
lines[j].Alpha = TRANSLUC66;
|
||||
lines[j].alpha = 2/3.;
|
||||
}
|
||||
}
|
||||
if (walls[i].cstat & 1)
|
||||
|
|
|
@ -263,7 +263,7 @@ static bool LoadGLVertexes(FileReader * lump)
|
|||
|
||||
for (i = firstglvertex; i < numvertexes; i++)
|
||||
{
|
||||
vertexes[i].set(LittleLong(mgl->x), LittleLong(mgl->y));
|
||||
vertexes[i].set(LittleLong(mgl->x)/65536., LittleLong(mgl->y)/65536.);
|
||||
mgl++;
|
||||
}
|
||||
delete[] gldata;
|
||||
|
|
|
@ -103,7 +103,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->PortalIsLinked(sector_t::floor) &&
|
||||
sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false;
|
||||
sector->GetPlaneTexZ(sector_t::floor) > sector->GetPlaneTexZ(sector_t::ceiling)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -118,7 +118,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->PortalIsLinked(sector_t::ceiling) &&
|
||||
sector->GetPlaneTexZF(sector_t::floor) > sector->GetPlaneTexZF(sector_t::ceiling)) return false;
|
||||
sector->GetPlaneTexZ(sector_t::floor) > sector->GetPlaneTexZ(sector_t::ceiling)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2987,7 +2987,7 @@ FUNC(LS_TranslucentLine)
|
|||
int linenum;
|
||||
while ((linenum = itr.Next()) >= 0)
|
||||
{
|
||||
lines[linenum].Alpha = Scale(clamp(arg1, 0, 255), OPAQUE, 255);
|
||||
lines[linenum].alpha = clamp(arg1, 0, 255) / 255.;
|
||||
if (arg2 == 0)
|
||||
{
|
||||
lines[linenum].flags &= ~ML_ADDTRANS;
|
||||
|
|
|
@ -396,7 +396,7 @@ void P_SerializeWorld (FArchive &arc)
|
|||
arc << li->flags
|
||||
<< li->activation
|
||||
<< li->special
|
||||
<< li->Alpha;
|
||||
<< li->alpha;
|
||||
|
||||
if (P_IsACSSpecial(li->special))
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ double sector_t::FindLowestFloorSurrounding (vertex_t **v) const
|
|||
double ofloor;
|
||||
vertex_t *spot;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::floor);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::floor);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
floor = floorplane.ZatPoint(spot);
|
||||
|
@ -117,7 +117,7 @@ double sector_t::FindHighestFloorSurrounding (vertex_t **v) const
|
|||
double ofloor;
|
||||
vertex_t *spot;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::floor);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::floor);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
floor = -FLT_MAX;
|
||||
|
@ -168,7 +168,7 @@ double sector_t::FindNextHighestFloor (vertex_t **v) const
|
|||
line_t *check;
|
||||
int i;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::floor);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::floor);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = floorplane.ZatPoint(spot);
|
||||
|
@ -223,7 +223,7 @@ double sector_t::FindNextLowestFloor (vertex_t **v) const
|
|||
line_t *check;
|
||||
int i;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::floor);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::floor);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = floorplane.ZatPoint (spot);
|
||||
|
@ -278,7 +278,7 @@ double sector_t::FindNextLowestCeiling (vertex_t **v) const
|
|||
int i;
|
||||
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::ceiling);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = ceilingplane.ZatPoint(spot);
|
||||
|
@ -332,7 +332,7 @@ double sector_t::FindNextHighestCeiling (vertex_t **v) const
|
|||
line_t *check;
|
||||
int i;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::ceiling);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = ceilingplane.ZatPoint(spot);
|
||||
|
@ -378,7 +378,7 @@ double sector_t::FindLowestCeilingSurrounding (vertex_t **v) const
|
|||
line_t *check;
|
||||
int i;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::ceiling);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = FLT_MAX;
|
||||
|
@ -420,7 +420,7 @@ double sector_t::FindHighestCeilingSurrounding (vertex_t **v) const
|
|||
line_t *check;
|
||||
int i;
|
||||
|
||||
if (linecount == 0) return GetPlaneTexZF(sector_t::ceiling);
|
||||
if (linecount == 0) return GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
spot = lines[0]->v1;
|
||||
height = -FLT_MAX;
|
||||
|
@ -879,7 +879,7 @@ void sector_t::CheckPortalPlane(int plane)
|
|||
if (GetPortalType(plane) == PORTS_LINKEDPORTAL)
|
||||
{
|
||||
double portalh = GetPortalPlaneZ(plane);
|
||||
double planeh = GetPlaneTexZF(plane);
|
||||
double planeh = GetPlaneTexZ(plane);
|
||||
int obstructed = PLANEF_OBSTRUCTED * (plane == sector_t::floor ? planeh > portalh : planeh < portalh);
|
||||
planes[plane].Flags = (planes[plane].Flags & ~PLANEF_OBSTRUCTED) | obstructed;
|
||||
}
|
||||
|
|
|
@ -862,7 +862,7 @@ void P_LoadVertexes (MapData * map)
|
|||
SWORD x, y;
|
||||
|
||||
(*map->file) >> x >> y;
|
||||
vertexes[i].set(x << FRACBITS, y << FRACBITS);
|
||||
vertexes[i].set(double(x), double(y));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1497,9 +1497,9 @@ void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
|||
ss->e = §ors[0].e[i];
|
||||
if (!map->HasBehavior) ss->Flags |= SECF_FLOORDROP;
|
||||
ss->SetPlaneTexZ(sector_t::floor, (double)LittleShort(ms->floorheight));
|
||||
ss->floorplane.set(0, 0, 1., -ss->GetPlaneTexZF(sector_t::floor));
|
||||
ss->floorplane.set(0, 0, 1., -ss->GetPlaneTexZ(sector_t::floor));
|
||||
ss->SetPlaneTexZ(sector_t::ceiling, (double)LittleShort(ms->ceilingheight));
|
||||
ss->ceilingplane.set(0, 0, -1., ss->GetPlaneTexZF(sector_t::ceiling));
|
||||
ss->ceilingplane.set(0, 0, -1., ss->GetPlaneTexZ(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);
|
||||
|
@ -2043,10 +2043,10 @@ void P_FinishLoadingLineDef(line_t *ld, int alpha)
|
|||
additive = true;
|
||||
}
|
||||
|
||||
alpha = Scale(alpha, OPAQUE, 255);
|
||||
double dalpha = alpha / 255.;
|
||||
if (!ld->args[0])
|
||||
{
|
||||
ld->Alpha = alpha;
|
||||
ld->alpha = dalpha;
|
||||
if (additive)
|
||||
{
|
||||
ld->flags |= ML_ADDTRANS;
|
||||
|
@ -2058,7 +2058,7 @@ void P_FinishLoadingLineDef(line_t *ld, int alpha)
|
|||
{
|
||||
if (tagManager.LineHasID(j, ld->args[0]))
|
||||
{
|
||||
lines[j].Alpha = alpha;
|
||||
lines[j].alpha = dalpha;
|
||||
if (additive)
|
||||
{
|
||||
lines[j].flags |= ML_ADDTRANS;
|
||||
|
@ -2160,7 +2160,7 @@ void P_LoadLineDefs (MapData * map)
|
|||
ld = lines;
|
||||
for (i = 0; i < numlines; i++, mld++, ld++)
|
||||
{
|
||||
ld->Alpha = OPAQUE; // [RH] Opaque by default
|
||||
ld->alpha = 1.; // [RH] Opaque by default
|
||||
ld->portalindex = UINT_MAX;
|
||||
|
||||
// [RH] Translate old linedef special and flags to be
|
||||
|
@ -2264,7 +2264,7 @@ void P_LoadLineDefs2 (MapData * map)
|
|||
|
||||
ld->v1 = &vertexes[LittleShort(mld->v1)];
|
||||
ld->v2 = &vertexes[LittleShort(mld->v2)];
|
||||
ld->Alpha = OPAQUE; // [RH] Opaque by default
|
||||
ld->alpha = 1.; // [RH] Opaque by default
|
||||
|
||||
P_SetSideNum (&ld->sidedef[0], LittleShort(mld->sidenum[0]));
|
||||
P_SetSideNum (&ld->sidedef[1], LittleShort(mld->sidenum[1]));
|
||||
|
|
|
@ -209,7 +209,7 @@ void P_VavoomSlope(sector_t * sec, int id, const DVector3 &pos, int which)
|
|||
{
|
||||
DVector3 v1, v2, cross;
|
||||
secplane_t *srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
||||
double srcheight = (which == 0) ? sec->GetPlaneTexZF(sector_t::floor) : sec->GetPlaneTexZF(sector_t::ceiling);
|
||||
double srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
v1[0] = pos.X - l->v2->fX();
|
||||
v1[1] = pos.Y - l->v2->fY();
|
||||
|
@ -328,9 +328,9 @@ static void P_SetSlopesFromVertexHeights(FMapThing *firstmt, FMapThing *lastmt,
|
|||
double *h3 = vt_heights[j].CheckKey(vi3);
|
||||
if (h1 == NULL && h2 == NULL && h3 == NULL) continue;
|
||||
|
||||
vt1.Z = h1? *h1 : j==0? sec->GetPlaneTexZF(sector_t::floor) : sec->GetPlaneTexZF(sector_t::ceiling);
|
||||
vt2.Z = h2? *h2 : j==0? sec->GetPlaneTexZF(sector_t::floor) : sec->GetPlaneTexZF(sector_t::ceiling);
|
||||
vt3.Z = h3? *h3 : j==0? sec->GetPlaneTexZF(sector_t::floor) : sec->GetPlaneTexZF(sector_t::ceiling);
|
||||
vt1.Z = h1? *h1 : j==0? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
vt2.Z = h2? *h2 : j==0? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
vt3.Z = h3? *h3 : j==0? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
if (P_PointOnLineSidePrecise(vertexes[vi3].fX(), vertexes[vi3].fY(), sec->lines[0]) == 0)
|
||||
{
|
||||
|
@ -488,8 +488,8 @@ static void P_AlignPlane(sector_t *sec, line_t *line, int which)
|
|||
double srcheight, destheight;
|
||||
|
||||
srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
||||
srcheight = (which == 0) ? sec->GetPlaneTexZF(sector_t::floor) : sec->GetPlaneTexZF(sector_t::ceiling);
|
||||
destheight = (which == 0) ? refsec->GetPlaneTexZF(sector_t::floor) : refsec->GetPlaneTexZF(sector_t::ceiling);
|
||||
srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
destheight = (which == 0) ? refsec->GetPlaneTexZ(sector_t::floor) : refsec->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
p[0] = line->v1->fX();
|
||||
p[1] = line->v1->fY();
|
||||
|
|
|
@ -841,7 +841,7 @@ static void SetupFloorPortal (AStackPoint *point)
|
|||
if (skyv != NULL)
|
||||
{
|
||||
skyv->target = point;
|
||||
if (Sector->GetAlphaF(sector_t::floor) == 1.)
|
||||
if (Sector->GetAlpha(sector_t::floor) == 1.)
|
||||
Sector->SetAlpha(sector_t::floor, clamp(point->args[0], 0, 255) / 255.);
|
||||
|
||||
Sector->Portals[sector_t::floor] = P_GetStackPortal(skyv, sector_t::floor);
|
||||
|
@ -856,7 +856,7 @@ static void SetupCeilingPortal (AStackPoint *point)
|
|||
if (skyv != NULL)
|
||||
{
|
||||
skyv->target = point;
|
||||
if (Sector->GetAlphaF(sector_t::ceiling) == 1.)
|
||||
if (Sector->GetAlpha(sector_t::ceiling) == 1.)
|
||||
Sector->SetAlpha(sector_t::ceiling, clamp(point->args[0], 0, 255) / 255.);
|
||||
|
||||
Sector->Portals[sector_t::ceiling] = P_GetStackPortal(skyv, sector_t::ceiling);
|
||||
|
@ -917,7 +917,7 @@ static void SetPortal(sector_t *sector, int plane, unsigned pnum, double alpha)
|
|||
if (sector->GetPortalType(sector_t::ceiling) == PORTS_SKYVIEWPOINT)
|
||||
{
|
||||
sector->Portals[sector_t::ceiling] = pnum;
|
||||
if (sector->GetAlphaF(sector_t::ceiling) == 1.)
|
||||
if (sector->GetAlpha(sector_t::ceiling) == 1.)
|
||||
sector->SetAlpha(sector_t::ceiling, alpha);
|
||||
|
||||
if (sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
|
@ -930,7 +930,7 @@ static void SetPortal(sector_t *sector, int plane, unsigned pnum, double alpha)
|
|||
{
|
||||
sector->Portals[sector_t::floor] = pnum;
|
||||
}
|
||||
if (sector->GetAlphaF(sector_t::floor) == 1.)
|
||||
if (sector->GetAlpha(sector_t::floor) == 1.)
|
||||
sector->SetAlpha(sector_t::floor, alpha);
|
||||
|
||||
if (sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
|
|
|
@ -785,7 +785,7 @@ public:
|
|||
FString tagstring;
|
||||
|
||||
memset(ld, 0, sizeof(*ld));
|
||||
ld->Alpha = OPAQUE;
|
||||
ld->alpha = 1.;
|
||||
ld->portalindex = UINT_MAX;
|
||||
ld->sidedef[0] = ld->sidedef[1] = NULL;
|
||||
if (level.flags2 & LEVEL2_CLIPMIDTEX) ld->flags |= ML_CLIP_MIDTEX;
|
||||
|
@ -1087,13 +1087,13 @@ public:
|
|||
{
|
||||
ld->activation = (ld->activation & ~SPAC_Use) | SPAC_UseThrough;
|
||||
}
|
||||
if (strifetrans && ld->Alpha == OPAQUE)
|
||||
if (strifetrans && ld->alpha == 1.)
|
||||
{
|
||||
ld->Alpha = TRANSLUC75;
|
||||
ld->alpha = 0.75;
|
||||
}
|
||||
if (strifetrans2 && ld->Alpha == OPAQUE)
|
||||
if (strifetrans2 && ld->alpha == OPAQUE)
|
||||
{
|
||||
ld->Alpha = TRANSLUC25;
|
||||
ld->alpha = 0.25;
|
||||
}
|
||||
if (ld->sidedef[0] == NULL)
|
||||
{
|
||||
|
@ -1596,7 +1596,7 @@ public:
|
|||
// Reset the planes to their defaults if not all of the plane equation's parameters were found.
|
||||
if (fplaneflags != 15)
|
||||
{
|
||||
sec->floorplane.SetAtHeight(sec->GetPlaneTexZF(sector_t::floor), sector_t::floor);
|
||||
sec->floorplane.SetAtHeight(sec->GetPlaneTexZ(sector_t::floor), sector_t::floor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1606,7 +1606,7 @@ public:
|
|||
}
|
||||
if (cplaneflags != 15)
|
||||
{
|
||||
sec->ceilingplane.SetAtHeight(sec->GetPlaneTexZF(sector_t::ceiling), sector_t::ceiling);
|
||||
sec->ceilingplane.SetAtHeight(sec->GetPlaneTexZ(sector_t::ceiling), sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -196,8 +196,8 @@ static int WriteSECTORS (FILE *file)
|
|||
|
||||
for (int i = 0; i < numsectors; ++i)
|
||||
{
|
||||
ms.floorheight = LittleShort(short(sectors[i].GetPlaneTexZF(sector_t::floor)));
|
||||
ms.ceilingheight = LittleShort(short(sectors[i].GetPlaneTexZF(sector_t::ceiling)));
|
||||
ms.floorheight = LittleShort(short(sectors[i].GetPlaneTexZ(sector_t::floor)));
|
||||
ms.ceilingheight = LittleShort(short(sectors[i].GetPlaneTexZ(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);
|
||||
|
|
|
@ -87,10 +87,10 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld, int lineindexforid)
|
|||
passthrough = true;
|
||||
break;
|
||||
case -2:
|
||||
ld->Alpha = TRANSLUC75;
|
||||
ld->alpha = 0.75;
|
||||
break;
|
||||
case -3:
|
||||
ld->Alpha = TRANSLUC25;
|
||||
ld->alpha = 0.25;
|
||||
break;
|
||||
default:
|
||||
newflags |= LineFlagTranslations[i].newvalue;
|
||||
|
|
|
@ -708,7 +708,7 @@ unsigned P_GetPortal(int type, int plane, sector_t *from, sector_t *to, const DV
|
|||
sectorPortals[i].mOrigin = from;
|
||||
sectorPortals[i].mDestination = to;
|
||||
sectorPortals[i].mDisplacement = displacement;
|
||||
sectorPortals[i].mPlaneZ = type == PORTS_LINKEDPORTAL? from->GetPlaneTexZF(plane) : FLT_MAX;
|
||||
sectorPortals[i].mPlaneZ = type == PORTS_LINKEDPORTAL? from->GetPlaneTexZ(plane) : FLT_MAX;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
|
@ -441,12 +441,12 @@ void DSectorPlaneInterpolation::UpdateInterpolation()
|
|||
if (!ceiling)
|
||||
{
|
||||
oldheight = sector->floorplane.fD();
|
||||
oldtexz = sector->GetPlaneTexZF(sector_t::floor);
|
||||
oldtexz = sector->GetPlaneTexZ(sector_t::floor);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldheight = sector->ceilingplane.fD();
|
||||
oldtexz = sector->GetPlaneTexZF(sector_t::ceiling);
|
||||
oldtexz = sector->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ void DSectorPlaneInterpolation::Interpolate(double smoothratio)
|
|||
}
|
||||
|
||||
bakheight = pplane->fD();
|
||||
baktexz = sector->GetPlaneTexZF(pos);
|
||||
baktexz = sector->GetPlaneTexZ(pos);
|
||||
|
||||
if (refcount == 0 && oldheight == bakheight)
|
||||
{
|
||||
|
|
28
src/r_defs.h
28
src/r_defs.h
|
@ -657,9 +657,9 @@ public:
|
|||
FTransform xform;
|
||||
int Flags;
|
||||
int Light;
|
||||
fixed_t alpha;
|
||||
double alpha;
|
||||
FTextureID Texture;
|
||||
fixed_t TexZ;
|
||||
double TexZ;
|
||||
};
|
||||
|
||||
|
||||
|
@ -747,19 +747,14 @@ public:
|
|||
|
||||
void SetAlpha(int pos, double o)
|
||||
{
|
||||
planes[pos].alpha = FLOAT2FIXED(o);
|
||||
planes[pos].alpha = o;
|
||||
}
|
||||
|
||||
fixed_t GetAlpha(int pos) const
|
||||
double GetAlpha(int pos) const
|
||||
{
|
||||
return planes[pos].alpha;
|
||||
}
|
||||
|
||||
double GetAlphaF(int pos) const
|
||||
{
|
||||
return FIXED2DBL(planes[pos].alpha);
|
||||
}
|
||||
|
||||
int GetFlags(int pos) const
|
||||
{
|
||||
return planes[pos].Flags;
|
||||
|
@ -799,24 +794,19 @@ public:
|
|||
if (floorclip && pos == floor && tex != old) AdjustFloorClip();
|
||||
}
|
||||
|
||||
fixed_t GetPlaneTexZ(int pos) const
|
||||
double GetPlaneTexZ(int pos) const
|
||||
{
|
||||
return planes[pos].TexZ;
|
||||
}
|
||||
|
||||
double GetPlaneTexZF(int pos) const
|
||||
{
|
||||
return FIXED2DBL(planes[pos].TexZ);
|
||||
}
|
||||
|
||||
void SetPlaneTexZ(int pos, double val)
|
||||
{
|
||||
planes[pos].TexZ = FLOAT2FIXED(val);
|
||||
planes[pos].TexZ = val;
|
||||
}
|
||||
|
||||
void ChangePlaneTexZ(int pos, double val)
|
||||
{
|
||||
planes[pos].TexZ += FLOAT2FIXED(val);
|
||||
planes[pos].TexZ += val;
|
||||
}
|
||||
|
||||
static inline short ClampLight(int level)
|
||||
|
@ -1218,8 +1208,8 @@ public:
|
|||
DWORD flags;
|
||||
DWORD activation; // activation type
|
||||
int special;
|
||||
fixed_t Alpha; // <--- translucency (0=invisibile, FRACUNIT=opaque)
|
||||
int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width)
|
||||
double alpha; // <--- translucency (0=invisibile, FRACUNIT=opaque)
|
||||
side_t *sidedef[2];
|
||||
double bbox[4]; // bounding box, for the extent of the LineDef.
|
||||
sector_t *frontsector, *backsector;
|
||||
|
@ -1239,7 +1229,7 @@ public:
|
|||
|
||||
void setAlpha(double a)
|
||||
{
|
||||
Alpha = FLOAT2FIXED(a);
|
||||
alpha = a;
|
||||
}
|
||||
|
||||
FLinePortal *getPortal() const
|
||||
|
|
|
@ -581,7 +581,7 @@ static visplane_t *new_visplane (unsigned hash)
|
|||
// killough 2/28/98: Add offsets
|
||||
//==========================================================================
|
||||
|
||||
visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightlevel, fixed_t alpha, bool additive,
|
||||
visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive,
|
||||
const FTransform &xform,
|
||||
int sky, FSectorPortal *portal)
|
||||
{
|
||||
|
@ -593,6 +593,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl
|
|||
fixed_t yoffs = FLOAT2FIXED(xform.yOffs + xform.baseyOffs);
|
||||
fixed_t xscale = FLOAT2FIXED(xform.xScale);
|
||||
fixed_t yscale = FLOAT2FIXED(xform.yScale);
|
||||
fixed_t alpha = FLOAT2FIXED(Alpha);
|
||||
angle_t angle = (xform.Angle + xform.baseAngle).BAMs();
|
||||
|
||||
if (picnum == skyflatnum) // killough 10/98
|
||||
|
|
|
@ -98,7 +98,7 @@ visplane_t *R_FindPlane
|
|||
( const secplane_t &height,
|
||||
FTextureID picnum,
|
||||
int lightlevel,
|
||||
fixed_t alpha,
|
||||
double alpha,
|
||||
bool additive,
|
||||
const FTransform &xform,
|
||||
int sky,
|
||||
|
|
|
@ -243,7 +243,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
ESPSResult drawmode;
|
||||
|
||||
drawmode = R_SetPatchStyle (LegacyRenderStyles[curline->linedef->flags & ML_ADDTRANS ? STYLE_Add : STYLE_Translucent],
|
||||
MIN<fixed_t>(curline->linedef->Alpha, OPAQUE), 0, 0);
|
||||
(float)MIN(curline->linedef->alpha, 1.), 0, 0);
|
||||
|
||||
if ((drawmode == DontDraw && !ds->bFogBoundary && !ds->bFakeBoundary))
|
||||
{
|
||||
|
@ -325,11 +325,11 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
|
|||
}
|
||||
if (curline->linedef->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
dc_texturemid = MAX(frontsector->GetPlaneTexZF(sector_t::floor), backsector->GetPlaneTexZF(sector_t::floor)) + texheight;
|
||||
dc_texturemid = MAX(frontsector->GetPlaneTexZ(sector_t::floor), backsector->GetPlaneTexZ(sector_t::floor)) + texheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
dc_texturemid = MIN(frontsector->GetPlaneTexZF(sector_t::ceiling), backsector->GetPlaneTexZF(sector_t::ceiling));
|
||||
dc_texturemid = MIN(frontsector->GetPlaneTexZ(sector_t::ceiling), backsector->GetPlaneTexZ(sector_t::ceiling));
|
||||
}
|
||||
|
||||
rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
|
||||
|
@ -603,7 +603,7 @@ void R_RenderFakeWall(drawseg_t *ds, int x1, int x2, F3DFloor *rover)
|
|||
yscale = rw_pic->Scale.Y * scaledside->GetTextureYScale(scaledpart);
|
||||
|
||||
double rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureYOffset(side_t::mid);
|
||||
double planez = rover->model->GetPlaneTexZF(sector_t::ceiling);
|
||||
double planez = rover->model->GetPlaneTexZ(sector_t::ceiling);
|
||||
rw_offset = FLOAT2FIXED(curline->sidedef->GetTextureXOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureXOffset(side_t::mid));
|
||||
if (rowoffset < 0)
|
||||
{
|
||||
|
@ -2035,11 +2035,11 @@ void R_NewWall (bool needlights)
|
|||
{ // normal orientation
|
||||
if (linedef->flags & ML_DONTPEGBOTTOM)
|
||||
{ // bottom of texture at bottom
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZF(sector_t::floor) - ViewPos.Z) * yrepeat + midtexture->GetHeight();
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZ(sector_t::floor) - ViewPos.Z) * yrepeat + midtexture->GetHeight();
|
||||
}
|
||||
else
|
||||
{ // top of texture at top
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
if (rowoffset < 0 && midtexture != NULL)
|
||||
{
|
||||
rowoffset += midtexture->GetHeight();
|
||||
|
@ -2051,11 +2051,11 @@ void R_NewWall (bool needlights)
|
|||
rowoffset = -rowoffset;
|
||||
if (linedef->flags & ML_DONTPEGBOTTOM)
|
||||
{ // top of texture at bottom
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZF(sector_t::floor) - ViewPos.Z) * yrepeat;
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZ(sector_t::floor) - ViewPos.Z) * yrepeat;
|
||||
}
|
||||
else
|
||||
{ // bottom of texture at top
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat + midtexture->GetHeight();
|
||||
rw_midtexturemid = (frontsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat + midtexture->GetHeight();
|
||||
}
|
||||
}
|
||||
if (midtexture->bWorldPanning)
|
||||
|
@ -2074,7 +2074,7 @@ void R_NewWall (bool needlights)
|
|||
{ // two-sided line
|
||||
// hack to allow height changes in outdoor areas
|
||||
|
||||
rw_frontlowertop = frontsector->GetPlaneTexZF(sector_t::ceiling);
|
||||
rw_frontlowertop = frontsector->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
||||
if (frontsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
||||
backsector->GetTexture(sector_t::ceiling) == skyflatnum)
|
||||
|
@ -2095,7 +2095,7 @@ void R_NewWall (bool needlights)
|
|||
}
|
||||
// Putting sky ceilings on the front and back of a line alters the way unpegged
|
||||
// positioning works.
|
||||
rw_frontlowertop = backsector->GetPlaneTexZF(sector_t::ceiling);
|
||||
rw_frontlowertop = backsector->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
|
||||
if ((rw_backcz1 <= rw_frontfz1 && rw_backcz2 <= rw_frontfz2) ||
|
||||
|
@ -2179,7 +2179,7 @@ void R_NewWall (bool needlights)
|
|||
{ // normal orientation
|
||||
if (linedef->flags & ML_DONTPEGTOP)
|
||||
{ // top of texture at top
|
||||
rw_toptexturemid = (frontsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
rw_toptexturemid = (frontsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
if (rowoffset < 0 && toptexture != NULL)
|
||||
{
|
||||
rowoffset += toptexture->GetHeight();
|
||||
|
@ -2187,7 +2187,7 @@ void R_NewWall (bool needlights)
|
|||
}
|
||||
else
|
||||
{ // bottom of texture at bottom
|
||||
rw_toptexturemid = (backsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat + toptexture->GetHeight();
|
||||
rw_toptexturemid = (backsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat + toptexture->GetHeight();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2195,11 +2195,11 @@ void R_NewWall (bool needlights)
|
|||
rowoffset = -rowoffset;
|
||||
if (linedef->flags & ML_DONTPEGTOP)
|
||||
{ // bottom of texture at top
|
||||
rw_toptexturemid = (frontsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat + toptexture->GetHeight();
|
||||
rw_toptexturemid = (frontsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat + toptexture->GetHeight();
|
||||
}
|
||||
else
|
||||
{ // top of texture at bottom
|
||||
rw_toptexturemid = (backsector->GetPlaneTexZF(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
rw_toptexturemid = (backsector->GetPlaneTexZ(sector_t::ceiling) - ViewPos.Z) * yrepeat;
|
||||
}
|
||||
}
|
||||
if (toptexture->bWorldPanning)
|
||||
|
@ -2228,7 +2228,7 @@ void R_NewWall (bool needlights)
|
|||
}
|
||||
else
|
||||
{ // top of texture at top
|
||||
rw_bottomtexturemid = (backsector->GetPlaneTexZF(sector_t::floor) - ViewPos.Z) * yrepeat;
|
||||
rw_bottomtexturemid = (backsector->GetPlaneTexZ(sector_t::floor) - ViewPos.Z) * yrepeat;
|
||||
if (rowoffset < 0 && bottomtexture != NULL)
|
||||
{
|
||||
rowoffset += bottomtexture->GetHeight();
|
||||
|
@ -2244,7 +2244,7 @@ void R_NewWall (bool needlights)
|
|||
}
|
||||
else
|
||||
{ // bottom of texture at top
|
||||
rw_bottomtexturemid = (backsector->GetPlaneTexZF(sector_t::floor) - ViewPos.Z) * yrepeat + bottomtexture->GetHeight();
|
||||
rw_bottomtexturemid = (backsector->GetPlaneTexZ(sector_t::floor) - ViewPos.Z) * yrepeat + bottomtexture->GetHeight();
|
||||
}
|
||||
}
|
||||
if (bottomtexture->bWorldPanning)
|
||||
|
@ -3047,31 +3047,31 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper,
|
|||
case RF_RELUPPER:
|
||||
if (curline->linedef->flags & ML_DONTPEGTOP)
|
||||
{
|
||||
zpos = decal->Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
zpos = decal->Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
{
|
||||
zpos = decal->Z + back->GetPlaneTexZF(sector_t::ceiling);
|
||||
zpos = decal->Z + back->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
break;
|
||||
case RF_RELLOWER:
|
||||
if (curline->linedef->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
zpos = decal->Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
zpos = decal->Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
{
|
||||
zpos = decal->Z + back->GetPlaneTexZF(sector_t::floor);
|
||||
zpos = decal->Z + back->GetPlaneTexZ(sector_t::floor);
|
||||
}
|
||||
break;
|
||||
case RF_RELMID:
|
||||
if (curline->linedef->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
zpos = decal->Z + front->GetPlaneTexZF(sector_t::floor);
|
||||
zpos = decal->Z + front->GetPlaneTexZ(sector_t::floor);
|
||||
}
|
||||
else
|
||||
{
|
||||
zpos = decal->Z + front->GetPlaneTexZF(sector_t::ceiling);
|
||||
zpos = decal->Z + front->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,11 +72,11 @@ const char *GetVersionString();
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 4542
|
||||
#define MINSAVEVER 4543
|
||||
|
||||
// Use 4500 as the base git save version, since it's higher than the
|
||||
// SVN revision ever got.
|
||||
#define SAVEVER 4542
|
||||
#define SAVEVER 4543
|
||||
|
||||
#define SAVEVERSTRINGIFY2(x) #x
|
||||
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
||||
|
|
Loading…
Reference in a new issue