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

View file

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

View file

@ -1115,7 +1115,7 @@ void GLHorizonPortal::DrawContents()
gl_RenderState.SetCameraPos(FIXED2FLOAT(viewx), FIXED2FLOAT(viewy), FIXED2FLOAT(viewz)); gl_RenderState.SetCameraPos(FIXED2FLOAT(viewx), FIXED2FLOAT(viewy), FIXED2FLOAT(viewz));
z=FIXED2FLOAT(sp->texheight); z=sp->Texheight;
if (gltexture && gltexture->tex->isFullbright()) if (gltexture && gltexture->tex->isFullbright())
@ -1238,7 +1238,7 @@ void GLEEHorizonPortal::DrawContents()
horz.colormap = origin->Sector->ColorMap; horz.colormap = origin->Sector->ColorMap;
if (origin->special1 == SKYBOX_PLANE) 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); GLHorizonPortal ceil(&horz, true);
ceil.DrawContents(); ceil.DrawContents();
@ -1251,7 +1251,7 @@ void GLEEHorizonPortal::DrawContents()
horz.colormap = origin->Sector->ColorMap; horz.colormap = origin->Sector->ColorMap;
if (origin->special1 == SKYBOX_PLANE) 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); GLHorizonPortal floor(&horz, true);
floor.DrawContents(); 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) else if (allowreflect && sector->GetReflect(plane) > 0)
{ {
if ((plane == sector_t::ceiling && viewz > sector->ceilingplane.fixD()) || if ((plane == sector_t::ceiling && FIXED2DBL(viewz) > sector->ceilingplane.fD()) ||
(plane == sector_t::floor && viewz < -sector->floorplane.fixD())) return; (plane == sector_t::floor && FIXED2DBL(viewz) < -sector->floorplane.fD())) return;
ptype = PORTALTYPE_PLANEMIRROR; ptype = PORTALTYPE_PLANEMIRROR;
planemirror = plane == sector_t::ceiling ? &sector->ceilingplane : &sector->floorplane; planemirror = plane == sector_t::ceiling ? &sector->ceilingplane : &sector->floorplane;
} }

View file

@ -72,21 +72,21 @@ struct GLSectorPlane
{ {
FTextureID texture; FTextureID texture;
secplane_t plane; secplane_t plane;
fixed_t texheight; float Texheight;
fixed_t xoffs, yoffs; float Angle;
fixed_t xscale, yscale; FVector2 Offs;
angle_t angle; FVector2 Scale;
void GetFromSector(sector_t * sec, int ceiling) void GetFromSector(sector_t * sec, int ceiling)
{ {
xoffs = sec->GetXOffset(ceiling); Offs.X = (float)sec->GetXOffsetF(ceiling);
yoffs = sec->GetYOffset(ceiling); Offs.Y = (float)sec->GetYOffsetF(ceiling);
xscale = sec->GetXScale(ceiling); Scale.X = (float)sec->GetXScaleF(ceiling);
yscale = sec->GetYScale(ceiling); Scale.Y = (float)sec->GetYScaleF(ceiling);
angle = sec->GetAngle(ceiling); Angle = (float)sec->GetAngleF(ceiling).Degrees;
texture = sec->GetTexture(ceiling); texture = sec->GetTexture(ceiling);
plane = sec->GetSecPlane(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) else if(planeref->isceiling == sector_t::ceiling)
{ {
left = right = planeref->plane->fixD(); left = right = FLOAT2FIXED(planeref->plane->fD());
} }
else 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 else
{ {
ffh1 = ffh2 = -segfront->floorplane.fixD(); ffh1 = ffh2 = -FLOAT2FIXED(segfront->floorplane.fD());
zfloor[0] = zfloor[1] = FIXED2FLOAT(ffh2); zfloor[0] = zfloor[1] = FIXED2FLOAT(ffh2);
} }
@ -1472,7 +1472,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
} }
else else
{ {
fch1 = fch2 = segfront->ceilingplane.fixD(); fch1 = fch2 = FLOAT2FIXED(segfront->ceilingplane.fD());
zceil[0] = zceil[1] = FIXED2FLOAT(fch2); zceil[0] = zceil[1] = FIXED2FLOAT(fch2);
} }
@ -1527,7 +1527,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
} }
else else
{ {
bfh1 = bfh2 = -segback->floorplane.fixD(); bfh1 = bfh2 = -FLOAT2FIXED(segback->floorplane.fD());
} }
if (segback->ceilingplane.isSlope()) if (segback->ceilingplane.isSlope())
@ -1537,7 +1537,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
} }
else else
{ {
bch1 = bch2 = segback->ceilingplane.fixD(); bch1 = bch2 = FLOAT2FIXED(segback->ceilingplane.fD());
} }
SkyTop(seg, frontsector, backsector, v1, v2); SkyTop(seg, frontsector, backsector, v1, v2);