mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
- made adjustments for changes to linedef delta.
This commit is contained in:
parent
e4d68e17fd
commit
cadd8f2d4a
5 changed files with 18 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 (startx<v1->fixX()) 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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue