- floatification of p_3dfloors, p_3dmidtex and p_acs.cpp plus some leftovers.
- removed all references to Doom specific headers from xs_Float.h and cmath.h.
This commit is contained in:
parent
35bb686281
commit
dabed04d2a
26 changed files with 319 additions and 335 deletions
|
|
@ -221,7 +221,7 @@ void P_Attach3dMidtexLinesToSector(sector_t *sector, int lineid, int tag, bool c
|
|||
// Retrieves top and bottom of the current line's mid texture.
|
||||
//
|
||||
//============================================================================
|
||||
bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, fixed_t *ptexbot)
|
||||
bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, double *ptexbot)
|
||||
{
|
||||
if (line->sidedef[0]==NULL || line->sidedef[1]==NULL) return false;
|
||||
|
||||
|
|
@ -231,45 +231,31 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f
|
|||
FTexture * tex= TexMan(texnum);
|
||||
if (!tex) return false;
|
||||
|
||||
double totalscale = fabs(FIXED2DBL(side->GetTextureYScale(side_t::mid)) * tex->GetScaleY());
|
||||
fixed_t y_offset = side->GetTextureYOffset(side_t::mid);
|
||||
fixed_t textureheight = tex->GetScaledHeight(totalscale) << FRACBITS;
|
||||
double totalscale = fabs(side->GetTextureYScaleF(side_t::mid)) * tex->GetScaleY();
|
||||
double y_offset = side->GetTextureYOffsetF(side_t::mid);
|
||||
double textureheight = tex->GetHeight() / totalscale;
|
||||
if (totalscale != 1. && !tex->bWorldPanning)
|
||||
{
|
||||
y_offset = fixed_t(y_offset * totalscale);
|
||||
y_offset *= totalscale;
|
||||
}
|
||||
|
||||
if(line->flags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
*ptexbot = y_offset +
|
||||
MAX<fixed_t>(line->frontsector->GetPlaneTexZ(sector_t::floor), line->backsector->GetPlaneTexZ(sector_t::floor));
|
||||
MAX(line->frontsector->GetPlaneTexZF(sector_t::floor), line->backsector->GetPlaneTexZF(sector_t::floor));
|
||||
|
||||
*ptextop = *ptexbot + textureheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptextop = y_offset +
|
||||
MIN<fixed_t>(line->frontsector->GetPlaneTexZ(sector_t::ceiling), line->backsector->GetPlaneTexZ(sector_t::ceiling));
|
||||
MIN(line->frontsector->GetPlaneTexZF(sector_t::ceiling), line->backsector->GetPlaneTexZF(sector_t::ceiling));
|
||||
|
||||
*ptexbot = *ptextop - textureheight;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, double *ptexbot)
|
||||
{
|
||||
fixed_t t, b;
|
||||
if (P_GetMidTexturePosition(line, sideno, &t, &b))
|
||||
{
|
||||
*ptextop = FIXED2DBL(t);
|
||||
*ptexbot = FIXED2DBL(b);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// P_LineOpening_3dMidtex
|
||||
|
|
@ -308,8 +294,8 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening &
|
|||
open.abovemidtex = true;
|
||||
open.floorpic = linedef->sidedef[0]->GetTexture(side_t::mid);
|
||||
open.floorterrain = TerrainTypes[open.floorpic];
|
||||
open.frontfloorplane.SetAtHeight(FLOAT2FIXED(tt), sector_t::floor);
|
||||
open.backfloorplane.SetAtHeight(FLOAT2FIXED(tt), sector_t::floor);
|
||||
open.frontfloorplane.SetAtHeight(tt, sector_t::floor);
|
||||
open.backfloorplane.SetAtHeight(tt, sector_t::floor);
|
||||
|
||||
}
|
||||
// returns true if it touches the midtexture
|
||||
|
|
@ -321,7 +307,7 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening &
|
|||
/* still have to figure out what this code from Eternity means...
|
||||
if((linedef->flags & ML_BLOCKMONSTERS) &&
|
||||
!(mo->flags & (MF_FLOAT | MF_DROPOFF)) &&
|
||||
D_abs(mo->z - textop) <= 24*FRACUNIT)
|
||||
fabs(mo->Z() - tt) <= 24)
|
||||
{
|
||||
opentop = openbottom;
|
||||
openrange = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue