- adjustments.

This commit is contained in:
Christoph Oelckers 2016-03-31 09:50:59 +02:00
parent a5c4e2dab3
commit c6ada2397c
6 changed files with 39 additions and 39 deletions

View File

@ -87,7 +87,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
}
else
{
fs_ceilingheight2 = fs_ceilingheight1 = frontsector->ceilingplane.fixD();
fs_ceilingheight2 = fs_ceilingheight1 = frontsector->ceilingplane.fD();
}
if (frontsector->floorplane.isSlope())
@ -97,7 +97,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
}
else
{
fs_floorheight2 = fs_floorheight1 = -frontsector->floorplane.fixD();
fs_floorheight2 = fs_floorheight1 = -frontsector->floorplane.fD();
}
if (backsector->ceilingplane.isSlope())
@ -107,7 +107,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
}
else
{
bs_ceilingheight2 = bs_ceilingheight1 = backsector->ceilingplane.fixD();
bs_ceilingheight2 = bs_ceilingheight1 = backsector->ceilingplane.fD();
}
if (backsector->floorplane.isSlope())
@ -117,7 +117,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
}
else
{
bs_floorheight2 = bs_floorheight1 = -backsector->floorplane.fixD();
bs_floorheight2 = bs_floorheight1 = -backsector->floorplane.fD();
}
// now check for closed sectors!

View File

@ -78,22 +78,22 @@ static float tics;
void gl_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * gltexture)
{
// only manipulate the texture matrix if needed.
if (secplane->xoffs != 0 || secplane->yoffs != 0 ||
secplane->xscale != FRACUNIT || secplane->yscale != FRACUNIT ||
secplane->angle != 0 ||
if (!secplane->Offs.isZero() ||
secplane->Scale.X != 1. || secplane->Scale.Y != 1 ||
secplane->Angle != 0 ||
gltexture->TextureWidth() != 64 ||
gltexture->TextureHeight() != 64)
{
float uoffs = FIXED2FLOAT(secplane->xoffs) / gltexture->TextureWidth();
float voffs = FIXED2FLOAT(secplane->yoffs) / gltexture->TextureHeight();
float uoffs = secplane->Offs.X / gltexture->TextureWidth();
float voffs = secplane->Offs.Y / gltexture->TextureHeight();
float xscale1=FIXED2FLOAT(secplane->xscale);
float yscale1=FIXED2FLOAT(secplane->yscale);
float xscale1 = secplane->Scale.X;
float yscale1 = secplane->Scale.Y;
if (gltexture->tex->bHasCanvas)
{
yscale1 = 0 - yscale1;
}
float angle=-AngleToFloat(secplane->angle);
float angle = -secplane->Angle;
float xscale2 = 64.f / gltexture->TextureWidth();
float yscale2 = 64.f / gltexture->TextureHeight();

View File

@ -1115,7 +1115,7 @@ void GLHorizonPortal::DrawContents()
gl_RenderState.SetCameraPos(FIXED2FLOAT(viewx), FIXED2FLOAT(viewy), FIXED2FLOAT(viewz));
z=FIXED2FLOAT(sp->texheight);
z=sp->Texheight;
if (gltexture && gltexture->tex->isFullbright())
@ -1238,7 +1238,7 @@ void GLEEHorizonPortal::DrawContents()
horz.colormap = origin->Sector->ColorMap;
if (origin->special1 == SKYBOX_PLANE)
{
horz.plane.texheight = viewz + abs(horz.plane.texheight);
horz.plane.Texheight = FIXED2FLOAT(viewz) + fabs(horz.plane.Texheight);
}
GLHorizonPortal ceil(&horz, true);
ceil.DrawContents();
@ -1251,7 +1251,7 @@ void GLEEHorizonPortal::DrawContents()
horz.colormap = origin->Sector->ColorMap;
if (origin->special1 == SKYBOX_PLANE)
{
horz.plane.texheight = viewz - abs(horz.plane.texheight);
horz.plane.Texheight = FIXED2FLOAT(viewz) - fabs(horz.plane.Texheight);
}
GLHorizonPortal floor(&horz, true);
floor.DrawContents();

View File

@ -173,8 +173,8 @@ void GLWall::SkyPlane(sector_t *sector, int plane, bool allowreflect)
}
else if (allowreflect && sector->GetReflect(plane) > 0)
{
if ((plane == sector_t::ceiling && viewz > sector->ceilingplane.fixD()) ||
(plane == sector_t::floor && viewz < -sector->floorplane.fixD())) return;
if ((plane == sector_t::ceiling && FIXED2DBL(viewz) > sector->ceilingplane.fD()) ||
(plane == sector_t::floor && FIXED2DBL(viewz) < -sector->floorplane.fD())) return;
ptype = PORTALTYPE_PLANEMIRROR;
planemirror = plane == sector_t::ceiling ? &sector->ceilingplane : &sector->floorplane;
}

View File

@ -72,21 +72,21 @@ struct GLSectorPlane
{
FTextureID texture;
secplane_t plane;
fixed_t texheight;
fixed_t xoffs, yoffs;
fixed_t xscale, yscale;
angle_t angle;
float Texheight;
float Angle;
FVector2 Offs;
FVector2 Scale;
void GetFromSector(sector_t * sec, int ceiling)
{
xoffs = sec->GetXOffset(ceiling);
yoffs = sec->GetYOffset(ceiling);
xscale = sec->GetXScale(ceiling);
yscale = sec->GetYScale(ceiling);
angle = sec->GetAngle(ceiling);
Offs.X = (float)sec->GetXOffsetF(ceiling);
Offs.Y = (float)sec->GetYOffsetF(ceiling);
Scale.X = (float)sec->GetXScaleF(ceiling);
Scale.Y = (float)sec->GetYScaleF(ceiling);
Angle = (float)sec->GetAngleF(ceiling).Degrees;
texture = sec->GetTexture(ceiling);
plane = sec->GetSecPlane(ceiling);
texheight = (ceiling == sector_t::ceiling)? plane.fixD() : -plane.fixD();
Texheight = (float)((ceiling == sector_t::ceiling)? plane.fD() : -plane.fD());
}
};

View File

@ -1110,11 +1110,11 @@ __forceinline void GLWall::GetPlanePos(F3DFloor::planeref *planeref, fixed_t &le
}
else if(planeref->isceiling == sector_t::ceiling)
{
left = right = planeref->plane->fixD();
left = right = FLOAT2FIXED(planeref->plane->fD());
}
else
{
left = right = -planeref->plane->fixD();
left = right = -FLOAT2FIXED(planeref->plane->fD());
}
}
@ -1459,7 +1459,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
}
else
{
ffh1 = ffh2 = -segfront->floorplane.fixD();
ffh1 = ffh2 = -FLOAT2FIXED(segfront->floorplane.fD());
zfloor[0] = zfloor[1] = FIXED2FLOAT(ffh2);
}
@ -1472,7 +1472,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
}
else
{
fch1 = fch2 = segfront->ceilingplane.fixD();
fch1 = fch2 = FLOAT2FIXED(segfront->ceilingplane.fD());
zceil[0] = zceil[1] = FIXED2FLOAT(fch2);
}
@ -1527,7 +1527,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
}
else
{
bfh1 = bfh2 = -segback->floorplane.fixD();
bfh1 = bfh2 = -FLOAT2FIXED(segback->floorplane.fD());
}
if (segback->ceilingplane.isSlope())
@ -1537,7 +1537,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
}
else
{
bch1 = bch2 = segback->ceilingplane.fixD();
bch1 = bch2 = FLOAT2FIXED(segback->ceilingplane.fD());
}
SkyTop(seg, frontsector, backsector, v1, v2);