From cadd8f2d4a7f20cfff557486d22abd718182e7ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 29 Mar 2016 16:31:58 +0200 Subject: [PATCH] - made adjustments for changes to linedef delta. --- src/gl/data/gl_portaldata.cpp | 8 ++++---- src/gl/dynlights/a_dynlight.cpp | 6 +++--- src/gl/scene/gl_portal.cpp | 4 ++-- src/gl/scene/gl_portal.h | 8 ++++---- src/gl/scene/gl_walls.cpp | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gl/data/gl_portaldata.cpp b/src/gl/data/gl_portaldata.cpp index de59c0583f..8229767c17 100644 --- a/src/gl/data/gl_portaldata.cpp +++ b/src/gl/data/gl_portaldata.cpp @@ -463,14 +463,14 @@ void gl_InitPortals() line_t *pSrcLine2 = linePortals[j].mOrigin; line_t *pLine2 = linePortals[j].mDestination; // angular precision is intentionally reduced to 32 bit BAM to account for precision problems (otherwise many not perfectly horizontal or vertical portals aren't found here.) - angle_t srcang = RAD2ANGLE(atan2(pSrcLine->dy, pSrcLine->dx)); - angle_t dstang = RAD2ANGLE(atan2(pLine->dy, pLine->dx)); + unsigned srcang = pSrcLine->Delta().Angle().BAMs(); + unsigned dstang = pLine->Delta().Angle().BAMs(); if ((pSrcLine->v2 == pSrcLine2->v1 && pLine->v1 == pLine2->v2) || (pSrcLine->v1 == pSrcLine2->v2 && pLine->v2 == pLine2->v1)) { // The line connects, now check the translation - fixed_t srcang2 = RAD2ANGLE(atan2(pSrcLine2->dy, pSrcLine2->dx)); - fixed_t dstang2 = RAD2ANGLE(atan2(pLine2->dy, pLine2->dx)); + unsigned srcang2 = pSrcLine2->Delta().Angle().BAMs(); + unsigned dstang2 = pLine2->Delta().Angle().BAMs(); if (srcang == srcang2 && dstang == dstang2) { // The lines connect and both source and destination are colinear, so this is a match diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index 99f1a4d9b8..06df7f12b3 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -572,7 +572,7 @@ void ADynamicLight::CollectWithinRadius(const fixedvec3 &pos, subsector_t *subSe line_t *other = port->mDestination; if (other->validcount != ::validcount) { - subsector_t *othersub = R_PointInSubsector(other->v1->fixX() + other->dx / 2, other->v1->fixY() + other->dy / 2); + subsector_t *othersub = R_PointInSubsector(other->v1->fixX() + other->fixDx() / 2, other->v1->fixY() + other->fixDy() / 2); if (othersub->validcount != ::validcount) CollectWithinRadius(_f_PosRelative(other), othersub, radius); } } @@ -599,7 +599,7 @@ void ADynamicLight::CollectWithinRadius(const fixedvec3 &pos, subsector_t *subSe AActor *sb = subSec->sector->SkyBoxes[sector_t::ceiling]; if (sb->specialf1 < Z() + radius) { - fixedvec2 refpos = { other->v1->fixX() + other->dx / 2 + FLOAT2FIXED(sb->Scale.X), other->v1->fixY() + other->dy / 2 + FLOAT2FIXED(sb->Scale.Y) }; + fixedvec2 refpos = { other->v1->fixX() + other->fixDx() / 2 + FLOAT2FIXED(sb->Scale.X), other->v1->fixY() + other->fixDy() / 2 + FLOAT2FIXED(sb->Scale.Y) }; subsector_t *othersub = R_PointInSubsector(refpos.x, refpos.y); if (othersub->validcount != ::validcount) CollectWithinRadius(_f_PosRelative(othersub->sector), othersub, radius); } @@ -610,7 +610,7 @@ void ADynamicLight::CollectWithinRadius(const fixedvec3 &pos, subsector_t *subSe AActor *sb = subSec->sector->SkyBoxes[sector_t::floor]; if (sb->specialf1 > Z() - radius) { - fixedvec2 refpos = { other->v1->fixX() + other->dx / 2 + FLOAT2FIXED(sb->Scale.X), other->v1->fixY() + other->dy / 2 + FLOAT2FIXED(sb->Scale.Y) }; + fixedvec2 refpos = { other->v1->fixX() + other->fixDx() / 2 + FLOAT2FIXED(sb->Scale.X), other->v1->fixY() + other->fixDy() / 2 + FLOAT2FIXED(sb->Scale.Y) }; subsector_t *othersub = R_PointInSubsector(refpos.x, refpos.y); if (othersub->validcount != ::validcount) CollectWithinRadius(_f_PosRelative(othersub->sector), othersub, radius); } diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 1d69d2b990..0c4f04db3d 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -880,7 +880,7 @@ void GLMirrorPortal::DrawContents() vertex_t *v2 = linedef->v2; // Reflect the current view behind the mirror. - if (linedef->dx == 0) + if (linedef->Delta().X == 0) { // vertical mirror viewx = v1->fixX() - startx + v1->fixX(); @@ -889,7 +889,7 @@ void GLMirrorPortal::DrawContents() if (startxfixX()) viewx -= FRACUNIT/2; else viewx += FRACUNIT/2; } - else if (linedef->dy == 0) + else if (linedef->Delta().Y == 0) { // horizontal mirror viewy = v1->fixY() - starty + v1->fixY(); diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index 89431b1c29..22955a9110 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -186,8 +186,8 @@ struct GLLinePortal : public GLPortal { v1 = line->v1; v2 = line->v2; - dx = line->dx; - dy = line->dy; + dx = line->fixDx(); + dy = line->fixDy(); } GLLinePortal(FGLLinePortal *line) @@ -198,8 +198,8 @@ struct GLLinePortal : public GLPortal line_t *lline = line->reference->mDestination; v1 = lline->v1; v2 = lline->v2; - dx = lline->dx; - dy = lline->dy; + dx = lline->fixDy(); + dy = lline->fixDy(); } else { diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 28eb76777a..25ba616df2 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1054,12 +1054,12 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, to= (rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))? 0.f : FIXED2FLOAT(tci.RowOffset(mastersd->GetTextureYOffset(side_t::mid))); - to += FIXED2FLOAT(rowoffset); + to += FIXED2FLOAT(rowoffset) + rover->top.model->GetPlaneTexZF(rover->top.isceiling); - uplft.v=tci.FloatToTexV(to + FIXED2FLOAT(*rover->top.texheight-ff_topleft)); - uprgt.v=tci.FloatToTexV(to + FIXED2FLOAT(*rover->top.texheight-ff_topright)); - lolft.v=tci.FloatToTexV(to + FIXED2FLOAT(*rover->top.texheight-ff_bottomleft)); - lorgt.v=tci.FloatToTexV(to + FIXED2FLOAT(*rover->top.texheight-ff_bottomright)); + uplft.v=tci.FloatToTexV(to + FIXED2FLOAT(-ff_topleft)); + uprgt.v=tci.FloatToTexV(to + FIXED2FLOAT(-ff_topright)); + lolft.v=tci.FloatToTexV(to + FIXED2FLOAT(-ff_bottomleft)); + lorgt.v=tci.FloatToTexV(to + FIXED2FLOAT(-ff_bottomright)); type=RENDERWALL_FFBLOCK; CheckTexturePosition(); }